Re: [hackers] [dwm][PATCH] Fix signal race condition

From: Roberto E. Vargas Caballero <>
Date: Tue, 24 Jan 2017 22:05:59 +0100

> If the signal(2) call within the signal handler fails, die() is called
> which in turn is not signal-safe. Therefore, the change to sigaction
> makes dwm() more portable among POSIX systems and fixes a signal race
> condition.

You are right with the original race condition, but I think your solution
has also a race condition, because you are not blocking signals while
you are in the handler. From my point of view what should be done here
is simply:

        signal(SIGCHLD, SIG_IGN);

It will avoid zombie children.

Received on Tue Jan 24 2017 - 22:05:59 CET

This archive was generated by hypermail 2.3.0 : Tue Jan 24 2017 - 22:12:18 CET