You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Took the fbuild half of this: PR #2093 (agent/signal-kill-diag, head a3db3eb6).
#1628's cause is already fixed on main — #1631 (db80bbfd) forks every contained child on a process-lifetime thread, so PR_SET_PDEATHSIG no longer fires when a retired Tokio worker exits mid-compile. What stayed missing was #1628's ask 3: when a compiler is killed, the failure said only
failed to compile …/fl/fx+.cpp in library FastLED (exit code -9):
(the compiler wrote nothing to stderr)
which reads like a compiler crash or a source error. Nothing in it says a signal ended the process.
#2093 adds fbuild_core::termination: it recognises both spellings that reach us — -signal (what ToolOutput.exit_code carries on Unix) and 128 + signal, the shell convention a tool that shells out forwards (zccache reports 137 for SIGKILL) — and names the signal when the number is identical on Linux and macOS. SIGBUS/SIGUSR1/SIGUSR2/SIGCONT/SIGSTKFLT disagree between the two, so those print signal N (no portable name) instead of a wrong name, and Windows stays None because it collapses every abnormal exit to -1 and keeps no signal number. The library failure now reads (exit code -9 = SIGKILL (signal 9)) plus a hint that a kill is a host/containment event, not a source error, and the same sentence goes to the daemon log at WARN (log_signal_kill), which is the only place the signal can survive after the fact.
Receipts: cargo test -p fbuild-core --lib termination 8 passed / 0 failed, including a realsh -c 'kill -9 $$' through run_command arriving as exit_code == -9 with empty stderr and classifying as SIGKILL (signal 9); cargo test -p fbuild-library --lib library_compiler 27 passed / 0 failed / 2 ignored; clippy both crates -D warnings clean; enforce_platform_boundary.py --print-totals 44/43. First CI run failed the 1000-LOC gate (library_compiler_tests.rs 1011) — fixed by moving the two tests to library_compiler_signal_tests.rs in a second commit; the gate now passes.
Still open here: the zccache half (its own kill attribution) and #1628's ask 2 — a failed build's output being replayed verbatim to the next request, so a retry cannot recover. I did not touch either: #2093 changes only what a kill says, not what kills or what is cached. #1628 stays closed (its cause is fixed); the replay question deserves its own repro.
Merged as #2093 (48f10475, 2026-11-19T03:59:52Z) — the diagnostics half of this issue, i.e. the fbuild side of FastLED/FastLED#4679's exit -9 compiler kills.
What landed: fbuild_core::termination recognises both the -signal convention and the shell 128+signal form (zccache forwards 137 for SIGKILL), names only signals whose numbers agree on Linux and macOS (others degrade to signal N (no portable name)), and returns None on Windows where every abnormal exit is -1. A killed library TU now reports (exit code -9 = SIGKILL (signal 9)) plus a kill hint instead of only (exit code -9) + (the compiler wrote nothing to stderr), and the same sentence goes to daemon.log at WARN via log_signal_kill().
Receipts: fbuild-core --lib termination 8 pass / 0 fail including a real sh -c 'kill -9 $$' through run_command arriving as exit_code == -9 with empty stderr; fbuild-library --lib library_compiler 27 pass / 0 fail / 2 ignored; clippy -D warnings clean on both crates; fmt clean; boundary 44/43. Post-merge on 48f10475: 17 success / 15 skipped / 0 failure / 13 running.
Remaining half 3 (#1628 ask 2 — a failed build replayed verbatim so a retry cannot recover) has an in-repo instance, and it is now fixed in PR #2103 (agent/fwlib-kill-negative-cache).
fbuild's own negative cache replayed a kill as if it were a verdict about the library. Two memories, both written for any non-zero compile exit and both consulted before compiling:
framework-library-artifacts/<key>/failed/<lib> — global and cross-project, keyed by fbuild version + profile + flags + libraries tree + project headers
So one SIGKILL on a loaded host (or the daemon's containment, or the OOM killer) removed a framework library from every future build sharing that key, permanently, with no route back except --clean-all. The compiler never evaluated the source, so that memory was wrong by construction.
What changed: FbuildError::ProcessTerminated { message, exit_code } (is_signal_kill()) is produced whenever fbuild_core::termination::host_termination recognises the exit code (-9, or the shell form 137 zccache forwards); compile_library_link_inputs_gated now keeps the first FbuildError instead of flattening it to a String (which had erased the kind before any caller saw it); FwLibsPlan::finish writes neither marker for a kill and logs that it did not. Ordinary compiler errors still record both, so nothing about the tolerated-failure policy changes.
Receipts: fbuild-build-esp --lib esp32::orchestrator 102 passed / 0 failed (new: a -9 backend leaves no marker, leaves has_failed false, and the next build recompiles); fbuild-library --lib 367 / 0 / 9 ignored; fbuild-core --lib 448 / 0 / 2 ignored; clippy -D warnings clean on the three crates; cargo check --workspace --all-targets --exclude fbuild-python clean; boundary 44/43.
Not covered here: zccache's own failure caching and its 137-instead-of-the-child's-true-signal attribution (that is the upstream half, and #1866 for the embedded holder). This issue stays open for those.
Merged as #2103 (441326ba, 2026-11-19T17:13:02Z) — fbuild's own half of ask 2, i.e. its negative cache no longer replays a kill.
On main: FbuildError::ProcessTerminated { message, exit_code } + is_signal_kill() (crates/fbuild-core/src/lib.rs), built by compile_exit_error in crates/fbuild-library/src/library/library_compiler.rs when fbuild_core::termination::host_termination recognises the exit code (-9, or the shell form 137 zccache forwards); the join in compile_library_link_inputs_gated keeps the first FbuildError instead of a String, and crates/fbuild-build-esp/src/esp32/orchestrator/framework_libs.rs skips both failure markers for a kill (WARN: "was killed before any diagnostic; not remembering the failure so the next build retries").
Still open here: zccache's own failure caching and its 137-instead-of-the-child's-true-signal attribution (upstream, and #1866 for the embedded holder). This issue stays open for those.
Third in-repo half of this issue: PR #2104 (agent/kill-log-reason).
#1628 ask 1's second sentence is "Every child kill should log a reason and the PID."#1628 ask 3 (the observed kill, -9, nothing on stderr) landed in #2093, and ask 2's replay-verbatim landed in #2103. What was still silent is the kill fbuild itself performs: fbuild_core::subprocess::stop_timed_out_command is on the funnel every external command takes (linkers, objcopy, esptool, arduino-cli, passthrough tools), and on timeout it force-killed the command's whole process tree while writing nothing anywhere — no PID, no argv, no reason. The only record was the caller string command timed out after Ns.
Three call sites killed through it or through an equivalent inline terminate_tree + child.kill() (wait_and_capture, run_command_passthrough_inner, run_command_reporting_with_limit). Now one helper logs WARN force-killing a timed-out command tree (reason: timeout) pid=<pid> limit_ms=<n> argv=[...]before terminating, and the passthrough path reuses it (gaining the bounded reap the captured path already had).
Receipts: fbuild-core --lib subprocess 33/33 with two log assertions (a silent kill fails the test), fbuild-core --lib 449/0/2i, clippy -D warnings clean, fmt clean, boundary 44/43, cargo check --workspace --all-targets --exclude fbuild-python exit 0.
This issue stays OPEN for the zccache half — the compile-child kill itself is upstream (kill_on_drop / stall watchdog, #1866), and the pin is still zccache = "=1.15.8", so nothing to re-verify there yet.
Merged as #2104 (ff28d9fb, 2026-11-19T19:59:37Z, ~19 min merge queue).
On main: stop_timed_out_command (crates/fbuild-core/src/subprocess.rs L637) logs WARN force-killing a timed-out command tree (reason: timeout) pid=<pid> limit_ms=<n> argv=[...]
before terminating the process tree, the passthrough path reuses that helper (drops its own inline terminate_tree + child.kill() and gains the bounded reap budget), and run_command_reporting_with_limit passes args + timeout through (subprocess_report.rs L130).
Two #[traced_test] assertions fail the build if a timed-out kill is ever silent again.
#1630 stays OPEN for the zccache half only — the compile-child killer is zccache's session kill_on_drop / stall watchdog (#1866), and the pin is still zccache = "=1.15.8", so there is nothing
to re-verify on the fbuild side until a zccache release lands.
Re-verified the remaining cell; nothing actionable in-repo left, so I am recording this as upstream-blocked (a comment does not unblock it; only an edit to this issue's title/labels/body does, which is the intent).
ask 2 / replay-verbatim — 441326ba (fix(esp32): retry a framework library whose compiler was killed by a signal #2103): FbuildError::ProcessTerminated + is_signal_kill(); FwLibsPlan::finish writes neither the build-dir .lib.failed nor the global framework-library-artifacts/<key>/failed/<lib> entry for a kill, so a SIGKILL no longer deletes a framework library for every later build.
ask 1 / "log a reason and the PID" — ff28d9fb (fix(subprocess): name the pid, reason and argv of every timed-out child kill #2104): stop_timed_out_command (the funnel every external command takes) logs force-killing a timed-out command tree (reason: timeout) pid=<pid> limit_ms=<n> argv=[...] before terminating; passthrough path reuses the helper; #[traced_test] assertions fail on a silent kill.
zccache reports 137 rather than the child's true signal — upstream; the fbuild side already degrades correctly (137 is classified as SIGKILL).
zccache's own failure caching — upstream.
Re-verify trigger, checked this run: Cargo.toml L221 is still zccache = "=1.15.8" and Cargo.lock L4953-4955 resolves zccache 1.15.8; crates.io's newest release is 1.15.14 (2026-11-03), i.e. unchanged since the #1866 receipt that showed 1.15.14 byte-identical to 1.15.13 and sync_watchdog.rs identical to 1.15.8. So there is no pin to bump and nothing to re-measure; this reopens when a zccache release changes the watchdog/attribution, or when #1866 closes.
Also checked and deliberately not changed: the remaining child.kill() sites on main are (a) test helpers, (b) ContainedChild::kill in platform/process.rs (a thin wrapper with no non-test caller), and (c) the emulator handlers in fbuild-daemon/src/handlers/emulator/{shared,avr8js_headless}.rs, where a kill is the normal completion of halt_on_success / halt_on_error / timeout and the reason already travels to the caller as a MonitorOutcome; a WARN there would fire on every successful emulated run.
Activity
zackees commentedon Nov 19, 2026
Took the fbuild half of this: PR #2093 (
agent/signal-kill-diag, heada3db3eb6).#1628's cause is already fixed on main —#1631(db80bbfd) forks every contained child on a process-lifetime thread, soPR_SET_PDEATHSIGno longer fires when a retired Tokio worker exits mid-compile. What stayed missing was #1628's ask 3: when a compiler is killed, the failure said onlywhich reads like a compiler crash or a source error. Nothing in it says a signal ended the process.
#2093 adds
fbuild_core::termination: it recognises both spellings that reach us —-signal(whatToolOutput.exit_codecarries on Unix) and128 + signal, the shell convention a tool that shells out forwards (zccache reports 137 for SIGKILL) — and names the signal when the number is identical on Linux and macOS. SIGBUS/SIGUSR1/SIGUSR2/SIGCONT/SIGSTKFLT disagree between the two, so those printsignal N (no portable name)instead of a wrong name, and Windows staysNonebecause it collapses every abnormal exit to-1and keeps no signal number. The library failure now reads(exit code -9 = SIGKILL (signal 9))plus a hint that a kill is a host/containment event, not a source error, and the same sentence goes to the daemon log at WARN (log_signal_kill), which is the only place the signal can survive after the fact.Receipts:
cargo test -p fbuild-core --lib termination8 passed / 0 failed, including a realsh -c 'kill -9 $$'throughrun_commandarriving asexit_code == -9with empty stderr and classifying asSIGKILL (signal 9);cargo test -p fbuild-library --lib library_compiler27 passed / 0 failed / 2 ignored; clippy both crates-D warningsclean;enforce_platform_boundary.py --print-totals44/43. First CI run failed the 1000-LOC gate (library_compiler_tests.rs1011) — fixed by moving the two tests tolibrary_compiler_signal_tests.rsin a second commit; the gate now passes.Still open here: the zccache half (its own kill attribution) and #1628's ask 2 — a failed build's output being replayed verbatim to the next request, so a retry cannot recover. I did not touch either: #2093 changes only what a kill says, not what kills or what is cached. #1628 stays closed (its cause is fixed); the replay question deserves its own repro.
zackees commentedon Nov 19, 2026
Merged as #2093 (
48f10475, 2026-11-19T03:59:52Z) — the diagnostics half of this issue, i.e. the fbuild side of FastLED/FastLED#4679'sexit -9compiler kills.What landed:
fbuild_core::terminationrecognises both the-signalconvention and the shell128+signalform (zccache forwards 137 for SIGKILL), names only signals whose numbers agree on Linux and macOS (others degrade tosignal N (no portable name)), and returnsNoneon Windows where every abnormal exit is-1. A killed library TU now reports(exit code -9 = SIGKILL (signal 9))plus a kill hint instead of only(exit code -9)+(the compiler wrote nothing to stderr), and the same sentence goes todaemon.logat WARN vialog_signal_kill().Receipts:
fbuild-core --lib termination8 pass / 0 fail including a realsh -c 'kill -9 $$'throughrun_commandarriving asexit_code == -9with empty stderr;fbuild-library --lib library_compiler27 pass / 0 fail / 2 ignored; clippy-D warningsclean on both crates; fmt clean; boundary 44/43. Post-merge on48f10475: 17 success / 15 skipped / 0 failure / 13 running.This issue stays open. Untouched halves:
db80bbfd, process-lifetime fork thread) — already on main; this PR only made the symptom legible.zackees commentedon Nov 19, 2026
Remaining half 3 (#1628 ask 2 — a failed build replayed verbatim so a retry cannot recover) has an in-repo instance, and it is now fixed in PR #2103 (
agent/fwlib-kill-negative-cache).fbuild's own negative cache replayed a kill as if it were a verdict about the library. Two memories, both written for any non-zero compile exit and both consulted before compiling:
<build>/fw_libs/.<lib>.failed(build dir, flags + source mtimes)framework-library-artifacts/<key>/failed/<lib>— global and cross-project, keyed by fbuild version + profile + flags + libraries tree + project headersSo one SIGKILL on a loaded host (or the daemon's containment, or the OOM killer) removed a framework library from every future build sharing that key, permanently, with no route back except
--clean-all. The compiler never evaluated the source, so that memory was wrong by construction.What changed:
FbuildError::ProcessTerminated { message, exit_code }(is_signal_kill()) is produced wheneverfbuild_core::termination::host_terminationrecognises the exit code (-9, or the shell form137zccache forwards);compile_library_link_inputs_gatednow keeps the firstFbuildErrorinstead of flattening it to aString(which had erased the kind before any caller saw it);FwLibsPlan::finishwrites neither marker for a kill and logs that it did not. Ordinary compiler errors still record both, so nothing about the tolerated-failure policy changes.Receipts:
fbuild-build-esp --lib esp32::orchestrator102 passed / 0 failed (new: a-9backend leaves no marker, leaveshas_failedfalse, and the next build recompiles);fbuild-library --lib367 / 0 / 9 ignored;fbuild-core --lib448 / 0 / 2 ignored; clippy-D warningsclean on the three crates;cargo check --workspace --all-targets --exclude fbuild-pythonclean; boundary 44/43.Not covered here: zccache's own failure caching and its 137-instead-of-the-child's-true-signal attribution (that is the upstream half, and #1866 for the embedded holder). This issue stays open for those.
zackees commentedon Nov 19, 2026
Merged as #2103 (
441326ba, 2026-11-19T17:13:02Z) — fbuild's own half of ask 2, i.e. its negative cache no longer replays a kill.On main:
FbuildError::ProcessTerminated { message, exit_code }+is_signal_kill()(crates/fbuild-core/src/lib.rs), built bycompile_exit_errorincrates/fbuild-library/src/library/library_compiler.rswhenfbuild_core::termination::host_terminationrecognises the exit code (-9, or the shell form137zccache forwards); the join incompile_library_link_inputs_gatedkeeps the firstFbuildErrorinstead of aString, andcrates/fbuild-build-esp/src/esp32/orchestrator/framework_libs.rsskips both failure markers for a kill (WARN: "was killed before any diagnostic; not remembering the failure so the next build retries").Receipts:
fbuild-build-esp --lib esp32::orchestrator102 pass / 0 fail;fbuild-library --lib367 pass / 0 fail / 9 ignored;fbuild-core --lib448 pass / 0 fail / 2 ignored; clippy-D warningsclean on the three crates;cargo check --workspace --all-targets --exclude fbuild-pythonclean. Merge queue: 31 SUCCESS / 9 SKIPPED / 0 failing (40 checks) pre-enqueue, merged in ~11 min.Still open here: zccache's own failure caching and its 137-instead-of-the-child's-true-signal attribution (upstream, and #1866 for the embedded holder). This issue stays open for those.
zackees commentedon Nov 19, 2026
Third in-repo half of this issue: PR #2104 (
agent/kill-log-reason).#1628ask 1's second sentence is "Every child kill should log a reason and the PID." #1628 ask 3 (the observed kill,-9, nothing on stderr) landed in #2093, and ask 2's replay-verbatim landed in #2103. What was still silent is the kill fbuild itself performs:fbuild_core::subprocess::stop_timed_out_commandis on the funnel every external command takes (linkers,objcopy,esptool,arduino-cli, passthrough tools), and on timeout it force-killed the command's whole process tree while writing nothing anywhere — no PID, no argv, no reason. The only record was the caller stringcommand timed out after Ns.Three call sites killed through it or through an equivalent inline
terminate_tree+child.kill()(wait_and_capture,run_command_passthrough_inner,run_command_reporting_with_limit). Now one helper logsWARN force-killing a timed-out command tree (reason: timeout) pid=<pid> limit_ms=<n> argv=[...]before terminating, and the passthrough path reuses it (gaining the bounded reap the captured path already had).Receipts:
fbuild-core --lib subprocess33/33 with two log assertions (a silent kill fails the test),fbuild-core --lib449/0/2i, clippy-D warningsclean, fmt clean, boundary 44/43,cargo check --workspace --all-targets --exclude fbuild-pythonexit 0.This issue stays OPEN for the zccache half — the compile-child kill itself is upstream (
kill_on_drop/ stall watchdog, #1866), and the pin is stillzccache = "=1.15.8", so nothing to re-verify there yet.zackees commentedon Nov 19, 2026
Merged as #2104 (
ff28d9fb, 2026-11-19T19:59:37Z, ~19 min merge queue).On main:
stop_timed_out_command(crates/fbuild-core/src/subprocess.rs L637) logsWARN force-killing a timed-out command tree (reason: timeout) pid=<pid> limit_ms=<n> argv=[...]before terminating the process tree, the passthrough path reuses that helper (drops its own inline
terminate_tree+child.kill()and gains the bounded reap budget), andrun_command_reporting_with_limitpassesargs+timeoutthrough (subprocess_report.rs L130).Two
#[traced_test]assertions fail the build if a timed-out kill is ever silent again.#1630 stays OPEN for the zccache half only — the compile-child killer is zccache's session
kill_on_drop/ stall watchdog (#1866), and the pin is stillzccache = "=1.15.8", so there is nothingto re-verify on the fbuild side until a zccache release lands.
zackees commentedon Nov 19, 2026
Re-verified the remaining cell; nothing actionable in-repo left, so I am recording this as upstream-blocked (a comment does not unblock it; only an edit to this issue's title/labels/body does, which is the intent).
What the three landed PRs cover (all on
main):48f10475(fix(library): name the signal that killed a compiler (#1628 ask 3, #1630) #2093):fbuild_core::terminationnames-9/ shell137, killed TU prints(exit code -9 = SIGKILL (signal 9)), same sentence at WARN indaemon.log.441326ba(fix(esp32): retry a framework library whose compiler was killed by a signal #2103):FbuildError::ProcessTerminated+is_signal_kill();FwLibsPlan::finishwrites neither the build-dir.lib.failednor the globalframework-library-artifacts/<key>/failed/<lib>entry for a kill, so a SIGKILL no longer deletes a framework library for every later build.ff28d9fb(fix(subprocess): name the pid, reason and argv of every timed-out child kill #2104):stop_timed_out_command(the funnel every external command takes) logsforce-killing a timed-out command tree (reason: timeout) pid=<pid> limit_ms=<n> argv=[...]before terminating; passthrough path reuses the helper;#[traced_test]assertions fail on a silent kill.Remaining halves and why they are not mine:
kill_on_drop/ stall watchdog) is upstream, tracked as fix(daemon): embedded zccache holder watchdog aborts active builds at flush and spawn guards #1866 — fbuild cannot log a PID for a kill it does not issue.137rather than the child's true signal — upstream; the fbuild side already degrades correctly (137 is classified as SIGKILL).Re-verify trigger, checked this run:
Cargo.tomlL221 is stillzccache = "=1.15.8"andCargo.lockL4953-4955 resolveszccache 1.15.8; crates.io's newest release is 1.15.14 (2026-11-03), i.e. unchanged since the #1866 receipt that showed 1.15.14 byte-identical to 1.15.13 andsync_watchdog.rsidentical to 1.15.8. So there is no pin to bump and nothing to re-measure; this reopens when a zccache release changes the watchdog/attribution, or when #1866 closes.Also checked and deliberately not changed: the remaining
child.kill()sites onmainare (a) test helpers, (b)ContainedChild::killinplatform/process.rs(a thin wrapper with no non-test caller), and (c) the emulator handlers infbuild-daemon/src/handlers/emulator/{shared,avr8js_headless}.rs, where a kill is the normal completion ofhalt_on_success/halt_on_error/ timeout and the reason already travels to the caller as aMonitorOutcome; a WARN there would fire on every successful emulated run.#1630 stays open.