fuzz: use process::exit panic hook in stdin_fuzz to avoid macOS hang#4449
fuzz: use process::exit panic hook in stdin_fuzz to avoid macOS hang#4449TheBlueMatt merged 1 commit intolightningdevkit:mainfrom
Conversation
|
👋 Thanks for assigning @TheBlueMatt as a reviewer! |
|
Hmm it doesn't reproduce anymore now. Probably coming back to this PR later. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4449 +/- ##
==========================================
+ Coverage 85.93% 86.17% +0.24%
==========================================
Files 159 160 +1
Lines 104693 107441 +2748
Branches 104693 107441 +2748
==========================================
+ Hits 89972 92592 +2620
- Misses 12213 12233 +20
- Partials 2508 2616 +108
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Reopening this, because indeed the bug isn't fixed on main. Repro:
|
|
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
On macOS, panic=abort causes the process to call abort() which sends SIGABRT. The ReportCrash daemon then tries to generate a crash report, leaving the process stuck in an uninterruptible wait state that cannot be killed even with SIGKILL. This makes stdin_fuzz unusable for crash reproduction on macOS. Install a custom panic hook (gated behind #[cfg(target_os = "macos")]) that flushes stdout (preserving log output), prints the panic info with a full backtrace to stderr, then calls process::exit(1) to terminate cleanly before the abort machinery runs. The hook is only installed on macOS to avoid interfering with debuggers like GDB on Linux. AI tools were used in preparing this commit.
e674332 to
39c8b0c
Compare
|
|
Unfortunately the final approach chosen in #4430 did not prevent the hang-on-panic. Must have made a mistake in the final validation of stdin_fuzz.