Bug 464549 - Portal crash when Telegram flatpak posts a notification
Summary: Portal crash when Telegram flatpak posts a notification
Status: RESOLVED FIXED
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (show other bugs)
Version: 5.26.90
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-20 13:39 UTC by hexchain
Modified: 2023-01-25 21:47 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hexchain 2023-01-20 13:39:59 UTC
SUMMARY
The xdg-desktop-portal-kde process crashes every time when Telegram flatpak posts a notification. More specifically, the notification does not show up, and the crash seems to happen when Telegram tries to cancel it.

STEPS TO REPRODUCE
1. Start Telegram flatpak
2. Receive a message
3. Switch to the chat window of the message

OBSERVED RESULT
A notification "Portal Closed Unexpectedly" shows up.

EXPECTED RESULT
A message notification should show up upon receiving a message (step 2), and the notification should be canceled after switching to that chat window (step 3).

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.26.90
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Kernel Version: 6.1.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 PRO 6860Z with Radeon Graphics
Memory: 27.2 GiB of RAM

ADDITIONAL INFORMATION
Backtrace:
(gdb) bt
#0  __GI___pthread_sigmask (how=1, newmask=<optimized out>, oldmask=0x0) at pthread_sigmask.c:43
#1  0x00007f889c651bdd in __GI___sigprocmask (how=<optimized out>, set=<optimized out>, oset=<optimized out>) at ../sysdeps/unix/sysv/linux/sigprocmask.c:25
#2  0x00007f889d1291eb in KCrash::setCrashHandler (handler=handler@entry=0x0) at /usr/src/debug/kcrash/kcrash-5.102.0/src/kcrash.cpp:414
#3  0x00007f889d12b7e6 in KCrash::defaultCrashHandler (sig=11) at /usr/src/debug/kcrash/kcrash-5.102.0/src/kcrash.cpp:625
#4  <signal handler called>
#5  0x00007f889ce8d1d0 in std::__atomic_base<QThreadData*>::load (__m=<optimized out>, this=<optimized out>) at /usr/include/c++/12.2.1/bits/atomic_base.h:820
#6  std::atomic<QThreadData*>::load (__m=<optimized out>, this=<optimized out>) at /usr/include/c++/12.2.1/atomic:579
#7  QAtomicOps<QThreadData*>::loadAcquire<QThreadData*> (_q_value=..., _q_value=...) at ../../include/QtCore/../../src/corelib/thread/qatomic_cxx11.h:251
#8  QBasicAtomicPointer<QThreadData>::loadAcquire (this=<optimized out>, this=<optimized out>) at ../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:255
#9  QCoreApplicationPrivate::lockThreadPostEventList (object=0x55fa2e028780) at kernel/qcoreapplication.cpp:1494
#10 0x00007f889ce8e372 in QCoreApplication::postEvent (receiver=0x55fa2e028780, event=0x55fa2dfeaa20, priority=0) at kernel/qcoreapplication.cpp:1546
#11 0x000055fa2d8c7a4a in NotificationPortal::qt_static_metacall (_c=<optimized out>, _a=0x7ffcccd73b80, _id=1, _o=0x55fa2dffa790) at /usr/src/debug/xdg-desktop-portal-kde/build/src/xdg-desktop-portal-kde_autogen/EWIEGA46WW/moc_notification.cpp:95
#12 NotificationPortal::qt_static_metacall (_a=0x7ffcccd73b80, _id=1, _c=QMetaObject::InvokeMetaMethod, _o=0x55fa2dffa790) at /usr/src/debug/xdg-desktop-portal-kde/build/src/xdg-desktop-portal-kde_autogen/EWIEGA46WW/moc_notification.cpp:88
#13 NotificationPortal::qt_metacall (this=0x55fa2dffa790, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7ffcccd73b80) at /usr/src/debug/xdg-desktop-portal-kde/build/src/xdg-desktop-portal-kde_autogen/EWIEGA46WW/moc_notification.cpp:133
#14 0x00007f889de6a45f in QDBusConnectionPrivate::deliverCall(QObject*, int, QDBusMessage const&, QVector<int> const&, int) [clone .constprop.0] (this=<optimized out>, object=<optimized out>, msg=..., metaTypes=..., slotIdx=<optimized out>)
    at /usr/src/debug/qt5-base/qtbase/src/dbus/qdbusintegrator.cpp:1001
