| Summary: | OBS crashes in ScreenCastSession::setStreams() when monitor for screen capture (pipewire) is changed | ||
|---|---|---|---|
| Product: | [Plasma] xdg-desktop-portal-kde | Reporter: | Eric Armbruster <eric1> |
| Component: | general | Assignee: | Plasma Bugs List <plasma-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | CC: | aleixpol, jgrulich, nate, postix |
| Priority: | NOR | ||
| Version First Reported In: | git-master | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/7b83e69d315e957e8945e00b7b6367dc78a91a8e | Version Fixed/Implemented In: | 5.26 |
| Sentry Crash Report: | |||
I am unable to reproduce this crash. Selected a single screen in OBS Studio when xdg-desktop-portal-kde crashed. Selecting it again directly after, worked.
Here's the stacktrace:
```
Application: Portal (xdg-desktop-portal-kde), signal: Segmentation fault
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = <optimized out>}
[KCrash Handler]
#6 std::__atomic_base<int>::load (__m=std::memory_order_relaxed, this=0x6567616d61645f68) at /usr/include/c++/12/bits/atomic_base.h:486
#7 QAtomicOps<int>::loadRelaxed<int> (_q_value=<error reading variable: Cannot access memory at address 0x6567616d61645f68>) at /usr/include/qt5/QtCore/qatomic_cxx11.h:239
#8 QBasicAtomicInteger<int>::loadRelaxed (this=0x6567616d61645f68) at /usr/include/qt5/QtCore/qbasicatomic.h:107
#9 QtPrivate::RefCount::deref (this=0x6567616d61645f68) at /usr/include/qt5/QtCore/qrefcount.h:66
#10 0x0000558e745521d1 in QVector<WaylandIntegration::Stream>::~QVector (this=<optimized out>, this=<optimized out>) at /usr/include/qt5/QtCore/qvector.h:73
#11 QVector<WaylandIntegration::Stream>::operator= (v=..., this=0x558e768873c0) at /usr/include/qt5/QtCore/qvector.h:500
#12 QVector<WaylandIntegration::Stream>::operator= (v=..., this=0x558e768873c0) at /usr/include/qt5/QtCore/qvector.h:495
#13 ScreenCastSession::setStreams (streams=..., this=0x558e76887390) at /usr/src/debug/xdg-desktop-portal-kde-5.25.5-1.1.x86_64/src/session.h:80
#14 ScreenCastPortal::Start (this=<optimized out>, handle=..., session_handle=..., app_id=..., parent_window=..., options=..., results=...) at /usr/src/debug/xdg-desktop-portal-kde-5.25.5-1.1.x86_64/src/screencast.cpp:311
#15 0x0000558e7452e858 in ScreenCastPortal::qt_static_metacall (_o=_o@entry=0x558e761e9230, _c=_c@entry=QMetaObject::InvokeMetaMethod, _id=_id@entry=2, _a=_a@entry=0x7ffc8dad0b50) at /usr/src/debug/xdg-desktop-portal-kde-5.25.5-1.1.x86_64/build/src/xdg-desktop-portal-kde_autogen/EWIEGA46WW/moc_screencast.cpp:143
#16 0x0000558e74534063 in ScreenCastPortal::qt_metacall (this=0x558e761e9230, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7ffc8dad0b50) at /usr/src/debug/xdg-desktop-portal-kde-5.25.5-1.1.x86_64/build/src/xdg-desktop-portal-kde_autogen/EWIEGA46WW/moc_screencast.cpp:223
#17 0x00007fc861a0b56b in QDBusConnectionPrivate::deliverCall (this=<optimized out>, object=<optimized out>, msg=..., metaTypes=..., slotIdx=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qvarlengtharray.h:189
#18 0x00007fc861a0f3d6 in QDBusConnectionPrivate::activateCall (this=this@entry=0x7fc850004a80, object=0x558e761e9230, flags=flags@entry=273, msg=...) at qdbusintegrator.cpp:911
#19 0x00007fc861a0fab2 in QDBusConnectionPrivate::activateCall (msg=..., flags=273, object=<optimized out>, this=0x7fc850004a80) at qdbusintegrator.cpp:853
#20 QDBusConnectionPrivate::activateObject (this=0x7fc850004a80, node=..., msg=..., pathStartPos=<optimized out>) at qdbusintegrator.cpp:1503
#21 0x00007fc861a11dc8 in QDBusActivateObjectEvent::placeMetaCall (this=0x7fc854007800) at qdbusintegrator.cpp:1623
#22 0x00007fc86172c730 in QObject::event (this=0x558e761fb350, e=0x7fc854007800) at kernel/qobject.cpp:1314
#23 0x00007fc8630b341e in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x558e761fb350, e=0x7fc854007800) at kernel/qapplication.cpp:3637
#24 0x00007fc861700f88 in QCoreApplication::notifyInternal2 (receiver=0x558e761fb350, event=0x7fc854007800) at kernel/qcoreapplication.cpp:1064
#25 0x00007fc861703f21 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x558e76168440) at kernel/qcoreapplication.cpp:1821
#26 0x00007fc861758c03 in postEventSourceDispatch (s=0x558e761bfe40) at kernel/qeventdispatcher_glib.cpp:277
#27 0x00007fc85f8f2a50 in g_main_dispatch (context=0x558e761c4260) at ../glib/gmain.c:3444
#28 g_main_context_dispatch (context=context@entry=0x558e761c4260) at ../glib/gmain.c:4162
#29 0x00007fc85f8f2e08 in g_main_context_iterate (context=context@entry=0x558e761c4260, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4238
#30 0x00007fc85f8f2e9c in g_main_context_iteration (context=0x558e761c4260, may_block=1) at ../glib/gmain.c:4303
#31 0x00007fc861758406 in QEventDispatcherGlib::processEvents (this=0x558e761c4a80, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#32 0x00007fc8616ff9fb in QEventLoop::exec (this=this@entry=0x7ffc8dad1110, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#33 0x00007fc861707b66 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#34 0x00007fc8623c6e0c in QGuiApplication::exec () at kernel/qguiapplication.cpp:1867
#35 0x00007fc8630b3395 in QApplication::exec () at kernel/qapplication.cpp:2829
#36 0x0000558e7452c468 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/xdg-desktop-portal-kde-5.25.5-1.1.x86_64/src/xdg-desktop-portal-kde.cpp:48
[Inferior 1 (process 5507) detached]
```
Git commit 73145576b21a3324a5bbc32bf2c2af08af8be719 by Aleix Pol. Committed on 26/09/2022 at 22:06. Pushed by apol into branch 'master'. ScreenCast: Streams can be closed while interacted with This makes sure we do not crash. M +2 -2 src/screencast.cpp https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/73145576b21a3324a5bbc32bf2c2af08af8be719 Git commit 7b83e69d315e957e8945e00b7b6367dc78a91a8e by Aleix Pol Gonzalez, on behalf of Aleix Pol. Committed on 28/09/2022 at 10:19. Pushed by apol into branch 'Plasma/5.26'. ScreenCast: Streams can be closed while interacted with This makes sure we do not crash. (cherry picked from commit 73145576b21a3324a5bbc32bf2c2af08af8be719) M +2 -2 src/screencast.cpp https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/7b83e69d315e957e8945e00b7b6367dc78a91a8e |
SUMMARY 0 0x00007982754a64d8 in pthread_sigmask () from /usr/lib/libc.so.6 #1 0x0000798275451bfd in sigprocmask () from /usr/lib/libc.so.6 #2 0x0000798275f29052 in KCrash::setCrashHandler (handler=0x0) at /home/eric/kde/src/kcrash/src/kcrash.cpp:415 #3 0x0000798275f29ae8 in KCrash::defaultCrashHandler (sig=11) at /home/eric/kde/src/kcrash/src/kcrash.cpp:632 #4 <signal handler called> #5 std::__atomic_base<int>::load (__m=std::memory_order_relaxed, this=0x6f72665f72656601) at /usr/include/c++/12.2.0/bits/atomic_base.h:488 #6 QAtomicOps<int>::loadRelaxed<int> ( _q_value=<error reading variable: Cannot access memory at address 0x6f72665f72656601>) at /usr/include/qt/QtCore/qatomic_cxx11.h:239 #7 0x0000581bef707c1a in QBasicAtomicInteger<int>::loadRelaxed (this=0x6f72665f72656601) at /usr/include/qt/QtCore/qbasicatomic.h:107 #8 0x0000581bef70768c in QtPrivate::RefCount::deref (this=0x6f72665f72656601) at /usr/include/qt/QtCore/qrefcount.h:66 #9 0x0000581bef74b2ff in QVector<WaylandIntegration::Stream>::~QVector (this=0x7ffd877a6910, __in_chrg=<optimized out>) at /usr/include/qt/QtCore/qvector.h:73 #10 0x0000581bef7527ec in QVector<WaylandIntegration::Stream>::operator= ( this=0x581befda4a90, v=QVector<WaylandIntegration::Stream> (size = 1) = {...}) at /usr/include/qt/QtCore/qvector.h:500 #11 0x0000581bef7523b9 in ScreenCastSession::setStreams (this=0x581befda4a60, streams=QVector<WaylandIntegration::Stream> (size = 1) = {...}) at /home/eric/kde/src/xdg-desktop-portal-kde/src/session.h:80 #12 0x0000581bef751c29 in ScreenCastPortal::Start (this=0x581befa4fae0, handle=..., session_handle=..., app_id="com.obsproject.Studio", parent_window="", options=QMap<QString, QVariant> (size = 0), results=QMap<QString, QVariant> (size = 0)) at /home/eric/kde/src/xdg-desktop-portal-kde/src/screencast.cpp:304 #13 0x0000581bef7055e0 in ScreenCastPortal::qt_static_metacall (_o=0x581befa4fae0, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7ffd877a6d00) at /home/eric/kde/build/xdg-desktop-portal-kde/src/xdg-desktop-portal-kde_autogen/EWIEGA46WW/moc_screencast.cpp:143 #14 0x0000581bef705877 in ScreenCastPortal::qt_metacall (this=0x581befa4fae0, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7ffd877a6d00) at /home/eric/kde/build/xdg-desktop-portal-kde/src/xdg-desktop-portal-kde_autogen/EWIEGA46WW/moc_screencast.cpp:223 #15 0x000079827712545f in ?? () from /usr/lib/libQt5DBus.so.5 #16 0x00007982770ebbc4 in ?? () from /usr/lib/libQt5DBus.so.5 #17 0x00007982770ec719 in ?? () from /usr/lib/libQt5DBus.so.5 #18 0x00007982770ec75c in ?? () from /usr/lib/libQt5DBus.so.5 #19 0x0000798275cb0520 in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5 #20 0x0000798277b78b1c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5 STEPS TO REPRODUCE 1. Open OBS 2. In Sources select "screen capture (pipewire)" -> select a screen -> everything good 3. click again on the same screen capture source -> select monitor -> crash OBSERVED RESULT Crash EXPECTED RESULT No crash SOFTWARE/OS VERSIONS latest git master as of 9/26/22 ADDITIONAL INFORMATION Reproducible every time, I see this already since 5.25.0 at least crashing Not sure if the bug is in portals, might also be OBS, just had a quick glance at the crash