Skip to content

Fix double-panic in panic hook stderr#225

Merged
TheJokr merged 1 commit into
mainfrom
opencode/issue224-20260626152953
Jun 26, 2026
Merged

Fix double-panic in panic hook stderr#225
TheJokr merged 1 commit into
mainfrom
opencode/issue224-20260626152953

Conversation

@ask-bonk

@ask-bonk ask-bonk Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Build succeeds. The change in foundations/src/panic/hook.rs:

  • Added use std::io::Write; for the writeln! macro.
  • Replaced eprintln!("{}", json_output) with acquiring the locked stderr handle and using let _ = writeln!(...) to discard any write error.

This prevents a double-panic: previously, if stderr was closed, eprintln! would panic inside the panic hook. Now the write error is silently ignored as suggested in the issue.

Closes #224

github run

Co-authored-by: fisherdarling <fisherdarling@users.noreply.github.com>
@TheJokr TheJokr merged commit 837d474 into main Jun 26, 2026
22 checks passed
@TheJokr TheJokr deleted the opencode/issue224-20260626152953 branch June 26, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potential double-panic in foundation's panic hook

2 participants