#15 0x00007f889de30a44 in QDBusConnectionPrivate::activateCall (this=this@entry=0x7f8890001c00, object=0x55fa2dffa790, flags=flags@entry=273, msg=...) at /usr/src/debug/qt5-base/qtbase/src/dbus/qdbusintegrator.cpp:904
#16 0x00007f889de31719 in QDBusConnectionPrivate::activateCall (msg=..., flags=273, object=<optimized out>, this=0x7f8890001c00) at /usr/src/debug/qt5-base/qtbase/src/dbus/qdbusintegrator.cpp:853
#17 QDBusConnectionPrivate::activateObject (this=0x7f8890001c00, node=..., msg=..., pathStartPos=<optimized out>) at /usr/src/debug/qt5-base/qtbase/src/dbus/qdbusintegrator.cpp:1503
#18 0x00007f889de3175c in QDBusActivateObjectEvent::placeMetaCall (this=0x55fa2df6f990) at /usr/src/debug/qt5-base/qtbase/src/dbus/qdbusintegrator.cpp:1623
#19 0x00007f889ceb1a70 in QObject::event (this=0x55fa2e035160, e=0x55fa2df6f990) at kernel/qobject.cpp:1347
#20 0x00007f889e778b5c in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55fa2e035160, e=0x55fa2df6f990) at kernel/qapplication.cpp:3640
#21 0x00007f889ce8de08 in QCoreApplication::notifyInternal2 (receiver=0x55fa2e035160, event=0x55fa2df6f990) at kernel/qcoreapplication.cpp:1064
#22 0x00007f889ce8e913 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x55fa2dd7bf60) at kernel/qcoreapplication.cpp:1821
#23 0x00007f889ced4d48 in postEventSourceDispatch (s=0x55fa2dda5570) at kernel/qeventdispatcher_glib.cpp:277
#24 0x00007f889b51682b in g_main_dispatch (context=0x7f8890005010) at ../glib/glib/gmain.c:3454
#25 g_main_context_dispatch (context=0x7f8890005010) at ../glib/glib/gmain.c:4172
#26 0x00007f889b56dcc9 in g_main_context_iterate.constprop.0 (context=0x7f8890005010, block=1, dispatch=1, self=<optimized out>) at ../glib/glib/gmain.c:4248
#27 0x00007f889b5150e2 in g_main_context_iteration (context=0x7f8890005010, may_block=1) at ../glib/glib/gmain.c:4313
#28 0x00007f889ced8b2c in QEventDispatcherGlib::processEvents (this=0x55fa2dd4f3d0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#29 0x00007f889ce865ac in QEventLoop::exec (this=0x7ffcccd741d0, flags=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#30 0x00007f889ce910d9 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#31 0x00007f889d339fe2 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1870
#32 0x00007f889e776f2a in QApplication::exec () at kernel/qapplication.cpp:2832
#33 0x000055fa2d8be7eb in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/xdg-desktop-portal-kde/xdg-desktop-portal-kde-5.26.90/src/xdg-desktop-portal-kde.cpp:46
Comment 2 hexchain 2023-01-22 07:13:20 UTC
With this patch applied it does not crash anymore. But the notification still does not show up, maybe that's another issue.
Comment 3 Aleix Pol 2023-01-24 02:08:01 UTC
Git commit beaad22a2a400b01bd37569885490fdc81c6b1d6 by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 24/01/2023 at 02:07.
Pushed by apol into branch 'cherry-pick-876c3412'.

notifications: Do not crash as notifications get removed

Make sure notifications do not get deleted or reused until we are done
with them.


(cherry picked from commit 876c34120c5afa772a1cea153312e464a903f828)

M  +8    -9    src/notification.cpp

https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/beaad22a2a400b01bd37569885490fdc81c6b1d6
Comment 4 Aleix Pol 2023-01-24 02:09:16 UTC
Git commit 876c34120c5afa772a1cea153312e464a903f828 by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 24/01/2023 at 02:07.
Pushed by apol into branch 'master'.

notifications: Do not crash as notifications get removed

Make sure notifications do not get deleted or reused until we are done
with them.

M  +8    -9    src/notification.cpp

https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/876c34120c5afa772a1cea153312e464a903f828