Skip to content

frontend: Create the crash sentinel directory on a first launch - #424

Merged
zackees merged 3 commits into
masterfrom
fix/154-crash-sentinel-dir
Oct 13, 2026
Merged

zackees merged 3 commits into
masterfrom
fix/154-crash-sentinel-dir

Conversation

@zackees

@zackees zackees commented Oct 13, 2026

Copy link
Copy Markdown
Member

Closes #154.

OBSApp constructs CrashHandler before AppInit() calls MakeUserDirs(). On a first launch, checkCrashState()'s single-level create_directory(<config>/obs-studio/.sentinel) failed because obs-studio/ didn't exist yet. The first session ran with no sentinel, so a crash or hang in it wasn't detected on the next launch.

  1. Extract (behavior-neutral): the directory step moves to frontend/utility/crash-sentinel-dir.{hpp,cpp} (ensure_crash_sentinel_dir), with no Qt. checkCrashState calls it.
  2. RED: test_crash_sentinel_dir (cmocka, tests.d/) fails with the issue's exact error (cannot create directory: No such file or directory) when the parent is missing. The existing-directory case passes.
  3. GREEN: create_directories.

The other single-level create_directory calls in the frontend (profile directories under an existing parent) are intentional and untouched.

Tier 2: 138/138 pass with OFF and ON. The local gate passed and is stamped. The frontend build itself is checked by this PR's full OBS builds.

Behavior-neutral: checkCrashState calls ensure_crash_sentinel_dir, which
has no Qt dependency so it can be unit tested.

Refs #154
CrashHandler checks the sentinel before MakeUserDirs runs, so on a first
launch the obs-studio config directory didn't exist, create_directory
failed, and the first session ran without a crash sentinel.

Closes #154

Local-Gate: v1 tree=e8ddac0f8337aee1dc9c579188f75e1f7871b2e3 secs=147 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791854791,"gate":"rust/all/fmt","host":"linux-x86_64","key":"6fa2b737279d4f51cb5eec3fa097ef3929c3c516f61811136323e4820750010a","lane":"lint","parents":["3e6d3791238644727e16883a4702bc904f23a3c7"],"secs":20,"stamp":"43ff6a93094f87fcd381fa6f524a4a00","tree":"e8ddac0f8337aee1dc9c579188f75e1f7871b2e3","v":1,"via":"run"}
Ci-Attestation: {"at":1791854791,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"6fa2b737279d4f51cb5eec3fa097ef3929c3c516f61811136323e4820750010a","lane":"lint","parents":["3e6d3791238644727e16883a4702bc904f23a3c7"],"secs":20,"stamp":"eadc66cf3c895493d893a3903ff89c4f","tree":"e8ddac0f8337aee1dc9c579188f75e1f7871b2e3","v":1,"via":"run"}
Ci-Attestation: {"at":1791854791,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"e0e3c0f8d718255fabcb7a3ed3267f6991995c972ca6421f311d0b6d86feaa0b","lane":"rust-test","parents":["3e6d3791238644727e16883a4702bc904f23a3c7"],"secs":53,"stamp":"d8dda1d70930c740648948ff3cb1e6da","tree":"e8ddac0f8337aee1dc9c579188f75e1f7871b2e3","v":1,"via":"run"}
Ci-Attestation: {"at":1791854791,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"63f28129dbcc544a7e02dc90ab97786b9afd1af378b598cb1bd8d466ad4dd036","lane":"tier2-linux","parents":["3e6d3791238644727e16883a4702bc904f23a3c7"],"secs":74,"stamp":"00fd23f50f85442ba6c974c7c3a3ddf9","tree":"e8ddac0f8337aee1dc9c579188f75e1f7871b2e3","v":1,"via":"run"}
@zackees
zackees merged commit 46b2aa4 into master Oct 13, 2026
23 checks passed
@zackees
zackees deleted the fix/154-crash-sentinel-dir branch October 26, 2026 15:43
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.

Frontend: crash sentinel never created on first launch (CrashHandler runs before MakeUserDirs)

1 participant