Re: [patch] Re: Problem with exiting threads under NPTL

From: Roland McGrath
Date: Mon Dec 15 2003 - 17:57:56 EST


> On Sun, 2003-12-14 at 23:10, Linus Torvalds wrote:
>
> > Even though the parent ignores SIGCHLD it _can_ be running on another CPU
> > in "wait4()".
>
> which fwiw is a case of illegal behavior in the program ... of course
> the kernel shouldn't die if it happens.

No, it is legal to call wait* when ignoring SIGCHLD--and it is required to
return ECHILD for the dead ones. For example, using waitpid with WNOHANG
is a valid way to poll for the liveness of a child (though there is no good
reason why an application wouldn't just use kill(,0) for that). It's not a
method that has anything to recommend it, but it is perfectly valid and the
range of permissible results is well-specified.
-
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/