libstore: always unmask all signals when launching build processes

when starting builders we want the inner processes to run with a blank
slate. if some signals are masked for any reason the builder processes
may attempt to send signals to each other that are never delivered; we
avoid this by unmasking all singals. since every build tree also has a
session and process group of its own we are not in danger of sending a
signal to a builder by accident from any source, so unmasking is okay.

Change-Id: I90720ed2bd44502ffb6d2bb848c05369809abeba
This commit is contained in:
eldritch horrors
2026-02-02 14:20:54 +00:00
parent 9ad8136825
commit ab6d8f513b
+7 -1
View File
@@ -1211,7 +1211,13 @@ void LocalDerivationGoal::runChild(const Path & builder, const Strings & envStrs
logger = makeSimpleLogger();
restoreSignals();
{
sigset_t set;
sigemptyset(&set);
if (sigprocmask(SIG_SETMASK, &set, nullptr)) {
throw SysError("failed to unmask signals");
}
}
/* Put the child in a separate session (and thus a separate
process group) so that it has no controlling terminal (meaning