[PATCH] posix: Do not use WNOHANG in waitpid call for Linux posix_spawn
Tulio Magno Quites Machado Filho
tuliom@linux.vnet.ibm.com
Mon Oct 23 13:50:00 GMT 2017
Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
> As shown in some buildbot issues on aarch64 and powerpc, calling
> clone (VFORK) and waitpid (WNOHANG) does not guarantee the child
> is ready to be collected. This patch changes the call back to 0
> as before fe05e1cb6d64 fix.
>
> This change can lead to the scenario 4.3 described in the commit,
> where the waitpid call can hang undefinitely on the call. However
> this is also a very unlikely and also undefinied situation where
> both the caller is trying to terminate a pid before posix_spawn
> returns and the race pid reuse is triggered. I don't see how to
> correct handle this specific situation within posix_spawn.
>
> Checked on x86_64-linux-gnu, aarch64-linux-gnu and
> powerpc64-linux-gnu.
Tested on powerpc64le too and I can't reproduce the issue anymore.
Thanks!
--
Tulio Magno
More information about the Libc-alpha
mailing list