[CRIU] [PATCH] zdtm: Fix race in zdtm/transition/epoll.c test

Kirill Tkhai ktkhai at virtuozzo.com
Tue Feb 20 12:28:52 MSK 2018


Child may see close() result before it receives signal,
while it shouldn't see it. Instead of games with later
close(), just stop do it. sys_exit() after program finish
will close them all.

Reported-by: Andrey Vagin <avagin at virtuozzo.com>
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 test/zdtm/transition/epoll.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/zdtm/transition/epoll.c b/test/zdtm/transition/epoll.c
index f89d96d41..4eac5214c 100644
--- a/test/zdtm/transition/epoll.c
+++ b/test/zdtm/transition/epoll.c
@@ -175,8 +175,8 @@ int main(int argc, char **argv)
 
 	test_waitsig();
 
-	killall();
 	for (i = 0; i < scale; i++) {
+		kill(pids[i], SIGUSR2);
 		if (waitpid(pids[i], &rv, 0) < 0) {
 			fail("waitpid error: %m\n");
 			counter++;



More information about the CRIU mailing list