[CRIU] Re: [PATCH] ptrace: Kill task with -9 explicitly when
detaching
Cyrill Gorcunov
gorcunov at openvz.org
Wed Feb 1 13:14:18 EST 2012
On Wed, Feb 01, 2012 at 10:06:51PM +0400, Pavel Emelyanov wrote:
> 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;
> }
>
Hmm, I'm getting
[root at neptune crtools]# cat /home/crtools/test/dump/zombie00/14706/dump.log
========================================
Dumping process group (pid: 14706)
========================================
Collecting tasks starting from 14706
Seized task 14706, state 1
Collected 14706 in 1 state
Collecting tasks starting from 14707
Seized task 14707, state 0
Collected 14707 in 2 state
Collecting tasks starting from 14708
Seized task 14708, state 0
Collected 14708 in 2 state
Collecting tasks starting from 14709
Seized task 14709, state 0
Collected 14709 in 2 state
Collecting tasks starting from 14710
Error (ptrace.c:72): SEIZE 14710: task not stopped after seize
[root at neptune crtools]#
It's expected?
Cyrill
More information about the CRIU
mailing list