Re: [PATCH] Re: 8139too: defunct threads

Andreas Ferber
2001-04-14T23:30:38Z

Hi,

On Sat, Apr 14, 2001 at 07:53:28PM +0100, Alan Cox wrote:
> > Rod's init version (from RH 7.0) doesn't reap children that died before
> > it was started. Is that an init bug or should the kernel reap them
> > before the execve?
> I would say thats an init bug

It doesn't seem to be that simple.

Redhat's init does child reaping in its SIGCHLD handler using the
following:

while((pid = waitpid(-1, &st, WNOHANG)) != 0) {
if (errno == ECHILD) break;
/* do some stuff, nothing which could break out of the loop */
}

This should reap all leftover childs from kernel startup when init
receives SIGCHLD for the first time, but somehow the kernel seems to
skip them while searching for a dead process in sys_wait4(). I can't
do any further testing because I don't have a 8139 NIC, but I can't
find a problem in init's child reaping code.

Please tell me if I'm missing something, but I think this is really a
kernel issue, not a bug in init.

Andreas
--
I've finally learned what "upward compatible" means. It means we get to
keep all our old mistakes.
-- Dennie van Tassel