[CRIU] [PATCH] ns: initialize nsid in rst_add_ns_id

Andrey Vagin avagin at openvz.org
Wed Apr 23 03:06:48 PDT 2014


Execute zdtm/live/static/pipe00
./pipe00 --pidfile=pipe00.pid --outfile=pipe00.out
Dump 3158
Restore
test/zdtm.sh: line 472:  3173 Segmentation fault      (core dumped) setsid  restore --file-locks --tcp-established -x -D  -o

Reported-by: Jenkins Criuovich
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 namespaces.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/namespaces.c b/namespaces.c
index 1143a02..6be030f 100644
--- a/namespaces.c
+++ b/namespaces.c
@@ -147,7 +147,8 @@ int rst_add_ns_id(unsigned int id, pid_t pid, struct ns_desc *nd)
 		}
 	}
 
-	if (rst_new_ns_id(id, pid, nd) == NULL)
+	nsid = rst_new_ns_id(id, pid, nd);
+	if (nsid == NULL)
 		return -1;
 
 	pr_info("Add namespace %d pid %d\n", nsid->id, nsid->pid);
-- 
1.8.5.3



More information about the CRIU mailing list