Skip to content

fix(crash): keep crash reports intact and survive closed pipes and failed thread starts - #164

Merged
CoderDayton merged 2 commits into
mainfrom
fix/review-crash-freeze
Dec 3, 2026
Merged

CoderDayton merged 2 commits into
mainfrom
fix/review-crash-freeze

Conversation

@CoderDayton

Copy link
Copy Markdown
Owner

Review fixes #6, #7 and the thread half of #8.

  • A second thread crashing during a report waits for the first one instead of cutting it off.
  • Guest threads get their own signal stack, so a stack overflow on one of them is still reported.
  • SIGPIPE gets a no-op handler instead of the default kill. Writes to a closed pipe now fail with EPIPE; exec'd programs still get the default action. Before this, closing the window with stdout piped to something that had exited killed Nightcap during the shutdown diagnostics (exit 141). With the fix it exits 0, checked in game.
  • Helper threads (memory sampler, notifications, Robux purchase, account-switch restart) start through StartDetachedThread, so a failed start is logged instead of aborting.

A second crashing thread waits up to 2 s for the first report, guest threads get their own signal stack, and SIGPIPE gets a no-op handler so a closed pipe fails the write instead of killing Nightcap. Exec'd programs still get the default SIGPIPE.
std::thread aborts when it can't start a thread, since we build without exceptions. The memory sampler, notifications, the Robux browser handoff and the account-switch restart use a pthread-based StartDetachedThread now and fall back when it fails.
@CoderDayton
CoderDayton merged commit cf67260 into main Dec 3, 2026
6 checks passed
@CoderDayton
CoderDayton deleted the fix/review-crash-freeze branch December 3, 2026 05:01
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.

1 participant