You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Restore the stale-server report and orphan policy lost from staging - #1852
Problem:#1830 and #1829 were merged into their parent branches after those parents (#1820, #1821) had already been squash-merged, so neither change reached staging.
Change: Applies both squash commits onto staging unchanged:
#1829 is safe before streamlabs/crash-handler#139 ships: the current crash-handler ignores OUTPUT_STATE, and obs64 still listens on the legacy exit pipe.
…ed (#1830)
* Report a previous server that can't be stopped because it runs elevated
A non-elevated Desktop cannot open, and so cannot kill, an elevated leftover obs64. That process holds CEF's cache lock, so browser sources are disabled for the session with no explanation. Record its PID and expose it via IPC.getUnkillableStaleServer() so the app can tell the user.
* Let an orphaned obs64 decide whether to wait for the user
obs64 waited indefinitely on crash-handler's ack over one global exit pipe, even with nothing live, and a leftover obs64 holding that pipe broke the next session. It now reports live outputs to crash-handler, uses a per-session exit pipe, and stops waiting when idle or when crash-handler dies.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Critical defects can omit live legacy outputs from activity tracking, dereference freed output wrappers after reinitialization, and block shutdown indefinitely on synchronous pipe writes.
Restores stale-server reporting and orphan shutdown handling that missed staging, extending the existing protections against leftover obs64 processes holding browser-cache locks.
Changes:
Adds IPC.getUnkillableStaleServer() and TypeScript declarations so Desktop can report a previous server it cannot terminate.
Adds Windows orphan shutdown decisions based on output activity, exit acknowledgement, and crash-handler liveness, with session-specific and legacy exit pipes.
Adds orphan-policy unit tests and build registration.
File
Description
obs-studio-server/tests/test-orphan-policy.cpp
Tests idle, acknowledgement, and crash-handler grace-period decisions.
obs-studio-server/source/osn-output.hpp
Declares atomic output-activity tracking.
obs-studio-server/source/osn-output.cpp
Updates activity tracking from output lifecycle signals.
obs-studio-server/source/orphan-policy.hpp
Defines the orphan shutdown decision policy.
obs-studio-server/source/nodeobs_api.h
Declares output-state polling and publication methods.
obs-studio-server/source/nodeobs_api.cpp
Implements output reporting, handler tracking, exit pipes, and orphan waits.
obs-studio-server/source/main.cpp
Publishes output state from the Windows main loop.
obs-studio-server/CMakeLists.txt
Registers the orphan-policy header and tests.
obs-studio-client/source/controller.hpp
Declares stale-server PID storage and access.
obs-studio-client/source/controller.cpp
Detects unkillable server processes and exposes the IPC getter.
js/module.ts
Documents and declares the new IPC method.
js/module.d.ts
Adds the method to generated TypeScript declarations.
Terminate handlers are per-thread on MSVC and the SIGABRT handler is one-shot, so after obs_startup a worker-thread abort/terminate ran HandleCrash once, then its final abort() hit SIG_DFL and fast-failed with no crash report. The stack was also logged only after the log was captured.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
destroyOBS_API deleted streaming/file-output wrappers but left their registry entries, so a re-init could poll freed pointers. AnyLiveOutput also ignored raw outputs started through the legacy OBS_service API, reporting no live output while one was running.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Active issues include a critical use-after-free risk in legacy output polling and missing legacy replay-buffer activity tracking that can cause shutdown without acknowledgement.
Track legacy replay-buffer activity in output state
obs-studio-server/source/nodeobs_api.cpp:1704
A legacy replay-buffer-only session still publishes OUTPUT_STATE=false, so losing Desktop shuts it down without waiting for acknowledgement. The independently owned replayBufferOutput is absent from both wrapper registries and these checks (nodeobs_service.cpp:2009,2101–2104). Include legacy replay-buffer activity using lifetime-safe tracking alongside the streaming and recording states.
releaseStreamingOutput frees and nulls those outputs on a worker thread with no lock shared with the main-loop poll, so reading them could touch a freed output. Desktop does not stream or record through OBS_service.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
If SIGABRT occurs while the logger holds logMutex (nodeobs_api.cpp:552–587), both branches re-enter blog() and can deadlock on the same nonrecursive mutex. This prevents the process from reaching Crashpad or _exit, leaving it hung without a crash report. Forward directly to osn_crashpad_bridge_abort() from this fallback, without allocating or acquiring application locks; collect richer diagnostics outside the SIGABRT handler.
Restrict stale-server checks to the validated prior server
obs-studio-client/source/controller.cpp:254
The image-path match does not establish that a process is the previous server: CEF subprocesses use the same executable (main.cpp:188–190), and the scan also includes servers from other sessions. If one of these processes denies the requested access, getUnkillableStaleServer() can report its PID even when the previous server is gone. Check a validated previous-server identity, or both server role and stale-session ownership, before recording the PID.
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
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.
Problem: #1830 and #1829 were merged into their parent branches after those parents (#1820, #1821) had already been squash-merged, so neither change reached
staging.Change: Applies both squash commits onto
stagingunchanged:IPC.getUnkillableStaleServer()reports an elevated leftover obs64 that a non-elevated Desktop can't stop (needed by desktop#6370).OUTPUT_STATE.#1829 is safe before streamlabs/crash-handler#139 ships: the current crash-handler ignores
OUTPUT_STATE, and obs64 still listens on the legacy exit pipe.Tests
stagingwithout conflictstsc -p js: generated files in sync🤖 Generated with Claude Code