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

Pavel Emelyanov xemul at parallels.com
Wed Feb 1 15:20:25 EST 2012


On 02/01/2012 10:14 PM, Cyrill Gorcunov wrote:
> 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?

I haven't seen that, that's also strange, but at least crtools behave
correctly -- doesn't do wrong things, but reports error.

This whole seize things seems ... broken :(

> 	Cyrill
> .
> 



More information about the CRIU mailing list