Repository navigation
obs-exit-watchdog: Name the library and the plugin that block exit - #4560
Merged
Merged
Conversation
The watchdog line names the library the armed thread waits in and the OBS module that brought it in (#4525, PR 2): the line text, the choice of the first frame outside OBS's own images, another thread's stack, and a blocked child whose line names the test binary as a module's library. arm, culprit, the line writer, the note_* calls and the Linux and macOS stack capture are todo!() stubs: 9 exit_watchdog cases of obs-tests-gpu fail with "not yet implemented" (the 7 image-table cases pass). Refs #4525 Co-Authored-By: Claude Opus 5.5 <[email protected]>
arm builds the module image table from what the frontend noted (the modules, the image list after loading and after post-load) and the list at arming, and notes the arming thread. When the watchdog fires, it captures that thread's stack, takes the first frame in an image OBS did not load itself, and names that library and who brought it in: exit-watchdog: exit did not finish in 10 s: a static destructor or atexit handler is blocking in libremidi.so.4 (loaded by advanced-scene-switcher.so); ending the process The capture and the line use fixed buffers. Linux: a real-time signal runs backtrace(3) on the thread (the unwinder is loaded at arming). macOS: the thread is suspended and its frame pointer chain walked inside its stack. Other hosts name no library. The C ABI gets note_module, note_loaded and note_post_load. All 16 exit_watchdog cases of obs-tests-gpu pass on macOS and Linux. Refs #4525 Co-Authored-By: Claude Opus 5.5 <[email protected]>
libobs names a macOS plugin by its bundle (exit-blocker.plugin), the image list by the binary inside it (.../exit-blocker.plugin/Contents/ MacOS/exit-blocker), so a match by file name alone finds no module on macOS. The new case fails: every image is OBS's own. Refs #4525 Co-Authored-By: Claude Opus 5.5 <[email protected]>
A module also matches an image when its name is a directory of the image's path, so exit-blocker.plugin owns .../exit-blocker.plugin/ Contents/MacOS/exit-blocker and the libraries after it. All 17 exit_watchdog cases pass. Refs #4525 Co-Authored-By: Claude Opus 5.5 <[email protected]>
After the modules load, the plugin manager notes each module's binary path and the image list (obs_exit_watchdog_note_module, _note_loaded), and again after their post-load (_note_post_load), so the watchdog line names the library that blocks exit and the module that brought it in. macOS app with the exit-blocker test plugin (a static destructor joins a thread that never ends), quit with SIGTERM: rc 124 after 11 s and, in the log and on stderr: exit-watchdog: exit did not finish in 10 s: a static destructor or atexit handler is blocking in exit-blocker (an OBS module); ending the process Without the plugin: rc 0 after 1 s, no line. Features ledger line added. Refs #4525 Co-Authored-By: Claude Opus 5.5 <[email protected]> Ci-Attestation: {"at":1794319376,"gate":"rust/aarch64-apple-darwin/clippy","host":"darwin-arm64","key":"","lane":"cross","parents":["79aa5cf9525df04d7fdaa021f333064a49a4ed0c"],"secs":99,"stamp":"57b9f1145acfde65ed8b03e6013ced46","tree":"3ec7e42c994234432e0486bcad94887fe7cc225c","v":1,"via":"run"} Ci-Attestation: {"at":1794319376,"gate":"rust/all/fmt","host":"darwin-arm64","key":"","lane":"lint","parents":["79aa5cf9525df04d7fdaa021f333064a49a4ed0c"],"secs":99,"stamp":"5f484013f1f1af72c7f084e4e4596399","tree":"3ec7e42c994234432e0486bcad94887fe7cc225c","v":1,"via":"run"}
|
Claim conflict: keep this PR out of the merge queue until resolved.
|
vpacher
marked this pull request as ready for review
November 10, 2026 14:45
This was referenced Nov 10, 2026
chriscoveries
pushed a commit
to chriscoveries/obsrust-fork
that referenced
this pull request
Nov 10, 2026
…t#4584) The quit-hang concept stopped at "Number of memory leaks". Since obs-rust#4309 the exit watchdog adds a last line, and since obs-rust#4560 that line names the library and the plugin that loaded it. Add it as line 7, say how to read the name and where it can mislead, and that gdb must attach within the watchdog's 10 s. Refs obs-rust#4525 Ci-Attestation: {"at":1794333181,"gate":"rust/all/fmt","host":"darwin-arm64","key":"","lane":"lint","parents":["edd24c57e13fc326fd79620d269ee3530dd548fe"],"secs":90,"stamp":"430982cd8ee5f2d77a15469a0b233205","tree":"ccfd658271982e6b830e48f1a9ecbbc301a7088a","v":1,"via":"run"} Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4525 (PR 2 of 2; PR 1 was #4549, the module image table).
What: when the exit watchdog fires, its line now names the library the main thread waits in and the module that brought it in:
obs_exit_watchdog_note_module,_note_loaded,_note_post_load).arm: builds the table (obs-exit-watchdog: Record which module brought in which libraries #4549) from these notes and the list at arming, and notes the arming thread, which is the main thread that then runsexit().backtrace(3)on the thread. The unwinder is loaded at arming, and the handler is installed only when the watchdog fires.x.plugin), and the image list has the binary inside it, so a module also matches a directory of the image path (separate RED/GREEN pair).RED 2bbcf23: 5 new cases in
obs-tests-gpu; 9exit_watchdogcases fail with "not yet implemented". GREEN 0628849. RED eef6980 (bundle case) / GREEN 79aa5cf. Frontend b96bcd8. All 17exit_watchdogcases pass on macOS (arm64) and Linux (x86_64), including a child whose blocked thread gets named through the real capture path on each OS.App check (macOS, RelWithDebInfo build with the exit-blocker test plugin: a static destructor joins a thread that never ends, the #3739 pattern), quit with SIGTERM: rc 124 after 11 s, and in the log and on stderr:
... atexit handler is blocking in exit-blocker (an OBS module); ending the process.Without the plugin: rc 0 after 1 s, no line. Not checked in a Linux app build; on Linux the child test covers the signal path.
Tiers: Tier 1. The C changes are frontend-only (the plugin manager and a frontend header), with no libobs or public header change, so Tiers 2 to 4 don't apply.
Test cost: new tests: longest 0.27 s (a child with a 200 ms watchdog), peak RSS 10.5 MB over 25 runs (Linux). One own thread, blocked until the test binary ends, and one child process.
Features ledger: a line under the exit watchdog entry.
🤖 Generated with Claude Code