Closed Lytigas closed 3 years ago
First of all - thanks for reporting the issue!
I can't seem to produce a useable backtrace for some reason and cannot reproduce the issue in a Ubuntu 20 VM. Can you maybe try just running the latest build available just in case it was fixed already?
For example this one: https://github.com/WarmUpTill/SceneSwitcher/actions/runs/506410039
Just to make sure I understand the issue correctly: Does this issue only happen on a particular drop-down box on the audio tab or all of them? Does it apply to the other drop-down boxes on the other tabs as well?
Did some more digging using the nightly release you linked:
I tried to reproduce another way and found this: By messing around with many other controls at the same time (using scroll wheel and moving the mouse), I produced a segfault with this console output, which may be a good lead:
... Scene list ...
info: ------------------------------------------------
QXcbConnection: XCB error: 3 (BadWindow), sequence: 552, resource id: 9104064, major code: 40 (TranslateCoords), minor code: 0
Attempted path: share/obs/obs-studio/images/overflow.png
Attempted path: /usr/share/obs/obs-studio/images/overflow.png
qt.svg: Cannot open file '/home/josh/forms/images/up.svg', because: No such file or directory
qt.svg: Cannot open file '/home/josh/forms/images/up.svg', because: No such file or directory
qt.svg: Cannot open file '/home/josh/forms/images/down.svg', because: No such file or directory
qt.svg: Cannot open file '/home/josh/forms/images/down.svg', because: No such file or directory
warning: [adv-ss] failed to attach volmeter to source (null)
warning: [adv-ss] failed to attach volmeter to source (null)
Segmentation fault (core dumped)
The printout could be a race condition as I can't seem to get it a second time. Or, it could be two separate issues.
On further testing, I managed to produce seemingly the same segfault more consistently, albeit without the printout: Create many entries in the audio tab by hitting "+" many times. Place the mouse near the above/below input box of one of them. Scroll up and down rapidly while moving the mouse around. This will simultaneously alter the "above/below" input, the threshold, and scroll the window. Eventually, this often segfaults. This seems so nasty to debug I don't think it's worth the time.
Back to the main issue --
I was going to record something in rr
so I could send it to you, but OBS needs the GPU and that doesn't seem to work in RR. For now, I have this backtrace for you, produced as in the original report (selecting something from the source dropdown):
(gdb) backtrace
#0 0x00007ffff2f7efd0 in __GI___pthread_mutex_lock (mutex=0x79) at ../nptl/pthread_mutex_lock.c:67
#1 0x00007ffff49e6427 in obs_volmeter_remove_callback () at /usr/lib/libobs.so.0
#2 0x0000555555725c52 in ()
#3 0x0000555555725cb9 in ()
#4 0x00007fff8ee413dc in AudioSwitchWidget::UpdateVolmeterSource() (this=this@entry=0x55555c6b1a10) at /home/runner/work/SceneSwitcher/SceneSwitcher/UI/frontend-plugins/SceneSwitcher/src/switch-audio.cpp:520
#5 0x00007fff8ee41611 in AudioSwitchWidget::SourceChanged(QString const&) (this=0x55555c6b1a10, text=...) at /home/runner/work/SceneSwitcher/SceneSwitcher/UI/frontend-plugins/SceneSwitcher/src/switch-audio.cpp:545
#6 0x00007ffff3d8c555 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7 0x00007ffff4ebfd05 in QComboBox::currentTextChanged(QString const&) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#8 0x00007ffff4ec1bfb in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#9 0x00007ffff4ec302c in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#10 0x00007ffff4ec31c1 in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x00007ffff4ec8c8d in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#12 0x00007ffff3d8c555 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff4ec02f9 in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x00007ffff3d5d5bc in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007ffff4dbb815 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x00007ffff4dc365f in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#17 0x00007ffff3d5d8d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#18 0x00007ffff4dc2632 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007ffff4e14ea5 in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#20 0x00007ffff4e177da in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007ffff4dbb83c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007ffff4dc3104 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007ffff3d5d8d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#24 0x00007ffff431f583 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#25 0x00007ffff4321055 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#26 0x00007ffff42f82eb in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#27 0x00007fffdbabd676 in () at /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#28 0x00007ffff3d5b90a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#29 0x00007ffff4fa5f17 in QDialog::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#30 0x00007fff8edcf5fa in <lambda()>::operator() (__closure=<optimized out>) at /home/runner/work/SceneSwitcher/SceneSwitcher/UI/frontend-plugins/SceneSwitcher/src/advanced-scene-switcher.cpp:742
#31 0x00007fff8edcf5fa in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, InitSceneSwitcher()::<lambda()> >::call (f=..., arg=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:130
#32 0x00007fff8edcf5fa in QtPrivate::Functor<InitSceneSwitcher()::<lambda()>, 0>::call<QtPrivate::List<>, void> (f=..., arg=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:240
#33 0x00007fff8edcf5fa in QtPrivate::QFunctorSlotObject<InitSceneSwitcher()::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=<optimized out>, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject_impl.h:168
#34 0x00007ffff3d8c66f in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#35 0x00007ffff4db5122 in QAction::triggered(bool) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#36 0x00007ffff4db780c in QAction::activate(QAction::ActionEvent) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#37 0x00007ffff4f340fc in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#38 0x00007ffff4f3b5ab in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#39 0x00007ffff4f3c3d3 in QMenu::mouseReleaseEvent(QMouseEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#40 0x00007ffff4dfa048 in QWidget::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#41 0x00007ffff4f3e6fb in QMenu::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#42 0x00007ffff4dbb83c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#43 0x00007ffff4dc365f in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#44 0x00007ffff3d5d8d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#45 0x00007ffff4dc2632 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#46 0x00007ffff4e14ea5 in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#47 0x00007ffff4e177da in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#48 0x00007ffff4dbb83c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#49 0x00007ffff4dc3104 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#50 0x00007ffff3d5d8d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#51 0x00007ffff431f583 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#52 0x00007ffff4321055 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#53 0x00007ffff42f82eb in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#54 0x00007fffdbabd676 in () at /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#55 0x00007ffff3d5b90a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
---Type <return> to continue, or q <return> to quit---frame 1
#56 0x00007ffff3d649b4 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#57 0x00005555555da972 in main ()
Next, I plan to recompile OBS and the plugin with debug symbols enabled so I can give you some better info. I'm commenting this now in case I get interrupted and it takes a while to finish.
This is weird.
In a debug build of OBS from master (c38cbb1), the segfault does not occur. Instead, I get two lines of debug output
debug: obs_source_get_name: Null 'source' parameter
debug: obs_volmeter_remove_callback: Null 'volmeter' parameter
The first line appears when the entry in the audio menu is created, and the second when a source is selected.
In a non-debug build of OBS master, the issue also appears to be fixed. In fact, all builds I tried of OBS from source, going all the way back to the 26.1.1 tag, and even the debian package tarball itself, don't reproduce the issue.
It must be caused by a build parameter then, right? Could be, here are my build parameters (build is inside a bionic Docker container):
cmake -DUNIX_STRUCTURE=0 -DCMAKE_INSTALL_PREFIX="/opt/obs_build/install" ..
and here are the ones in the debian.tar.xz
:
dh_auto_configure -- -DOBS_VERSION_OVERRIDE="26.1.1" -DBUILD_BROWSER=ON -DCEF_ROOT_DIR="../cef_binary_76.1.13+gf19c584+chromium-76.0.3809.132_linux64_minimal" -DUSE_QT_LOOP=TRUE
I also tried adding -DUSE_QT_LOOP=TRUE
, no change. Unless it's something with CEF or portable mode, I'm lost.
I have no idea how this is fixed in OBS itself, but this explains why you couldn't reproduce.
Regardless of the root cause, it's probably not anything in this plugin. I appreciate any effort you may have put into resolving this, although I feel bad for wasting your time with what seems to have been an OBS [packaging] issue :)
I'm closing on that theory. If you think it might actually be caused by this plugin, I'd be happy to help investigate further.
This very strange indeed and I also don't have an explanation, what could have caused this, but I am glad that it is resolved (for) now! :)
The following messages are expected on a newly added audio tab entry as the connected audio source is initialized to nullptr:
debug: obs_source_get_name: Null 'source' parameter
debug: obs_volmeter_remove_callback: Null 'volmeter' parameter
I might add some nullptr checks in future to avoid these misleading messages.
Anyways, thanks for all the effort you put into analyzing this further!
Just installed this plugin on Ubuntu 18.04. It's possible I messed up the install, but the windows seem to show up OK.
Reproduction (for me): Install 1.8.3 official build. Tools -> Advanced Scene Switcher -> Audio -> + -> Select any item in the dropdown This causes a segfault.
Logs:
Here is a coredump link: https://gofile.io/d/OZiYnd Here is an alternate download link (different coredump, but produced the same way) https://files.catbox.moe/2jthm6.crash
No pressure to fix, but I'd be happy to try any fixes or provide more details.