Re: BUG: NTPL: waitpid() doesn't return?

Linus Torvalds
2004-01-31T22:52:43Z

On Sat, 31 Jan 2004, Matthias Urlichs wrote:
>
> So there's definitely something fishy going on here.

Yes. Especially as the actual clone() we're waiting for was this
one:

31342 clone( <unfinished ...>
31342 <... clone resumed> child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x416dbc18) = 31346

which wasn't the detached one at all. I looked at the wrong clone().

> Besides, bert's test program exhibits exactly the same clone()
> arguments, yet it works ...

[ twilight zone music ]

Anyway. It's interesting to see who gets the SIGCHLD (which is why I
looked at the wrong clone) - that goes to 31340:

31346 exit_group(0) = ?
31340 --- SIGCHLD (Child exited) @ 0 (0) ---
31342 waitpid(31346, <unfinished ...>

which is just because we send a thread-group signal, so the signal isn't
actually necessarily directed toward the "real parent".

But the real parent _should_ have been woken up by __wake_up_parent().
And I don't see why that wouldn't happen.

Linus