Skip to content

feat(frontend): start the exit watchdog's helper process on Windows (#4589) - #4859

Merged
vpacher merged 2 commits into
masterfrom
feat/4589-start-helper
Nov 14, 2026
Merged

vpacher merged 2 commits into
masterfrom
feat/4589-start-helper

Conversation

@vpacher

@vpacher vpacher commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Refs #4589 (PR 2 of 3: OBS starts the helper, and the Windows package ships it). #4858 (the helper) is in master.

Problem

#4858 added the watchdog process (obs-exit-watchdog.exe), but nothing in OBS starts it and no package ships it. So on Windows a plugin DLL that blocks its detach inside ExitProcess still leaves OBS hanging after its window has closed.

Change

  • frontend/obs-main.cpp.hpp: create_log_file() calls the new obs_exit_watchdog_start(path) right after the log file opens, long before quit, so a first-start antivirus scan of the helper is over by then. When the helper starts, OBS logs Exit watchdog: helper process started. obs_exit_watchdog_arm() at quit then arms the helper instead of the thread (feat(exit-watchdog): a watchdog process ends a hang in ExitProcess on Windows (#4589) #4858). On Linux and macOS, start returns false and nothing changes.
  • frontend/utility/obs-exit-watchdog.h, rust/obs-exit-watchdog/src/ffi/mod.rs: obs_exit_watchdog_start(const char *log_path).
  • frontend/cmake/feature-exit-watchdog.cmake: on Windows, with the frontend's Rust:
    • It imports the obs-exit-watchdog binary with Corrosion. Its Corrosion targets keep the hyphens (cargo-build_obs-exit-watchdog), so the one-cargo-build-at-a-time chain of obs_serialize_cargo_build() is spelled out instead of called.
    • It copies the binary next to obs64.exe in the rundir and installs it to bin/64bit.
    • The release signing (ci/windows_sign.py) signs every .exe in the ZIPs, so this one is signed too.
  • docs/features.md: one entry.

Tests

RED 6339f11ab: test/packaged-startup.py, which the Windows release lane runs on the built package, now requires three things:

  • obs-exit-watchdog.exe next to obs64.exe, built for the package's CPU (require_windows_watchdog_helper);
  • the log line Exit watchdog: helper process started (require_watchdog_started);
  • that the packaged helper ends a blocked process (require_watchdog_ends_a_blocked_process). It is armed, as OBS arms it at quit, on a process that never exits by itself, through an explicit handle list. It must end that process with exit code 124 and append its line to the log.

A package built before this PR has no helper, so it fails the first check. ci/test_packaged_startup.py covers the three checks (50 tests pass).

GREEN adec46bdc: the start call and the CMake.

What ran:

What did not run:

  • A Windows app build with this CMake, and a quit of the real obs64.exe with a blocking plugin. PR CI builds no OBS app, and this machine has no Windows app build tree. The release workflow's verify_only run on this branch builds the Windows package and runs test/packaged-startup.py on it. That run is the check of the CMake, the log line and the packaged helper, and its result goes on this PR before it leaves draft.
  • So Refs, not Fixes. exit-watchdog: End a plugin's blocked DLL detach on Windows #4589 stays open for PR 3 (naming the DLL) in any case.

🤖 Generated with Claude Code

vpacher and others added 2 commits November 14, 2026 12:37
…age (#4589)

test/packaged-startup.py (Windows release lane) now requires
obs-exit-watchdog.exe next to obs64.exe for the package's CPU, the log
line "Exit watchdog: helper process started", and that the packaged
helper, armed on a process that never exits by itself, ends it with exit
code 124 and appends its line to the log.

RED: no package has the helper yet, so the first check fails
("packaged exit watchdog helper is missing"); ci/test_packaged_startup.py
covers the checks.

Refs #4589

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…4589)

create_log_file() starts the helper right after the log file opens, long
before quit, so a first-start antivirus scan of it is over by then, and
logs "Exit watchdog: helper process started". obs_exit_watchdog_arm()
then arms the helper instead of the thread. On other hosts
obs_exit_watchdog_start() returns false and nothing changes.

frontend/cmake/feature-exit-watchdog.cmake builds the obs-exit-watchdog
binary on Windows (Corrosion; its targets keep the hyphens, so the cargo
build serialization is spelled out), copies it next to obs64.exe in the
rundir and installs it to bin/64bit. The release signing signs every .exe
in the package.

docs/features.md: one entry.

Refs #4589

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vpacher

vpacher commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Package check: a verify_only release run on this branch (run 43591511399) built the packages from adec46bdc without publishing them.

  • Windows x64 and arm64: the builds passed, and so did the MSI install and uninstall. Launch packaged Windows passed on both. test/packaged-startup.py ran on each package in both config modes, and each run logged:

    • packaged exit watchdog: helper ended a blocked process
    • packaged startup: capture plugins registered, saved profile loaded, clean shutdown

    So obs-exit-watchdog.exe is in bin/64bit next to obs64.exe for the right CPU, OBS logged Exit watchdog: helper process started, and the packaged helper ended a blocked process with exit code 124 and its log line.

  • The DLL scan flags the helper: in the same job, a scan reports bin/64bit/obs-exit-watchdog.exe imports vcruntime140.dll, which the zip does not contain in a loader search directory. It reports the same line for the Qt, FFmpeg and other DLLs in the package, and the job passes. The helper links the C runtime the same way they do.

  • macOS: the builds failed at notarization (HTTP status code: 403. A required agreement is missing or has expired), on the Apple account side, not in this change. The scheduled release runs on master have failed for the last three days as well.

Not yet run: a quit of the real obs64.exe that a plugin blocks. That part is the helper itself, which #4858's Tier 1 test and the packaged check above cover. So this PR keeps Refs #4589.

@vpacher
vpacher marked this pull request as ready for review November 14, 2026 12:35
@vpacher
vpacher requested a review from zackees as a code owner November 14, 2026 12:35
@vpacher
vpacher added this pull request to the merge queue Nov 14, 2026
Merged via the queue into master with commit 5776795 Nov 14, 2026
90 of 95 checks passed
@vpacher
vpacher deleted the feat/4589-start-helper branch November 14, 2026 13:16

This branch was previously deployed

1 inactive deployment
bouf — adec46bd Deployed Nov 14, 2026 by vpacher via Build windows x64 🧱 #172
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant