[CRIU] [PATCH] plugins: Initialize plugins control by default

Cyrill Gorcunov gorcunov at gmail.com
Tue May 17 11:16:57 PDT 2016


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 at virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>
---
 criu/plugin.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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.
-- 
2.5.5



More information about the CRIU mailing list