Messages in this thread | | | Date | Thu, 1 Jul 2004 18:23:28 +0200 | From | Andrea Arcangeli <> | Subject | Re: 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/
| |