fix(core): treat pid 0 as dead in unix pid_is_alive - restores Check Ubuntu/macOS - #1230
Conversation
kill(0, 0) probes the caller's own process group and succeeds, so the unix liveness check reported pid 0 as alive. That failed the two #1227 install-lock staleness tests on macOS/Linux (Check macOS red on PR #1229; Ubuntu masked behind the clippy error), and in production a corrupt owner record holding pid=0 would never be reclaimed — the exact #1213 deadlock class. Guard pid 0 explicitly and add a cross-platform regression test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 31 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
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. Comment |
Completes the main-restoration started in #1229 (follow-up to #1213 / #1227).
Summary
Check Ubuntu and Check macOS are still red on main after #1229: the two #1227 install-lock staleness tests fail there because the Unix
pid_is_aliveusedkill(pid, 0) == 0, andkill(0, 0)probes the caller's own process group — so PID 0 always read as "alive" on Linux/macOS (Windows is unaffected, which is why it slipped through local dev and #1229's Windows leg passed).Beyond the tests, this is a real production hole: a corrupt
owner.txtrecordingpid=0would read as a live owner on Unix and its install lock would never be reclaimed — the exact #1213 deadlock class the tests exist to prevent.Fix: explicit pid-0 guard in the Unix
pid_is_alive+ a cross-platform regression test (pid_zero_is_never_alive).This commit was originally pushed to the #1229 branch, but that PR had already been merged, so the push never attached — this PR carries the identical cherry-picked commit.
Validation
install_lock::tests::lock_owned_by_a_dead_pid_is_stale_immediatelyandlegacy_owner_record_without_exe_stem_still_uses_livenessfail on Check Ubuntu (job 91426903435) and Check macOS (job 91426904142); both pass on Windows.soldr cargo test -p fbuild-core process_identity— 7 passed incl. the new test;soldr cargo test -p fbuild-packages-fetch install_lock— 12 passed.🤖 Generated with Claude Code