Skip to content

fix(library): name the signal that killed a compiler (#1628 ask 3, #1630) - #2093

Merged
zackees merged 2 commits into
mainfrom
agent/signal-kill-diag
Nov 19, 2026
Merged

zackees merged 2 commits into
mainfrom
agent/signal-kill-diag

Conversation

@zackees

@zackees zackees commented Nov 19, 2026

Copy link
Copy Markdown
Member

A compiler killed by a signal does not exit — it is terminated. wait reports
that as -signal on Unix, so the only thing a failed library TU carried was:

failed to compile …/fl/fx+.cpp in library FastLED (exit code -9):
(the compiler wrote nothing to stderr)

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 reach
    us: -signal (what ToolOutput.exit_code carries on Unix) and 128 + 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 on
    Linux 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.
  • Windows reports -1 for every abnormal exit and keeps no signal number, so
    termination answers None there: naming one would be a fabrication.
  • KILL_HINT says what a kill means and where to look next: a host or
    containment event, not a source or compiler error; retry once, then check the
    daemon log and dmesg.

library_compiler: the failure message becomes

failed to compile …/fl/fx+.cpp in library FastLED (exit code -9 = SIGKILL (signal 9)):
(the compiler wrote nothing to stderr)

the process was killed by a signal, not exited — a host or containment event
(OOM killer, the fbuild daemon's containment, or a dead parent process), not a
source or compiler error; retry once, then check the daemon log and `dmesg` for kills

and log_signal_kill() puts the same sentence in the daemon log at WARN, which
is 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 real
    sh -c 'kill -9 $$' through run_command arrives as exit_code == -9 with
    empty 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_status and the two new message tests.
  • soldr cargo clippy -p fbuild-core -p fbuild-library --all-targets --no-deps -- -D warnings exit 0 (the first attempt tripped cognitive_complexity 26/25
    and too_many_lines 104/100 on compile_one_source; the log call moved into
    its own function instead of raising a limit).
  • soldr cargo fmt --all -- --check clean; 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.

)

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.
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.
@zackees zackees mentioned this pull request Nov 19, 2026
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 19, 2026
@zackees
zackees added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 48f1047 Nov 19, 2026
31 checks passed
@zackees
zackees deleted the agent/signal-kill-diag branch November 24, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant