Race condition in tdb_runtime_check_for_robust_mutexes()
uri at samba.org
Thu Mar 24 13:44:09 UTC 2016
On 03/23/2016 08:45 PM, Ralph Boehme wrote:
> haven't looked at your patch closely yet, just wanted to mention a
> possible way to avoid the spurious SIGCHLD signal problem when we
> block it.
> Instead we can keep the handler, but dont set SA_RESTART when
> installing it (this ensures sleep() will be interrupted later), remove
> waitpid from the handler, just set a flag.
> Then in the rendesvous part a) check flag, if not set b) sleep(), if
> set done. The sleep will be either interrupted or awake, goto a).
It seems to me that this algorithm doesn't exactly capture the current
behavior, because while we sleep, the handler calls the previously
installed handler, and that one could reap our child process. If we
don't call the other handler, then we cause it to miss some signals.
Do you have issues with the current patch which retains the current
behavior of "playing nicely with the environment" and only removes
(hopefully) the race condition?
More information about the samba-technical