Repository navigation
fix(library): name the signal that killed a compiler (#1628 ask 3, #1630) - #2093
Merged
Merged
Conversation
) A compiler killed by a signal does not exit: wait reports -signal on Unix, so the failure said only '(exit code -9)' beside '(the compiler wrote nothing to stderr)' — indistinguishable from a compiler crash, although the daemon's containment, the OOM killer and a dying owner process all kill exactly this way. New fbuild_core::termination classifies -signal and the 128+signal shell convention (what a tool that shells out forwards), names the signal when the number is identical on Linux and macOS, and keeps Windows at None because it reports -1 for every abnormal exit and keeps no signal number. The library compile failure now reads '(exit code -9 = SIGKILL (signal 9))' plus the kill hint, and the daemon log gets the same sentence at WARN.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
library_compiler_tests.rs was at 976 LOC of the 1000-LOC limit; the two new message tests took it to 1011 and the LOC gate failed. They are a separate concern anyway, so they live in library_compiler_signal_tests.rs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A compiler killed by a signal does not exit — it is terminated.
waitreportsthat as
-signalon Unix, so the only thing a failed library TU carried was:That reads like a compiler crash or a source error. It is neither: the daemon's
containment path, the OOM killer and a dying owner process all kill exactly this
way, and the process had no chance to print anything. This is #1628
ask 3 ("log a signal-killed compiler (exit < 0) … together with the reason") and
the fbuild half of #1630. #1628's cause was fixed separately by
#1631; this makes the symptom self-describing when it happens again.
What
fbuild_core::termination(new module):termination(exit_code, is_unix_host)recognises both spellings that reachus:
-signal(whatToolOutput.exit_codecarries on Unix) and128 + signal,the shell convention a tool that shells out forwards for a killed child
(zccache reports 137 for SIGKILL). The range is 129..=192, so an ordinary exit
status is never reinterpreted.
label()→SIGKILL (signal 9). Only signals whose numbers are identical onLinux and macOS are named (1-6, 8, 9, 11, 13-15, 24, 25). SIGBUS, SIGUSR1,
SIGUSR2, SIGCONT and SIGSTKFLT disagree between the two, so those are
signal N (no portable name)rather than a wrong name.-1for every abnormal exit and keeps no signal number, soterminationanswersNonethere: naming one would be a fabrication.KILL_HINTsays what a kill means and where to look next: a host orcontainment event, not a source or compiler error; retry once, then check the
daemon log and
dmesg.library_compiler: the failure message becomesand
log_signal_kill()puts the same sentence in the daemon log at WARN, whichis the only place the signal can survive after the fact.
Verification
soldr cargo test -p fbuild-core --lib termination— 8 passed / 0 failed,including
a_really_sigkilled_child_classifies_as_a_kill: a realsh -c 'kill -9 $$'throughrun_commandarrives asexit_code == -9withempty stderr and classifies as
SIGKILL (signal 9).soldr cargo test -p fbuild-library --lib library_compiler— 27 passed /0 failed / 2 ignored, including the pre-existing
failure_message_always_carries_the_exit_statusand the two new message tests.soldr cargo clippy -p fbuild-core -p fbuild-library --all-targets --no-deps -- -D warningsexit 0 (the first attempt trippedcognitive_complexity 26/25and
too_many_lines 104/100oncompile_one_source; the log call moved intoits own function instead of raising a limit).
soldr cargo fmt --all -- --checkclean;ci/enforce_platform_boundary.py --print-totals→rows=44; dylint_rows=43.#1628 and #1630 stay open — this is ask 3 of the first and one half of the
second; nothing here changes what kills a compiler, only what the kill says.