obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

Crashes when switching profiles

Open gechoto opened this issue 1 year ago • 11 comments

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

  1. Start with fresh OBS
  2. Create a second profile (OBS auto switches to the new profile - no crash yet)
  3. 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

gechoto avatar Oct 18 '24 09:10 gechoto

Is your filesystem set to be case-sensitive? Also what are the contents of your profile directory (${HOME}/.config/obs-studio/basic/profiles)?

PatTheMav avatar Oct 18 '24 12:10 PatTheMav

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.

PatTheMav avatar Oct 18 '24 13:10 PatTheMav

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.

PatTheMav avatar Oct 18 '24 13:10 PatTheMav

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.

PatTheMav avatar Oct 18 '24 14:10 PatTheMav

Looks like Qt (and the KDE Platform plugin) does some things that breaks the expectation between setText() and text().

tytan652 avatar Oct 18 '24 14:10 tytan652

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.

PatTheMav avatar Oct 18 '24 14:10 PatTheMav