obsproject/obs-studio

OBS crashes when config directory creation fails

Opened this issue · 2 comments

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

I can't start streaming your updates, I'm tired of waiting weeks for the plugins to be adjusted to the new version of OBS.

I can't start streaming your updates, I'm tired of waiting weeks for the plugins to be adjusted to the new version of OBS.

This is not an appropriate place to report issues with plugins. If you are having issues, use our support channels, or report the issues to the plugin developers directly. There isn't much we can do about plugins that don't stay updated, and you are more than welcome to not update immediately and monitor plugins you use for updates before doing so.