lkml.org 
[lkml]   [2004]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: zombie with CLONE_THREAD
On Thu, Jul 01, 2004 at 08:49:10AM -0700, Linus Torvalds wrote:
>
>
> 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..

it will get the wakeup, but that doesn't mean wait4 will return if
it's waiting for all childs. Now I don't know but with strace it may
even be ok by luck, but it certainly changes the semantics of
wait4/ptrace at least a little and I could remotely imagine if somebody
wants a wait4 to return when a ptraced child exited, if there are other
"regular" children. That's why I admitted it can be considered a feature
and not a completely worthless effort to leave self-reaping tasks as
zombies if they're ptraced.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.073 / U:0.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site