plugins: Initialize plugins control by default

Submitted by Cyrill Gorcunov on May 17, 2016, 6:16 p.m.

Details

Message ID 1463509017-23820-1-git-send-email-gorcunov@virtuozzo.com
State Accepted
Series "plugins: Initialize plugins control by default"
Commit 1d13b2f6e9ed51dfa4e5afb7c968e12b308d1ce5
Headers show

Commit Message

Cyrill Gorcunov May 17, 2016, 6:16 p.m.
We run "pre-dump" scripts earlier than calling
anything else, so in case if it get failed the
plugins cleanup routine hit list structure set
into zeros which lead into SIGSEGV when we're
trying to walk over.

Thus simply init it as empty list.

Reported-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com>
---
 criu/plugin.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/criu/plugin.c b/criu/plugin.c
index f764ae7..5814a7a 100644
--- a/criu/plugin.c
+++ b/criu/plugin.c
@@ -13,7 +13,10 @@ 
 #include "list.h"
 #include "log.h"
 
-cr_plugin_ctl_t cr_plugin_ctl;
+cr_plugin_ctl_t cr_plugin_ctl = {
+	.head.next = &cr_plugin_ctl.head,
+	.head.prev = &cr_plugin_ctl.head,
+};
 
 /*
  * If we met old version of a plugin, selfgenerate a plugin descriptor for it.

Comments

Pavel Emelianov May 23, 2016, 4:48 p.m.
Applied