[CRIU] [PATCH] ptrace: skip ptraced zombies

Andrey Vagin avagin at openvz.org
Tue Oct 27 00:44:06 PDT 2015


From: Andrew Vagin <avagin at openvz.org>

It's posiable that criu is able to attach to a process
and then it becomes a zombie.

$ while :; do bash ./zdtm.sh -C --freeze-cgroup /sys/fs/cgroup/freezer/test transition/fork || break; done
...
(00.000978) Error (ptrace.c:154): SEIZE 13666: task not stopped after seize

Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
 ptrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ptrace.c b/ptrace.c
index 1945d62..b28824b 100644
--- a/ptrace.c
+++ b/ptrace.c
@@ -131,7 +131,7 @@ try_again:
 		goto err;
 	}
 
-	if (ret < 0) {
+	if (ret < 0 || WIFEXITED(status) || WIFSIGNALED(status)) {
 		if (cr.state != 'Z') {
 			if (pid == getpid())
 				pr_err("The criu itself is within dumped tree.\n");
-- 
2.4.3



More information about the CRIU mailing list