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

Cyrill Gorcunov gorcunov at openvz.org
Wed Feb 1 13:17:56 EST 2012


The commit is pushed to "master" and will appear on git://github.com/cyrillos/crtools.git
------>
commit 766a42e3167738d8dfe4c599a83321bde03e6808
Author: Pavel Emelyanov <xemul at parallels.com>
Date:   Wed Feb 1 22:06:51 2012 +0400

    ptrace: Kill task with -9 explicitly when detaching
    
    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>
    Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 ptrace.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

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