[CRIU] [PATCH] ptrace: Kill task with -9 explicitly when detaching

Pavel Emelyanov xemul at parallels.com
Wed Feb 1 13:06:51 EST 2012


Strange fact, but a task seems to live for some time after PTRACE_KILL :(
Don't know yet why this happens, I'm poking Oleg on that, but this one makes
it die right at once.

The streaming file read test passes after this.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>

---

diff --git a/ptrace.c b/ptrace.c
index 4f65206..7b1b128 100644
--- a/ptrace.c
+++ b/ptrace.c
@@ -23,9 +23,10 @@ int unseize_task(pid_t pid, enum cr_task_state st)
 {
 	if (st == CR_TASK_STOP)
 		return ptrace(PTRACE_DETACH, pid, NULL, NULL);
-	else if (st == CR_TASK_KILL)
+	else if (st == CR_TASK_KILL) {
+		kill(pid, SIGKILL);
 		return ptrace(PTRACE_KILL, pid, NULL, NULL);
-	else {
+	} else {
 		BUG_ON(1);
 		return -1;
 	}


More information about the CRIU mailing list