[CRIU] [PATCH] zdtm: Fixup netns_sub_veth test hang

Kirill Tkhai ktkhai at virtuozzo.com
Wed May 17 04:05:16 PDT 2017


This patch fixes the test hang, which happens in my envinronment.

==================== Run zdtm/static/netns_sub_veth in uns =====================
Start test
Test is SUID
./netns_sub_veth --pidfile=netns_sub_veth.pid --outfile=netns_sub_veth.out

==== ALARM ====
  PID TTY      STAT   TIME COMMAND
 1991 ?        Ssl    0:40  \_ /usr/lib/gnome-terminal/gnome-terminal-server
 2124 pts/1    Ss+    0:00  |   \_ bash
 2416 pts/2    Ss+    0:00  |   \_ bash
 4064 pts/4    Ss     0:00  |   \_ bash
 4075 pts/4    S      0:00  |   |   \_ su
 4085 pts/4    S      0:00  |   |       \_ bash
 1556 pts/4    S+     0:00  |   |           \_ python2 ./test/zdtm.py run -t zdtm/static/netns_sub_veth
 1590 pts/4    S+     0:00  |   |               \_ ./zdtm_ct zdtm.py
 1605 pts/4    S+     0:00  |   |               |   \_ python2 zdtm.py
 1616 pts/4    S+     0:00  |   |               |       \_ python2 zdtm.py
 1960 pts/4    S+     0:00  |   |               |           \_ make --no-print-directory -C zdtm/static netns_sub_veth.pid
 1969 pts/4    S+     0:00  |   |               |               \_ ./netns_sub_veth --pidfile=netns_sub_veth.pid --outfile=netns_sub_veth.out
 1970 ?        Ss     0:00  |   |               |                   \_ ./netns_sub_veth --pidfile=netns_sub_veth.pid --outfile=netns_sub_veth.
 1973 ?        S      0:00  |   |               |                       \_ ./netns_sub_veth --pidfile=netns_sub_veth.pid --outfile=netns_sub_v
 1974 ?        Ss     0:00  |   |               |                           \_ ./netns_sub_veth --pidfile=netns_sub_veth.pid --outfile=netns_s
 1975 ?        Z      0:00  |   |               |                               \_ [netns_sub_veth] <defunct>
 1979 pts/4    R+     0:00  |   |               \_ ps axf

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 test/zdtm/static/netns_sub_veth.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/test/zdtm/static/netns_sub_veth.c b/test/zdtm/static/netns_sub_veth.c
index 733072f26..9e722924d 100644
--- a/test/zdtm/static/netns_sub_veth.c
+++ b/test/zdtm/static/netns_sub_veth.c
@@ -97,10 +97,14 @@ int main(int argc, char **argv)
 			return -1;
 		}
 		if (pid[i] == 0) {
-			if (userns && unshare(CLONE_NEWUSER))
+			if (userns && unshare(CLONE_NEWUSER)) {
+				task_waiter_complete(&lock, i);
 				return 1;
-			if (unshare(CLONE_NEWNET))
+			}
+			if (unshare(CLONE_NEWNET)) {
+				task_waiter_complete(&lock, i);
 				return 1;
+			}
 
 			task_waiter_complete(&lock, i);
 			test_waitsig();



More information about the CRIU mailing list