Bug 451506 - (SEGV) Crash in NotificationInhibition::NotificationInhibition
Summary: (SEGV) Crash in NotificationInhibition::NotificationInhibition
Status: RESOLVED WORKSFORME
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 5.24.3
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2022-03-14 19:07 UTC by postix
Modified: 2022-08-11 04:35 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Stacktrace (thread apply all bt) (55.25 KB, text/plain)
2022-03-14 19:07 UTC, postix
Details
Stacktrace (bt full) (13.82 KB, text/plain)
2022-03-14 19:07 UTC, postix
Details
Chromium log output (78.11 KB, text/plain)
2022-03-14 19:10 UTC, postix
Details
KWin Wayland Debug Information (6.10 KB, text/plain)
2022-03-14 19:20 UTC, postix
Details
dbus-monitor --session (320.38 KB, application/gzip)
2022-05-12 18:30 UTC, postix
Details
bt full OBS (13.59 KB, text/plain)
2022-05-12 18:38 UTC, postix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description postix 2022-03-14 19:07:24 UTC
Created attachment 147495 [details]
Stacktrace (thread apply all bt)

SUMMARY

Tried to share a `screen` or `Wayland window` in a Zoom session in Chromium 99 (`/usr/bin/chromium --enable-features=WebRTCPipeWireCapturer --ozone-platform=wayland`) when xdg-desktop-portal-kde crashed.

