fix(message): don't mislabel signal 23 as SIGURG on macOS/BSD daemon hosts - #3110
fix(message): don't mislabel signal 23 as SIGURG on macOS/BSD daemon hosts#3110phil-opp wants to merge 1 commit into
Conversation
`NodeError`'s `Display` mapped `NodeExitStatus::Signal` numbers to names from a hard-coded Linux/glibc table. `NodeExitStatus::Signal` is produced from `ExitStatus::signal()` under `#[cfg(unix)]`, which includes macOS and the BSDs, where signal numbers past the portable POSIX range diverge: signal 23 is `SIGURG` on Linux but `SIGIO` on macOS/BSD. So a node killed by signal 23 on a macOS/BSD daemon host was reported as `SIGURG` when it was actually `SIGIO`. Signals 1..=22 in the table share the same number on every Unix dora targets, so they stay unconditional. Name signal 23 per target OS (`SIGURG` on Linux/Android, `SIGIO` on macOS/BSD) and fall back to the raw number on any other platform rather than printing a wrong name. The existing test is renamed and made platform-aware so the macOS nightly CI job validates the `SIGIO` mapping. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PYiYgEo2WKBXfGooqP2WG5
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
🤖 Automated review by Claude — this is a fully automated review with no human in the loop. Treat it as advisory. Reviewed the diff — no issues found. The unconditional signal-name table only contains numbers whose name is identical on Linux and macOS/BSD (the divergent low numbers 7/10/12/16–21 are correctly left to the numeric fallback rather than mislabeled), and signal 23 is the only added divergent case, cfg-gated correctly to Generated by Claude Code |
Issue
NodeError'sDisplayimpl (libraries/message/src/common.rs) mapsNodeExitStatus::Signal(n)to a signal name from a hard-coded table:Those are the Linux/glibc numbers. But
NodeExitStatus::Signalis produced fromExitStatus::signal()under#[cfg(unix)](same file), which also covers macOS and the BSDs — and signal numbers past the portable POSIX range diverge there:SIGURGSIGIOSo a node killed by signal 23 on a macOS/BSD daemon host was reported as
SIGURGwhen it was actuallySIGIO. (Severity is low — it only affects the human-readable message, not control flow — but it is a genuine cross-platform mislabel, and the test was even named..._uses_linux_signal_names, baking in the assumption silently.)Fix
Signals
1..=22in the table share the same number on every Unix dora targets, so they stay unconditional. Name signal 23 per target OS and fall back to the raw number on any other platform rather than printing a wrong name:The existing test is renamed to
node_error_signal_display_uses_platform_signal_namesand made platform-aware, so the macOS nightly CI job actually exercises theSIGIOmapping.Validation
Verified against 1.97.1 (the CI-pinned toolchain).
origin/mainbefore opening. Please review carefully before merging.🤖 Generated with Claude Code
Generated by Claude Code