Skip to content

Route obs64 abort() to Crashpad's handler in the bridge CRT - #1835

Merged
summeroff merged 2 commits into
stagingfrom
fix/crashpad-abort-reporting
Nov 4, 2026
Merged

summeroff merged 2 commits into
stagingfrom
fix/crashpad-abort-reporting

Conversation

@summeroff

Copy link
Copy Markdown
Contributor

Problem: Since #1781, obs64 uses the static CRT while Crashpad lives in the /MD bridge DLL. Crashpad's SIGABRT handler is registered in the DLL's CRT, so abort() in obs64 never reaches it. Every HandleCrash path ending in abort() (libobs fatal errors, std::terminate, stopAllOutputs timeout) sends no report. Affects 0.27.22 (Desktop 1.22) onward.

Change: The bridge exports osn_crashpad_bridge_abort(), which calls abort() in its own CRT. obs64 installs a SIGABRT handler (with recursion guard) that forwards to it. CRT linkage is unchanged.

Effect: These crashes reach Sentry again.

Related: #1833.

Tests

  • RelWithDebInfo build clean; node ci/run-unit-tests.js 62/62; clang-format 18.1.3 clean
  • dumpbin: bridge exports the symbol; obs64 imports no CRT DLLs
  • Forced crash (temporary hook, removed): terminate path without fix gives no dump; with fix gives .dmp + upload; SEH null-write still one dump, no duplicate

Not verified: bcrash/D3D11 path, HandleCrash annotations in the dump, combination with #1833.

🤖 Generated with Claude Code

Since the static-CRT switch, Crashpad lives in the /MD bridge DLL and its SIGABRT handler is registered in that CRT. abort() in obs64 uses its own CRT, which has no handler, so every HandleCrash path ending in abort() (libobs fatal errors, std::terminate, shutdown timeout) produced no report. Forward SIGABRT to an exported bridge function that calls abort() in the bridge CRT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The SIGABRT path does not check bridge_active, so an abort after DisableReports() can still generate and upload a crash report despite reporting being disabled.

1 open issue
What changed in this PR

Restores abort-based crash reporting for obs64 after the static-CRT split introduced in #1781 by forwarding aborts to the Crashpad bridge’s CRT.

Changes:

  • Adds a non-returning bridge export that calls abort().
  • Installs a Windows SIGABRT forwarding handler in obs64 with a recursion guard and exit fallback.
  • Preserves existing CRT linkage.
File Description
obs-studio-server/​source/​util-crashmanager.cpp Installs the guarded SIGABRT forwarding handler.
obs-studio-server/​source/​crashpad-bridge.h Declares the non-returning abort bridge API.
obs-studio-server/​source/​crashpad-bridge.cpp Implements abort forwarding within the bridge’s CRT.

Review effort: Balanced

DisableReports leaves the handler registered, so an abort after shutdown could still produce and upload a report. Terminate directly when the bridge is inactive, using the same gate as the exception filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@summeroff
summeroff merged commit f4a17b9 into staging Nov 4, 2026
18 of 20 checks passed
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.

3 participants