Race condition in tdb_runtime_check_for_robust_mutexes()

Ralph Boehme rb at sernet.de
Wed Mar 23 18:45:24 UTC 2016

On Wed, Mar 23, 2016 at 01:02:48PM +0200, Uri Simchoni wrote:
> Here's a patch to fix the issue. I don't have confirmation that it fixes the
> issue but would like to continue the discussion on:
> a. Whether this is the right direction or should we eliminate the signal
> handler as Ralph suggested.

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).

> b. The use of sigprocmask without #ifdefs, as opposed to installing and
> uninstalling the signal handler - it's hard as it is to get those things
> right, and I wonder whether we target envs which don't support sigprocmask.
> fork() hasn't #ifdefs around it ... :)

As mentioned by Jeremy, I'd say sigprocmask is standard enough given
it was standardized in POSIX.1-2001.


SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen

More information about the samba-technical mailing list