Re: zombie with CLONE_THREAD

From: Roland McGrath
Date: Thu Jul 01 2004 - 00:40:56 EST


> this looks much less obvious than my fix. Instead of fixing
> TASK_DEAD like I did, you're actually working around the fact the child
> didn't go away when exit_notify was called on it.

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.

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).
However, the reliable notification of the fact that the thread died is very
useful for anything tracing/debugging it.


Thanks,
Roland

-
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/