#### Stacktrace
```
Thread 1 (Thread 0x7f466ba67480 (LWP 3272)):
#0  __GI___pthread_sigmask (how=1, newmask=<optimized out>, oldmask=0x0) at pthread_sigmask.c:43
#1  0x00007f466ddb15ed in __GI___sigprocmask (how=<optimized out>, set=<optimized out>, oset=<optimized out>) at ../sysdeps/unix/sysv/linux/sigprocmask.c:25
#2  0x00007f466d13284b in KCrash::setCrashHandler (handler=handler@entry=0x0) at /usr/src/debug/kcrash-5.91.0-1.1.x86_64/src/kcrash.cpp:417
#3  0x00007f466d134d2e in KCrash::defaultCrashHandler (sig=11) at /usr/src/debug/kcrash-5.91.0-1.1.x86_64/src/kcrash.cpp:623
#4  <signal handler called>
#5  0x00007f466e4a98f4 in std::__atomic_base<QThreadData*>::load (__m=std::memory_order_relaxed, this=0x38) at /usr/include/c++/11/bits/atomic_base.h:836
#6  std::atomic<QThreadData*>::load (__m=std::memory_order_relaxed, this=0x38) at /usr/include/c++/11/atomic:570
#7  QAtomicOps<QThreadData*>::loadRelaxed<QThreadData*> (_q_value=...) at ../../include/QtCore/../../src/corelib/thread/qatomic_cxx11.h:239
#8  QBasicAtomicPointer<QThreadData>::loadRelaxed (this=0x38) at ../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:248
#9  QObject::thread (this=this@entry=0x564e70083e10) at kernel/qobject.cpp:1487
#10 0x00007f466e4b4adb in QObject::QObject (this=0x564e6fd9b9b0, dd=..., parent=0x564e70083e10) at kernel/qobject.cpp:919
#11 0x0000564e6f1f6285 in NotificationInhibition::NotificationInhibition (parent=0x564e70083e10, reason=..., appId=..., this=0x564e6fd9b9b0) at /usr/src/debug/xdg-desktop-portal-kde-5.24.3-1.1.x86_64/src/notificationinhibition.cpp:24
#12 ScreenCastPortal::Start(QDBusObjectPath const&, QDBusObjectPath const&, QString const&, QString const&, QMap<QString, QVariant> const&, QMap<QString, QVariant>&) [clone .isra.0] (handle=..., session_handle=..., app_id=..., parent_window=..., options=..., results=..., this=<optimized out>) at /usr/src/debug/xdg-desktop-portal-kde-5.24.3-1.1.x86_64/src/screencast.cpp:172
#13 0x0000564e6f1b93c5 in ScreenCastPortal::qt_static_metacall (_o=_o@entry=0x564e6fbe8750, _c=_c@entry=QMetaObject::InvokeMetaMethod, _id=_id@entry=2, _a=_a@entry=0x7ffc8e6101a0) at /usr/src/debug/xdg-desktop-portal-kde-5.24.3-1.1.x86_64/build/src/xdg-desktop-portal-kde_autogen/EWIEGA46WW/moc_screencast.cpp:131
#14 0x0000564e6f1c11bb in ScreenCastPortal::qt_metacall (this=0x564e6fbe8750, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7ffc8e6101a0) at /usr/src/debug/xdg-desktop-portal-kde-5.24.3-1.1.x86_64/build/src/xdg-desktop-portal-kde_autogen/EWIEGA46WW/moc_screencast.cpp:211
#15 0x00007f466e7896ab in QDBusConnectionPrivate::deliverCall (this=<optimized out>, object=<optimized out>, msg=..., metaTypes=..., slotIdx=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qvarlengtharray.h:189
#16 0x00007f466e78d3a7 in QDBusConnectionPrivate::activateCall (this=this@entry=0x7f4660004a60, object=0x564e6fbe8750, flags=flags@entry=273, msg=...) at qdbusintegrator.cpp:911
#17 0x00007f466e78dae9 in QDBusConnectionPrivate::activateCall (msg=..., flags=273, object=<optimized out>, this=0x7f4660004a60) at qdbusintegrator.cpp:853
#18 QDBusConnectionPrivate::activateObject (this=0x7f4660004a60, node=..., msg=..., pathStartPos=<optimized out>) at qdbusintegrator.cpp:1497
#19 0x00007f466e78fe88 in QDBusActivateObjectEvent::placeMetaCall (this=0x7f4664005280) at qdbusintegrator.cpp:1617
#20 0x00007f466e4ac4ae in QObject::event (this=0x564e6fbdfeb0, e=0x7f4664005280) at kernel/qobject.cpp:1314
#21 0x00007f466fe25a7f in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x564e6fbdfeb0, e=0x7f4664005280) at kernel/qapplication.cpp:3632
#22 0x00007f466e47fe3a in QCoreApplication::notifyInternal2 (receiver=0x564e6fbdfeb0, event=0x7f4664005280) at kernel/qcoreapplication.cpp:1064
#23 0x00007f466e482e77 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x564e6fb57460) at kernel/qcoreapplication.cpp:1821
#24 0x00007f466e4d7d03 in postEventSourceDispatch (s=s@entry=0x564e6fbb1e80) at kernel/qeventdispatcher_glib.cpp:277
#25 0x00007f466c80be22 in g_main_dispatch (context=0x564e6fbaff30) at ../glib/gmain.c:3381
#26 g_main_context_dispatch (context=0x564e6fbaff30) at ../glib/gmain.c:4099
#27 0x00007f466c80c1b8 in g_main_context_iterate (context=context@entry=0x564e6fbaff30, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4175
#28 0x00007f466c80c26f in g_main_context_iteration (context=0x564e6fbaff30, may_block=1) at ../glib/gmain.c:4240
#29 0x00007f466e4d7384 in QEventDispatcherGlib::processEvents (this=0x564e6fbb2b10, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#30 0x00007f466e47e83b in QEventLoop::exec (this=this@entry=0x7ffc8e610780, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#31 0x00007f466e486b10 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#32 0x00007f466f12f25c in QGuiApplication::exec () at kernel/qguiapplication.cpp:1867
#33 0x00007f466fe259f5 in QApplication::exec () at kernel/qapplication.cpp:2824
#34 0x0000564e6f1b70f4 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/xdg-desktop-portal-kde-5.24.3-1.1.x86_64/src/xdg-desktop-portal-kde.cpp:46
```


SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20220312
KDE Plasma Version: 5.24.3
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2
Kernel Version: 5.16.11-1-default (64-bit)
Graphics Platform: Wayland
Graphics Processor: AMD Radeon RX 580 Series
Comment 1 postix 2022-03-14 19:07:48 UTC
Created attachment 147496 [details]
Stacktrace (bt full)
Comment 2 postix 2022-03-14 19:10:36 UTC
Created attachment 147497 [details]
Chromium log output
Comment 3 postix 2022-03-14 19:19:03 UTC
In the Chromium log there are many lines of the following error
```
[8421:8421:0314/144422.378708:ERROR:gles2_cmd_decoder.cc(10739)] [.WebGL-0x2d560387e800]RENDER WARNING: there is no texture bound to the unit 4
```
and it reads also at a place
```
[8380:8380:0314/144357.753435:ERROR:egl_dmabuf.cc(543)] Failed to query DMA-BUF modifiers.
[8380:8380:0314/144406.712206:ERROR:base_capturer_pipewire.cc(1094)] Failed to start the screen cast session.
```
Comment 4 postix 2022-03-14 19:20:19 UTC
Created attachment 147498 [details]
KWin Wayland Debug Information
Comment 5 Jan Grulich 2022-03-15 06:39:53 UTC
> [8380:8380:0314/144357.753435:ERROR:egl_dmabuf.cc(543)] Failed to query DMA-BUF modifiers.
This is harmless, it's reported probably because your graphics card/driver doesn't support DMA-BUF modifiers, but it still should work without using an explicit DMA-BUF modifier.

> [8380:8380:0314/144406.712206:ERROR:base_capturer_pipewire.cc(1094)] Failed to start the screen cast session.
This is most likely response to xdg-deskto-portal-kde crashing.

