<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>I mean --sbs and to look from parallel console on processes states before dump
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>От:</b> Andrey Vagin<br>
<b>Отправлено:</b> 13 апреля 2017 г. 23:28:42<br>
<b>Кому:</b> Kirill Tkhai<br>
<b>Копия:</b> criu@openvz.org; Pavel Tikhomirov; Pavel Emelianov<br>
<b>Тема:</b> Re: [PATCH v3 00/55] Nested pid namespaces support</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">On Thu, Apr 13, 2017 at 12:06:59PM +0300, Kirill Tkhai wrote:<br>
> On 13.04.2017 02:39, Andrei Vagin wrote:<br>
> > On Tue, Apr 11, 2017 at 03:10:27PM +0300, Kirill Tkhai wrote:<br>
> >> On 11.04.2017 07:26, Andrei Vagin wrote:<br>
> >>> [root@fc24 criu]# python test/zdtm.py run -t zdtm/static/pidns00 --iter 1<br>
> >>> Checking feature ns_pid<br>
> >>> === Run 1/1 ================ zdtm/static/pidns00<br>
> >>><br>
> >>> ======================== Run zdtm/static/pidns00 in ns =========================<br>
> >>> make[1]: Nothing to be done for 'default'.<br>
> >>> Start test<br>
> >>> Test is SUID<br>
> >>> make[1]: Nothing to be done for 'default'.<br>
> >>> ./pidns00 --pidfile=pidns00.pid --outfile=pidns00.out<br>
> >>> Run criu dump<br>
> >>> Run criu restore<br>
> >>> ################ Test zdtm/static/pidns00 FAIL at CRIU restore #################<br>
> >>> ##################################### FAIL #####################################<br>
> >>> [root@fc24 criu]# dmesg -c<br>
> >>> [439441.751893] traps: pidns00[27458] general protection ip:7f9b3183d642 sp:7ffc2d9587c0 error:0<br>
> >>> [439441.751900] in libc.so.6[7f9b31806000+1bd000]<br>
> >>> [439441.768416] systemd-journald[13102]: Successfully sent stream file descriptor to service manager.<br>
> >>> [439441.886503] systemd-journald[13102]: Compressed data object 1176 -> 652 using LZ4<br>
> >>> [439441.887834] systemd-journald[13102]: Compressed data object 1658 -> 653 using LZ4<br>
> >>> [439441.889093] systemd-journald[13102]: Compressed data object 3128 -> 1774 using LZ4<br>
> >>> [439442.037519] criu[27482]: segfault at 12 ip 000000000047e4d3 sp 00007ffc190820a8 error 4 in criu[400000+117000]<br>
> >>> [439442.058973] systemd-journald[13102]: Successfully sent stream file descriptor to service manager.<br>
> >>> [439442.211795] systemd-journald[13102]: Compressed data object 1150 -> 665 using LZ4<br>
> >>> [439442.213101] systemd-journald[13102]: Compressed data object 5493 -> 1619 using LZ4<br>
> >>> [root@fc24 criu]# <br>
> >>> [root@fc24 criu]# git diff<br>
> >>> diff --git a/test/zdtm/static/pidns00.c b/test/zdtm/static/pidns00.c<br>
> >>> index e3ed74b..e86d488 100644<br>
> >>> --- a/test/zdtm/static/pidns00.c<br>
> >>> +++ b/test/zdtm/static/pidns00.c<br>
> >>> @@ -54,6 +54,11 @@ futex_t *futex;<br>
> >>> <br>
> >>> int child(void)<br>
> >>> {<br>
> >>> + int fd = open("/proc/self/ns/pid", O_RDONLY);<br>
> >>> + unshare(CLONE_NEWPID);<br>
> >>> + if (fork())<br>
> >>> + setns(fd, CLONE_NEWPID);<br>
> >>> + close(fd);<br>
> >>> futex_wait_while_lt(futex, 1);<br>
> >>> return 0;<br>
> >>> }<br>
> >><br>
> >> The below fixes the issue. Thanks for finding this!<br>
> >><br>
> >> diff --git a/criu/pstree.c b/criu/pstree.c<br>
> >> index b2703dd01..d032957ae 100644<br>
> >> --- a/criu/pstree.c<br>
> >> +++ b/criu/pstree.c<br>
> >> @@ -844,7 +844,7 @@ int get_free_pid(struct ns_id *ns)<br>
> >> node = rb_next(&prev->ns[level].node);<br>
> >> if (node == NULL)<br>
> >> return pid;<br>
> >> - next = rb_entry(node, struct pid, ns[0].node);<br>
> >> + next = rb_entry(node, struct pid, ns[level].node);<br>
> > <br>
> > Now criu restore hangs<br>
> > <br>
> > 8270 pts/0 T 0:00 \_ python test/zdtm.py run -t zdtm/static/pidns00<br>
> > 8281 pts/0 T 0:00 | \_ ./zdtm_ct zdtm.py<br>
> > 8282 pts/0 S 0:00 | \_ python2 zdtm.py<br>
> > 8284 pts/0 T 0:00 | \_ python2 zdtm.py<br>
> > 8343 pts/0 S 0:00 | \_ ../criu/criu restore -o restore.log -D dump/zdtm/static/pidns00/29/1 -v4 --pidfile /root/git/criu/test/zdtm/static/pidns00.pid --ro<br>
> > 8348 pts/0 S 0:00 | \_ ../criu/criu restore -o restore.log -D dump/zdtm/static/pidns00/29/1 -v4 --pidfile /root/git/criu/test/zdtm/static/pidns00.pid
<br>
> > 8361 pts/0 S 0:00 | | \_ ../criu/criu restore -o restore.log -D dump/zdtm/static/pidns00/29/1 -v4 --pidfile /root/git/criu/test/zdtm/static/pidns00.<br>
> > 8367 pts/0 S 0:00 | | \_ ../criu/criu restore -o restore.log -D dump/zdtm/static/pidns00/29/1 -v4 --pidfile /root/git/criu/test/zdtm/static/pidns00.<br>
> > 8369 pts/0 S 0:00 | | \_ ../criu/criu restore -o restore.log -D dump/zdtm/static/pidns00/29/1 -v4 --pidfile /root/git/criu/test/zdtm/static/pidns00.<br>
> > 8370 pts/0 S 0:00 | | \_ ../criu/criu restore -o restore.log -D dump/zdtm/static/pidns00/29/1 -v4 --pidfile /root/git/criu/test/zdtm/static/pidns00.<br>
> > 8349 pts/0 S 0:00 | \_ ../criu/criu restore -o restore.log -D dump/zdtm/static/pidns00/29/1 -v4 --pidfile /root/git/criu/test/zdtm/static/pidns00.pid
<br>
> > 8362 pts/0 S 0:00 | \_ ../criu/criu restore -o restore.log -D dump/zdtm/static/pidns00/29/1 -v4 --pidfile /root/git/criu/test/zdtm/static/pidns00.<br>
> > 8363 pts/0 S 0:00 | \_ ../criu/criu restore -o restore.log -D dump/zdtm/static/pidns00/29/1 -v4 --pidfile /root/git/criu/test/zdtm/static/pidn<br>
> > 8366 pts/0 S 0:00 | | \_ ../criu/criu restore -o restore.log -D dump/zdtm/static/pidns00/29/1 -v4 --pidfile /root/git/criu/test/zdtm/static/<br>
> > 8364 pts/0 S 0:00 | \_ ../criu/criu restore -o restore.log -D dump/zdtm/static/pidns00/29/1 -v4 --pidfile /root/git/criu/test/zdtm/static/pidn<br>
> > 8365 pts/0 S 0:00 | \_ ../criu/criu restore -o restore.log -D dump/zdtm/static/pidns00/29/1 -v4 --pidfile /root/git/criu/test/zdtm/static/pidn<br>
> > 8368 pts/0 S 0:00 | \_ ../criu/criu restore -o restore.log -D dump/zdtm/static/pidns00/29/1 -v4 --pidfile /root/git/criu/test/zdtm/static/<br>
> > 8371 pts/0 R+ 0:00 \_ ps axf<br>
> <br>
> Could you start the test with --sbs? I suppose, zombies are there for some reasons, and they are not appropriate dumped.<br>
<br>
--sbs doesn't help, I tried to wait a few seconds between each step.<br>
<br>
I run pidns00 with the next patch:<br>
diff --git a/test/zdtm/static/pidns00.c b/test/zdtm/static/pidns00.c<br>
index e3ed74b..e86d488 100644<br>
--- a/test/zdtm/static/pidns00.c<br>
+++ b/test/zdtm/static/pidns00.c<br>
@@ -54,6 +54,11 @@ futex_t *futex;<br>
<br>
int child(void)<br>
{<br>
+ int fd = open("/proc/self/ns/pid", O_RDONLY);<br>
+ unshare(CLONE_NEWPID);<br>
+ if (fork())<br>
+ setns(fd, CLONE_NEWPID);<br>
+ close(fd);<br>
futex_wait_while_lt(futex, 1);<br>
return 0;<br>
}<br>
<br>
</div>
</span></font>
</body>
</html>