On 11/03/2024 15:17, Pádraig Brady wrote:
There was a narrow race condition reported at:
https://github.com/coreutils/coreutils/issues/82
Then I noticed another related race condition
in the case of failing fork().
Both should be addressed by the attached.
Actually the second one to ensure processes are killed
is only moving the race around, since the child may
receive the signal in the same narrow window before assigning
monitored_pid, and ignore it.
The attached avoids the issue by blocking signal handling
until monitored_pid is in a deterministic state wrt fork().
I'll think a bit more about this before applying.