Is this crash reproducible all the time? Does it crash when you try to share a screen for example here https://www.webrtc-experiment.com/Pluginfree-Screen-Sharing/?
Comment 6 postix 2022-03-15 10:35:24 UTC
(In reply to Jan Grulich from comment #5)
> Is this crash reproducible all the time?

So far it happened only once and then I had no chance to test it again.
I will check it again if it happens in a Zoom session, which does not make use of WebRTC afaik. 

> Does it crash when you try to share a screen for example here
> https://www.webrtc-experiment.com/Pluginfree-Screen-Sharing/?

I could not reproduce the crash with this WebRTC test page. 

(Actually, after the xdg-desktop-portal-kde crashed, I could no longer restart Chromium, it would crash immediately until reboot. I still have the stacktrace, but I guess that's more of interest for the Chrome developers anyway.)
Comment 7 Kai Uwe Broulik 2022-03-15 10:38:52 UTC
Is it possible the session object goes away whilst the prompt is shown?

We do:

ScreenCastSession *session = qobject_cast<ScreenCastSession *>(Session::getSession(session_handle.path()));
...
if (screenDialog->exec()) {
    ...
    new NotificationInhibition(app_id, i18nc("Do not disturb mode is enabled because...", "Screen sharing in progress"), session);
}

So is it possible for the session object to go away in the mean time? If so, this would explain the crash and needs a guard of some sort.
Comment 8 Jan Grulich 2022-03-15 10:42:45 UTC
(In reply to postix from comment #6)
> (In reply to Jan Grulich from comment #5)
> > Is this crash reproducible all the time?
> 
> So far it happened only once and then I had no chance to test it again.
> I will check it again if it happens in a Zoom session, which does not make
> use of WebRTC afaik. 

It definitely used WebRTC, the debug information is from there.

(In reply to Kai Uwe Broulik from comment #7)
> Is it possible the session object goes away whilst the prompt is shown?
> 
> We do:
> 
> ScreenCastSession *session = qobject_cast<ScreenCastSession
> *>(Session::getSession(session_handle.path()));
> ...
> if (screenDialog->exec()) {
>     ...
>     new NotificationInhibition(app_id, i18nc("Do not disturb mode is enabled
> because...", "Screen sharing in progress"), session);
> }
> 
> So is it possible for the session object to go away in the mean time? If so,
> this would explain the crash and needs a guard of some sort.

We would know for sure from DBus log. Can you try to run "dbus-monitor --session" in a terminal, while trying to share a screen in Zoom?
Comment 9 postix 2022-05-12 18:00:12 UTC
It happened again, when I used OBS Studio 27.2.4 to record a screen

```
#0  __GI___pthread_sigmask (how=1, newmask=<optimized out>, oldmask=0x0) at pthread_sigmask.c:43
#1  0x00007fa8874755ed in __GI___sigprocmask (how=<optimized out>, set=<optimized out>, oset=<optimized out>) at ../sysdeps/unix/sysv/linux/sigprocmask.c:25
#2  0x00007fa8867e284b in KCrash::setCrashHandler (handler=handler@entry=0x0) at /usr/src/debug/kcrash-5.93.0-1.1.x86_64/src/kcrash.cpp:417
#3  0x00007fa8867e4d2e in KCrash::defaultCrashHandler (sig=11) at /usr/src/debug/kcrash-5.93.0-1.1.x86_64/src/kcrash.cpp:623
#4  <signal handler called>
#5  std::__atomic_base<int>::operator++ (this=this@entry=0x7fa889ef8400 <qt_meta_stringdata_KNotification>) at /usr/include/c++/11/bits/atomic_base.h:377
#6  QAtomicOps<int>::ref<int> (_q_value=...) at ../../include/QtCore/../../src/corelib/thread/qatomic_cxx11.h:283
#7  QBasicAtomicInteger<int>::ref (this=this@entry=0x7fa889ef8400 <qt_meta_stringdata_KNotification>) at ../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:118
#8  QThreadData::ref (this=this@entry=0x7fa889ef8400 <qt_meta_stringdata_KNotification>) at thread/qthread.cpp:111
#9  0x00007fa887b8aa29 in QObject::QObject (this=0x563eb9fca4c0, dd=..., parent=0x563eb9e45300) at kernel/qobject.cpp:920
#10 0x0000563eb8b4c392 in NotificationInhibition::NotificationInhibition (parent=0x563eb9e45300, reason=..., appId=..., this=0x563eb9fca4c0) at /usr/src/debug/xdg-desktop-portal-kde-5.24.5-1.1.x86_64/src/notificationinhibition.cpp:24
#11 ScreenCastPortal::Start(QDBusObjectPath const&, QDBusObjectPath const&, QString const&, QString const&, QMap<QString, QVariant> const&, QMap<QString, QVariant>&) [clone .isra.0] (handle=..., session_handle=..., app_id=..., parent_window=..., options=..., results=..., this=<optimized out>) at /usr/src/debug/xdg-desktop-portal-kde-5.24.5-1.1.x86_64/src/screencast.cpp:172
#12 0x0000563eb8b0f3c5 in ScreenCastPortal::qt_static_metacall (_o=_o@entry=0x563eb9b4fdd0, _c=_c@entry=QMetaObject::InvokeMetaMethod, _id=_id@entry=2, _a=_a@entry=0x7ffe1953f9a0) at /usr/src/debug/xdg-desktop-portal-kde-5.24.5-1.1.x86_64/build/src/xdg-desktop-portal-kde_autogen/EWIEGA46WW/moc_screencast.cpp:131
#13 0x0000563eb8b173eb in ScreenCastPortal::qt_metacall (this=0x563eb9b4fdd0, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7ffe1953f9a0) at /usr/src/debug/xdg-desktop-portal-kde-5.24.5-1.1.x86_64/build/src/xdg-desktop-portal-kde_autogen/EWIEGA46WW/moc_screencast.cpp:211
#14 0x00007fa887e5f2db in QDBusConnectionPrivate::deliverCall (this=<optimized out>, object=<optimized out>, msg=..., metaTypes=..., slotIdx=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qvarlengtharray.h:189
#15 0x00007fa887e63017 in QDBusConnectionPrivate::activateCall (this=this@entry=0x7fa878004a80, object=0x563eb9b4fdd0, flags=flags@entry=273, msg=...) at qdbusintegrator.cpp:911
#16 0x00007fa887e6375c in QDBusConnectionPrivate::activateCall (msg=..., flags=273, object=<optimized out>, this=0x7fa878004a80) at qdbusintegrator.cpp:853
#17 QDBusConnectionPrivate::activateObject (this=0x7fa878004a80, node=..., msg=..., pathStartPos=<optimized out>) at qdbusintegrator.cpp:1497
#18 0x00007fa887e65af8 in QDBusActivateObjectEvent::placeMetaCall (this=0x7fa87c001c00) at qdbusintegrator.cpp:1617
#19 0x00007fa887b8228e in QObject::event (this=0x563eb9b3c7d0, e=0x7fa87c001c00) at kernel/qobject.cpp:1314
#20 0x00007fa889507b0f in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x563eb9b3c7d0, e=0x7fa87c001c00) at kernel/qapplication.cpp:3632
#21 0x00007fa887b55b5a in QCoreApplication::notifyInternal2 (receiver=0x563eb9b3c7d0, event=0x7fa87c001c00) at kernel/qcoreapplication.cpp:1064
#22 0x00007fa887b58b97 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x563eb9ab9460) at kernel/qcoreapplication.cpp:1821
#23 0x00007fa887badc33 in postEventSourceDispatch (s=s@entry=0x563eb9b1baf0) at kernel/qeventdispatcher_glib.cpp:277
#24 0x00007fa885ea5122 in g_main_dispatch (context=0x563eb9b134a0) at ../glib/gmain.c:3417
#25 g_main_context_dispatch (context=0x563eb9b134a0) at ../glib/gmain.c:4135
#26 0x00007fa885ea54b8 in g_main_context_iterate (context=context@entry=0x563eb9b134a0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4211
#27 0x00007fa885ea556f in g_main_context_iteration (context=0x563eb9b134a0, may_block=1) at ../glib/gmain.c:4276
#28 0x00007fa887bad2b4 in QEventDispatcherGlib::processEvents (this=0x563eb9b12d50, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#29 0x00007fa887b5455b in QEventLoop::exec (this=this@entry=0x7ffe1953ff80, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#30 0x00007fa887b5c820 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#31 0x00007fa88881161c in QGuiApplication::exec () at kernel/qguiapplication.cpp:1867
#32 0x00007fa889507a85 in QApplication::exec () at kernel/qapplication.cpp:2824
#33 0x0000563eb8b0d0f4 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/xdg-desktop-portal-kde-5.24.5-1.1.x86_64/src/xdg-desktop-portal-kde.cpp:46
```

> Can you try to run "dbus-monitor --session" in a terminal
I can try that next time when using OBS.
Comment 10 postix 2022-05-12 18:30:01 UTC
Created attachment 148775 [details]
dbus-monitor --session

1) started dbus-monitor --session > dbus-monitor.txt
2) opened OBS, made xdg portal crash
Comment 11 postix 2022-05-12 18:38:20 UTC
Created attachment 148776 [details]
bt full OBS
Comment 12 Harald Sitter 2022-07-12 09:55:15 UTC
Still reproducible with 5.25?

And please use the app 'bustle' to record the dbus traffic, I find dbus-monitor quite impossible to read
Comment 13 postix 2022-07-12 10:14:31 UTC
(In reply to Harald Sitter from comment #12)
> Still reproducible with 5.25?
Not yet with 5.25.2. :) Shall we close this bug or leave it open as we don't know whether it's also fixed or not in 5.24 LTS.

> And please use the app 'bustle' to record the dbus traffic, I find
> dbus-monitor quite impossible to read
Noted!
Comment 14 Harald Sitter 2022-07-12 10:31:26 UTC
Let's just leave it in needsinfo, it will time out after 30 days anyway.
Comment 15 Bug Janitor Service 2022-07-27 04:36:02 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 16 Bug Janitor Service 2022-08-11 04:35:41 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!