obsproject / obsproject/obs-studio
OBS crashes when config directory creation fails
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
- Launch OBS on a write-only file system
- Observe two error messages being shown
- 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
MakeUserDirsfails inOBSApp::AppInit, an exception is thrown, which is caught by therun_programfunction. - When
run_programgoes out of scope, it'sOBSAppinstance namedprogramis 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_booldoes not check if the first argument passed into it is anullptr, but ifMakeUserDirsfails,InitGlobalConfigis never run, but that function is responsible for initialisingappConfiganduserConfig- Thus
appConfigis anullptrat this point, crashing the application inconfig_get_bool
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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