Re: zombie with CLONE_THREAD

From: Linus Torvalds
Date: Thu Jul 01 2004 - 00:57:47 EST




On Wed, 30 Jun 2004, Roland McGrath wrote:
>
> No, I am preserving the feature that the child doesn't go away in this case.
> ptraced threads always become zombies and let the ptracer see their exit
> notification and status value. That is the way we want it to stay.

Umm.. This is not the "ptrace_list". This is the _regular_ child list.

Which means that a bad person can try to:
- have "normal" children that are self-reaping.
- _also_ have a self-reaping ptraced child.

Now those _normal_ children may go away, no?

> Linus makes the same point:
> > To let the tracer look at the exit code?
> >
> > How would you otherwise see what exit code the child exited with?
>
> In fact, the exit code is usually completely uninteresting for a
> CLONE_THREAD thread (after all, ptrace is the *only* way to see that value,
> so the _exit call didn't expect to pass useful information that way).

Hmm. That would argue for Andrea's patch.

> However, the reliable notification of the fact that the thread died is very
> useful for anything tracing/debugging it.

.. 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).

Wouldn't that be reliable enough?

So now I'm starting to lean towards Andrea's patch after all..

(Let no-one say that I don't change my mind when presented with good
arguments. Some people complain that I change my mind _too_ often ;)

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/