obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
59.79k stars 7.93k forks source link

Crash loading qt5 dockstate on qt6 with multiple monitors #7284

Closed LuciousLisa closed 1 year ago

LuciousLisa commented 2 years ago

Operating System Info

Ubuntu 22.04

OBS Studio Version

28.0.1

OBS Studio Log URL

https://pastebin.com/VBX0RBnd

OBS Studio Crash Log URL

No response

Expected Behavior

  1. open obs
  2. ???
  3. profit

Current Behavior

  1. open obs
  2. ???
  3. crash

Steps to Reproduce

  1. open obs

Anything else we should know?

I don't have the time to click on any menu items before it crashses and just had to find the physical copy of the log in my filesystem, hence the pastbin link.
Hope it helps, thanks for all your hard work!

PythooonUser commented 2 years ago

From what I can see in your log file, this could be an issue with the StreamLabs plugin you are using. Something in that JavaScript file fails with an unhandled exception.

obs-browser: Uncaught (in promise) Something went wrong. (source: https://streamlabs.com/mixed/assets/widgets/js/endcredits.js)

kkartaltepe commented 2 years ago

Please provide a backtrace from gdb

LuciousLisa commented 2 years ago

From what I can see in your log file, this could be an issue with the StreamLabs plugin you are using. Something in that JavaScript file fails with an unhandled exception.

Thank you for that, any suggestion how I could remove that layer from the scene while working around the crashing issue?

Please provide a backtrace from gdb

Excuse me, what? I'm going to need a little bit of help providing that, I have no idea what you mean.

LuciousLisa commented 2 years ago

Just to make sure that it wasn't some kind of corrupted source, I cleared all scenes and tried again. The problem unfortunately persists, here's the log of my latest attempt: pastebin
I have also uninstalled and reinstalled the software, which unfortunately also didn't help resolve the issue. I really hope you folks can help fix this even if it's only me, because I miss streaming!

JarnoKai commented 2 years ago

This affects me too. Log file is similar; last thing printed out is "Loaded scenes", then nothing. The window pops up black, hangs for a while and then disappears. When launching from console, it says "Muistialueen ylitys (luotiin core-tiedosto)" (roughly "Memory overflow, core dump was created" Log: https://pastebin.com/Sjc5CCGP

Worth mentioning that the problem appeared when upgrading to OBS 28. Before that I have used OBS for years with no issues. I removed any custom plugins and my custom scenes but it doesn't help. Also tried reinstalling with --purge, no help.

kkartaltepe commented 2 years ago

If you can replicate this please provide a backtrace from gdb. Please use our support channels if you cannot do this yourself, such as the Discord server or the forums.

JarnoKai commented 2 years ago

Is this helpful? I compiled OBS in debug and gdb backtrace gave me this:

info: Loaded scenes:
info: - scene 'Näkymä':
info: ------------------------------------------------
[New Thread 0x7fff2eebc640 (LWP 696874)]
[New Thread 0x7fff2e6bb640 (LWP 696875)]
[New Thread 0x7fff2deba640 (LWP 696876)]
[New Thread 0x7fff2d6b9640 (LWP 696877)]
[New Thread 0x7fff2ceb8640 (LWP 696878)]
[New Thread 0x7ffefbfff640 (LWP 696879)]
[New Thread 0x7ffefb7fe640 (LWP 696880)]
[New Thread 0x7ffefaffd640 (LWP 696881)]
[New Thread 0x7ffefa7fc640 (LWP 696882)]
[New Thread 0x7ffef9ffb640 (LWP 696883)]
[New Thread 0x7ffef97fa640 (LWP 696884)]
[New Thread 0x7ffef8ff9640 (LWP 696885)]
[New Thread 0x7ffedbfff640 (LWP 696886)]
[New Thread 0x7ffedb7fe640 (LWP 696887)]
[New Thread 0x7ffedaffd640 (LWP 696888)]
[New Thread 0x7ffeda7fc640 (LWP 696889)]
[New Thread 0x7ffed9ffb640 (LWP 696890)]
[New Thread 0x7ffed97fa640 (LWP 696891)]
[New Thread 0x7ffed8ff9640 (LWP 696892)]
[New Thread 0x7ffebbfff640 (LWP 696893)]
[New Thread 0x7ffebb7fe640 (LWP 696894)]
[New Thread 0x7ffebaffd640 (LWP 696895)]
[New Thread 0x7ffeba7fc640 (LWP 696896)]
[New Thread 0x7ffeb9ffb640 (LWP 696897)]
[New Thread 0x7ffeb97fa640 (LWP 696898)]
[New Thread 0x7ffeb8ff9640 (LWP 696899)]
[New Thread 0x7ffe9bfff640 (LWP 696900)]

Thread 1 "obs" received signal SIGSEGV, Segmentation fault.
0x00007ffff4f29cd4 in QScreen::geometry() const () from /lib/x86_64-linux-gnu/libQt6Gui.so.6
(gdb) backtrace
#0  0x00007ffff4f29cd4 in QScreen::geometry() const ()
    at /lib/x86_64-linux-gnu/libQt6Gui.so.6
#1  0x00007ffff5b2bbfa in  () at /lib/x86_64-linux-gnu/libQt6Widgets.so.6
#2  0x00007ffff5b35820 in  () at /lib/x86_64-linux-gnu/libQt6Widgets.so.6
#3  0x00007ffff5b359d8 in  () at /lib/x86_64-linux-gnu/libQt6Widgets.so.6
#4  0x00007ffff5b71db5 in  () at /lib/x86_64-linux-gnu/libQt6Widgets.so.6
#5  0x00007ffff5b7200c in  () at /lib/x86_64-linux-gnu/libQt6Widgets.so.6
#6  0x00007ffff5b645d9 in QMainWindow::restoreState(QByteArray const&, int) ()
    at /lib/x86_64-linux-gnu/libQt6Widgets.so.6
#7  0x000055555570ab6e in OBSBasic::OBSInit() (this=0x555555f6ac10)
    at /home/jarno/Ohjelmat/Lähdekoodi/obs/obs-studio/UI/window-basic-main.cpp:1978
#8  0x0000555555603260 in OBSApp::OBSInit() (this=0x7fffffffd4b0)
    at /home/jarno/Ohjelmat/Lähdekoodi/obs/obs-studio/UI/obs-app.cpp:1582
#9  0x00005555556064c2 in run_program(std::fstream&, int, char**)
    (logFile=..., argc=1, argv=0x7fffffffdc68)
    at /home/jarno/Ohjelmat/Lähdekoodi/obs/obs-studio/UI/obs-app.cpp:2345
#10 0x00005555556088af in main(int, char**) (argc=1, argv=0x7fffffffdc68)
    at /home/jarno/Ohjelmat/Lähdekoodi/obs/obs-studio/UI/obs-app.cpp:3060
kkartaltepe commented 2 years ago

Inside the file ~/.config/obs-studio/global.ini there is a line called DockState, can you post that value here? Then you can try deleting that line from that file and see if OBS starts successfully.

JarnoKai commented 2 years ago

DockState=AAAA/wAAAAD9AAAAAgAAAAEAAAAAAAAAAPwCAAAAAvsAAAAUAHQAdwBpAHQAYwBoAEMAaABhAHQCAAAMugAAAAQAAAFWAAAEM/sAAAAUAHQAdwBpAHQAYwBoAEYAZQBlAGQCAAAGkQAAArcAAAHkAAABfQAAAAMAAAOzAAAA7fwBAAAACPsAAAAUAHMAYwBlAG4AZQBzAEQAbwBjAGsBAAAAAAAAAKAAAACgAP////sAAAAWAHMAbwB1AHIAYwBlAHMARABvAGMAawEAAACmAAAAoAAAAKAA////+wAAABIAbQBpAHgAZQByAEQAbwBjAGsBAAABTAAAANwAAADcAP////sAAAAeAHQAcgBhAG4AcwBpAHQAaQBvAG4AcwBEAG8AYwBrAQAAAi4AAACaAAAAmgD////7AAAAGABjAG8AbgB0AHIAbwBsAHMARABvAGMAawEAAALOAAAA5QAAAOUA////+wAAABIAcwB0AGEAdABzAEQAbwBjAGsCAAAGkAAAA1AAAAOHAAAA6PsAAAAUAHQAdwBpAHQAYwBoAEkAbgBmAG8CAAAGkgAAAAIAAAHnAAACTPsAAAAWAHQAdwBpAHQAYwBoAFMAdABhAHQAcwIAAAuzAAADXQAAAPYAAADYAAADswAAAj8AAAAEAAAABAAAAAgAAAAI/AAAAAA=

OBS finally started successfully once the line was deleted.

kkartaltepe commented 2 years ago

Can you please also provide the output of running xrandr from a terminal ?

JarnoKai commented 2 years ago
$ xrandr
Screen 0: minimum 320 x 200, current 3840 x 2160, maximum 16384 x 16384
DisplayPort-0 connected 1920x1080+0+1055 (normal left inverted right x axis y axis) 531mm x 299mm
   1920x1080     60.00*+ 144.00   119.98    99.93    50.00    59.94  
   1680x1050     59.95  
   1280x1024     60.02  
   1440x900      59.89  
   1280x960      60.00  
   1280x800      59.81  
   1152x864      75.00  
   1280x720      60.00    50.00    59.94  
   1024x768      70.07    60.00  
   800x600       60.32    56.25  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       66.67    60.00    59.94  
   720x400       70.08  
DisplayPort-1 connected primary 1920x1080+1920+1080 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+
   1680x1050     59.88  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1440x900      60.00  
   1280x800      59.91  
   1152x864      75.00  
   1280x720      60.00  
   1024x768      75.03    60.00  
   832x624       74.55  
   800x600       75.00    60.32  
   640x480       75.00    59.94  
   720x400       70.08  
DisplayPort-2 disconnected (normal left inverted right x axis y axis)
HDMI-A-0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 478mm x 269mm
   1920x1080     60.00*+
   1680x1050     59.88  
   1280x1024     75.02  
   1440x900      74.98    59.90  
   1280x960      60.00  
   1280x800      59.91  
   1152x864      75.00  
   1280x720      60.00  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   640x480       75.00    72.81    66.67    59.94  
   720x400       70.08  
kkartaltepe commented 2 years ago

Thanks a lot, looks like a bug in Qt6 right now.

freefirex commented 1 year ago

I'm unsure if this was cross reported to QT. I was unable to find an open report, so I created one which can be found here if anyone is looking: https://bugreports.qt.io/browse/QTBUG-110140

RytoEX commented 1 year ago

As far as I can tell from the QTBUG, this is a known issue in Qt 6.2.x that will not be fixed in the 6.2.x series (see also QTBUG-104962). Their recommendation is to use Qt 6.4+, which we do in the Flatpak release of OBS. For PPA builds, we use what is available to the PPA builder, which is Qt 6.2.4 for Ubuntu 22.04. For Ubuntu 22.10 PPA builds, we use Qt 6.3.1, where this is also not fixed, and there will be no further updates to the Qt 6.3 branch. Once Ubuntu 23.04 is out, our PPA builds will use whatever is available there, which seems likely to be Qt 6.4.2, where this is fixed.

Some possible solutions you can choose include:

  1. Switch to the Flatpak build where this should not occur. Confirmation that this does not occur would be welcome. a. Optionally, switch back to the PPA release to see if this remains fixed after the dockstate is loaded and saved.
  2. Wait for a PPA release of OBS Studio on Ubuntu 23.04.
  3. Build OBS against Qt 6.4 yourself.
  4. Delete the DockState from ~/.config/obs-studio/global.ini.

I do not think there is a reliable way for us to detect that the DockState was saved by Qt5, so I do not think there is anything we can do to mitigate this. @kkartaltepe ?

LuciousLisa commented 1 year ago

Thanks @JarnoKai for providing the additional necessary information!
@RytoEX thank you for providing some possible solutions, I am indeed running the PPA version and can switch to Flatpak if needed. Appreciate all the time and effort you folks put into this. :+1: