This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Linux MAY_FOLLOW_EXEC #2 [Re: RFC: Fix crash on i386 (%gs-)threaded programs using execve(2)]
> Date: Sat, 29 Jul 2006 20:53:17 +0200
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
>
> That waitpid(3) WNOHANG smells there for me but it does not hurt the
> testsuite. Should I investigate it more?
That WNOHANG is wrong; inf_ptrace_mourn_inferior() is supposed to be
called when the inferior died. We must call waitpid(2) to make sure
we don't leave behind a zombie. Unfortunately there is some sort of
race and we have to do a blocking wait at this stage, otherwise the
rotting corpse might still escape us.
Mark