From ab6d8f513bda2ea27933b984e3a41ae4b7ce1d91 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Mon, 2 Feb 2026 14:43:35 +0100 Subject: [PATCH] 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 --- lix/libstore/build/local-derivation-goal.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lix/libstore/build/local-derivation-goal.cc b/lix/libstore/build/local-derivation-goal.cc index 5d7a4ec7c..7f0a65c89 100644 --- a/lix/libstore/build/local-derivation-goal.cc +++ b/lix/libstore/build/local-derivation-goal.cc @@ -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