Crashes when switching profiles
Operating System Info
Other
Other OS
Arch Linux
OBS Studio Version
Git
OBS Studio Version (Other)
https://github.com/obsproject/obs-studio/commit/05d2ee1b6f91521f468bcb7caeae8c512849845c
OBS Studio Log URL
https://pastebin.com/raw/zabKXHhK
OBS Studio Crash Log URL
No response
Expected Behavior
OBS should not crash
Current Behavior
OBS crashes
Steps to Reproduce
- Start with fresh OBS
- Create a second profile (OBS auto switches to the new profile - no crash yet)
- Switch back to the first profile (or any other profile if you have them)
Anything else we should know?
When launching OBS from the console it prints this after the crash:
terminate called after throwing an instance of 'std::invalid_argument'
what(): Selected profile not found: test
The crash happens here: https://github.com/obsproject/obs-studio/blob/05d2ee1b6f91521f468bcb7caeae8c512849845c/UI/window-basic-main-profiles.cpp#L249
Is your filesystem set to be case-sensitive? Also what are the contents of your profile directory (${HOME}/.config/obs-studio/basic/profiles)?
The directory names look correct, but is there a basic.ini inside the test directory?
I've tried to reproduce the issue on Windows, Ubuntu, and macOS but have met no issues.
That exception makes it seem as if it tried to switch to the "Untitled" profile and not the "test" profile. As I'm not able to reproduce this, you'd have to launch OBS with gdb attached yourself and inspect the contents of the profile cache when the exception was thrown.
I think the ampersand is used as an accelerator marker for the "U" in undefined. It's unexpected for me that calling text() on the menu action will actually include the accelerator.
Looks like Qt (and the KDE Platform plugin) does some things that breaks the expectation between setText() and text().
Indeed this looks like the return of an old KDE bug for Qt6: https://bugs.kde.org/show_bug.cgi?id=337491
We'll add some hardening to our code to not rely on the text of a QAction anymore as it obviously cannot be trusted.