[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More waitpid issues with CLONE_DETACHED/CLONE_THREAD




On Sun, 1 Feb 2004, Daniel Jacobowitz wrote:
> 
> Here you go.  The bug turns out not to be related directly to
> CLONE_DETACHED.  Compile testcase with -DNOTHREAD to use fork (well,
> clone, but without the fancy flags), without -DNOTHREAD to use
> CLONE_DETACHED | CLONE_THREAD.

I don't think this bug has anything to do with anything else.

This program seems to show that PTRACE_KILL simply doesn't work.

What ptrace_kill() does is effectively:

 - stage 1: ptrace_check_attach(): wait for child stopped

 - stage 2: PTRACE_KILL does:

	child->exit_code = SIGKILL;
	wake_up_process(child);

and the thing is, it looks like the signal handling changes have totally
made the child ignore the "exit_code" thing, unless I'm seriously
misreading something.

Roland, you know this code better than I do. Any comments?

I suspect the PTRACE_KILL logic should also do a

	spin_lock_irqsave(child->sighand->siglock, flags);
	sigaddset(&child->pending->signal, SIGKILL);
	set_tsk_thread_flag(child, TIF_SIGPENDING);
	spin_unlock_irqrestore(child->sighand->siglock, flags);

	ptrace_detach(child);

which would set the SIGKILL thing properly, but I suspect we had a good
reason not to do it that way originally. 

Daniel?

		Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo _at_ vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


この情報があなたの探していたものかどうか選択してください。
yes/まさにこれだ!   no/違うなぁ   part/一部見つかった   try/これで試してみる

あなたが探していた情報はどのようなことか、ご自由に記入下さい。特に「まさにこれだ!」と言う場合は記入をお願いします。
例:「複数のマシンからCATV経由でipmasqueradeを利用してWebを参照したい場合の設定について」
Follow-Ups: References: