Re: zombie with CLONE_THREAD

From: Linus Torvalds
Date: Thu Jul 01 2004 - 10:50:25 EST




On Thu, 1 Jul 2004, Roland McGrath wrote:
>
> > .. since this information should be available anyway (we'll have woken up
> > the tracer, and the tracer will see that the child is gone by simply
> > seeing the ESRCH errorcode from ptrace).
>
> When did you wake up the tracer? I don't see how that happened.

exit_notify() will inform the tracer:

if (tsk->exit_signal != -1 && thread_group_empty(tsk)) {
int signal = tsk->parent == tsk->real_parent ? tsk->exit_signal : SIGCHLD;
do_notify_parent(tsk, signal);
} else if (tsk->ptrace) {
*** do_notify_parent(tsk, SIGCHLD); *****
}

so this should catch it. It even gets the pid of the child in the siginfo
structure if it really wants to see that..

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