obsproject / obsproject/obs-studio

OBS crashes when config directory creation fails

Open
#12,617 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
76.4k
Forks
10.2k
Avg merge
4d 23h
Merged PRs (30d)
12

Description

Operating System Info

macOS 15

Other OS

No response

OBS Studio Version

31.1.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

No OBS log available

OBS Studio Crash Log URL

No crash log available

Expected Behavior

When OBS fails to create the user configuration directory, it presents an appropriate error message and quits.

Current Behavior

When OBS fails to create the user configuration directory, it presents 2 error messages and then crashes.

Steps to Reproduce
  1. Launch OBS on a write-only file system
  2. Observe two error messages being shown
  3. Observe crash
Anything else we should know?

The main cause for the crash is the combination of code used in OBSApp::AppInit and OBSApp's destructor:

  • When MakeUserDirs fails in OBSApp::AppInit, an exception is thrown, which is caught by the run_program function.
  • When run_program goes out of scope, it's OBSApp instance named program is destroyed and the destructor run
  • The destructor calls applicationShutdown, which will then run the following line of code on macOS:
bool vsyncDisabled = config_get_bool(appConfig, "Video", "DisableOSXVSync");
  • config_get_bool does not check if the first argument passed into it is a nullptr, but if MakeUserDirs fails, InitGlobalConfig is never run, but that function is responsible for initialising appConfig and userConfig
  • Thus appConfig is a nullptr at this point, crashing the application in config_get_bool

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing OBSApp::AppInit, MakeUserDirs, and run_program to confirm the failure path, then inspect the OBSApp destructor and applicationShutdown on macOS. Reproduce with a write-only file system and verify that failure to create the configuration directory shows one appropriate error and exits without a crash; no specific test file is named.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, macos
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.