[PATCH] fix bogus ECHILD return from wait* with zombie group leader
Klaus Dittrich observed this bug and posted a test case for it. This patch fixes both that failure mode and some others possible. What Klaus saw was a false negative (i.e. ECHILD when there was a child) when the group leader was a zombie but delayed because other children live; in the test program this happens in a race between the two threads dying on a signal. The change to the TASK_TRACED case avoids a potential false positive (blocking, or WNOHANG returning 0, when there are really no children left), in the race condition where my_ptrace_child returns zero. Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing
Please register or sign in to comment