Bug 423757

Summary: Crash at startup of desktop
Product: [Applications] kdeconnect Reporter: Marcus Menzel <flareload>
Component: commonAssignee: Albert Vaca Cintora <albertvaka>
Status: RESOLVED FIXED    
Severity: crash CC: adriano.lima, alfeno, dschridde+kde, juergen_thomann, justin.zobel, kdebugs.wxdrr, nate, no.name.08154711, rafalkozlowski07, sam, tamasf97, thanhvuy02
Priority: NOR Keywords: drkonqi
Version: unspecified   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In: 5.79
Attachments: New crash information added by DrKonqi
New crash information added by DrKonqi

Description Marcus Menzel 2020-07-01 18:19:58 UTC
Application: kdeconnectd (1.4.0)

Qt Version: 5.14.2
Frameworks Version: 5.71.0
Operating System: Linux 4.15.0-108-generic x86_64
Windowing system: X11
Distribution: KDE neon User Edition 5.19

-- Information about the crash:
The program crashed during the startup sequence of the desktop

The crash can be reproduced sometimes.

-- Backtrace:
Application: KDE-Connect-Dienst (kdeconnectd), signal: Segmentation fault

[KCrash Handler]
#4  KNotification::id (this=this@entry=0x55f8ec9ecb00) at ./src/knotification.cpp:470
#5  0x00007f256a30baa4 in NotifyByPopup::notify (this=0x55f8ec8bd240, notification=0x55f8ec9ecb00, notifyConfig=...) at ./src/notifybypopup.cpp:127
#6  0x00007f256a30bdbf in NotifyByPopupPrivate::<lambda(QDBusPendingCallWatcher*)>::operator() (watcher=<optimized out>, __closure=0x55f8eca7e770) at ./src/notifybypopup.cpp:385
#7  QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QDBusPendingCallWatcher*>, void, NotifyByPopupPrivate::queryPopupServerCapabilities()::<lambda(QDBusPendingCallWatcher*)> >::call (arg=<optimized out>, f=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:146
#8  QtPrivate::Functor<NotifyByPopupPrivate::queryPopupServerCapabilities()::<lambda(QDBusPendingCallWatcher*)>, 1>::call<QtPrivate::List<QDBusPendingCallWatcher*>, void> (arg=<optimized out>, f=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:256
#9  QtPrivate::QFunctorSlotObject<NotifyByPopupPrivate::queryPopupServerCapabilities()::<lambda(QDBusPendingCallWatcher*)>, 1, QtPrivate::List<QDBusPendingCallWatcher*>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x55f8eca7e760, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:443
#10 0x00007f2567ff26d7 in QtPrivate::QSlotObjectBase::call (a=0x7ffeb823ef90, r=0x55f8ec8bd240, this=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#11 doActivate<false> (sender=0x55f8ec8c5bb0, signal_index=3, argv=0x7ffeb823ef90) at kernel/qobject.cpp:3870
#12 0x00007f2567fecf92 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7f256871a5e0 <QDBusPendingCallWatcher::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffeb823ef90) at kernel/qobject.cpp:3930
#13 0x00007f25684fcecf in QDBusPendingCallWatcher::finished (this=<optimized out>, _t1=<optimized out>) at .moc/moc_qdbuspendingcall.cpp:158
#14 0x00007f2567fea57b in QObject::event (this=0x55f8ec8c5bb0, e=0x7f25400099e0) at kernel/qobject.cpp:1339
#15 0x00007f25693d79ac in QApplicationPrivate::notify_helper (this=this@entry=0x55f8ec693de0, receiver=receiver@entry=0x55f8ec8c5bb0, e=e@entry=0x7f25400099e0) at kernel/qapplication.cpp:3685
#16 0x00007f25693debb0 in QApplication::notify (this=0x7ffeb823f600, receiver=0x55f8ec8c5bb0, e=0x7f25400099e0) at kernel/qapplication.cpp:3431
#17 0x00007f2567fb74a8 in QCoreApplication::notifyInternal2 (receiver=0x55f8ec8c5bb0, event=0x7f25400099e0) at kernel/qcoreapplication.cpp:1075
#18 0x00007f2567fb767e in QCoreApplication::sendEvent (receiver=receiver@entry=0x55f8ec8c5bb0, event=event@entry=0x7f25400099e0) at kernel/qcoreapplication.cpp:1470
#19 0x00007f2567fba121 in QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x55f8ec692640) at kernel/qcoreapplication.cpp:1815
#20 0x00007f2567fba6b8 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1674
#21 0x00007f2568017103 in postEventSourceDispatch (s=0x55f8ec6eb890) at kernel/qeventdispatcher_glib.cpp:277
#22 0x00007f2561a66417 in g_main_context_dispatch () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007f2561a66650 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007f2561a666dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007f25680167ac in QEventDispatcherGlib::processEvents (this=0x55f8ec6ef860, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#26 0x00007f2567fb5d2a in QEventLoop::exec (this=this@entry=0x7ffeb823f540, flags=..., flags@entry=...) at kernel/qeventloop.cpp:225
#27 0x00007f2567fbf4a0 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1383
#28 0x000055f8eaf3658d in main (argc=<optimized out>, argv=<optimized out>) at ./daemon/kdeconnectd.cpp:180

Possible duplicates by query: bug 350256, bug 349065, bug 347295, bug 303310, bug 263822.

Reported using DrKonqi
Comment 1 Nicolas Fella 2020-12-03 23:21:14 UTC
*** Bug 427551 has been marked as a duplicate of this bug. ***
Comment 2 Nicolas Fella 2020-12-03 23:21:48 UTC
*** Bug 428118 has been marked as a duplicate of this bug. ***
Comment 3 Nicolas Fella 2020-12-03 23:22:43 UTC
*** Bug 428531 has been marked as a duplicate of this bug. ***
Comment 4 Nicolas Fella 2020-12-03 23:22:58 UTC
*** Bug 429676 has been marked as a duplicate of this bug. ***
Comment 5 Nicolas Fella 2020-12-03 23:23:11 UTC
*** Bug 429828 has been marked as a duplicate of this bug. ***
Comment 6 Nicolas Fella 2020-12-03 23:23:17 UTC
*** Bug 429990 has been marked as a duplicate of this bug. ***
Comment 7 Justin Zobel 2020-12-03 23:25:46 UTC
Since this bug has several duplicates I'm going to mark it as CONFIRMED.
Comment 8 Bug Janitor Service 2020-12-03 23:27:55 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/knotifications/-/merge_requests/24
Comment 9 Nicolas Fella 2020-12-06 13:31:22 UTC
*** Bug 430067 has been marked as a duplicate of this bug. ***
Comment 10 Jürgen Thomann 2020-12-13 13:19:04 UTC
Created attachment 134046 [details]
New crash information added by DrKonqi

kdeconnectd (1.4.0) using Qt 5.15.2

- What I was doing when the application crashed:

Also happend during startup of plasma with latest versions of openSUSE Tumbleweed

-- Backtrace (Reduced):
#4  KNotification::id() (this=0x55ea3ede8120) at /usr/src/debug/knotifications-5.77.0-232.1.x86_64/src/knotification.cpp:463
#5  0x00007fc1b812db2e in NotifyByPopup::notify(KNotification*, KNotifyConfig const&) (this=0x55ea3f014390, notification=0x55ea3ede8120, notifyConfig=...) at /usr/src/debug/knotifications-5.77.0-232.1.x86_64/src/notifybypopup.cpp:112
#6  0x00007fc1b812e3e2 in operator() (watcher=<optimized out>, __closure=0x55ea3f005be0) at /usr/src/debug/knotifications-5.77.0-232.1.x86_64/src/notifybypopup.cpp:373
#10 QtPrivate::QFunctorSlotObject<NotifyByPopupPrivate::queryPopupServerCapabilities()::<lambda(QDBusPendingCallWatcher*)>, 1, QtPrivate::List<QDBusPendingCallWatcher*>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x55ea3f005bd0, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:436
#11 0x00007fc1b6d7f866 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffec534a8a0, r=0x55ea3f014390, this=0x55ea3f005bd0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
Comment 11 Lukas 2021-01-08 09:35:51 UTC
Created attachment 134654 [details]
New crash information added by DrKonqi

kdeconnectd (20.12.1) using Qt 5.15.2

- What I was doing when the application crashed:
The application crashed right after system startup. This happens occasionally.

-- Backtrace (Reduced):
#4  KNotification::id (this=this@entry=0x562a9edb4860) at /usr/src/debug/knotifications-5.77.0/src/knotification.cpp:463
#5  0x00007f5ab185d896 in NotifyByPopup::notify (this=0x562a9ef6d150, notification=0x562a9edb4860, notifyConfig=...) at /usr/src/debug/knotifications-5.77.0/src/notifybypopup.cpp:112
#6  0x00007f5ab185dbfa in operator() (watcher=<optimized out>, __closure=0x562a9ee3dd20) at /usr/src/debug/knotifications-5.77.0/src/notifybypopup.cpp:373
#10 QtPrivate::QFunctorSlotObject<NotifyByPopupPrivate::queryPopupServerCapabilities()::<lambda(QDBusPendingCallWatcher*)>, 1, QtPrivate::List<QDBusPendingCallWatcher*>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x562a9ee3dd10, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt/QtCore/qobjectdefs_impl.h:436
[...]
#12 0x00007f5ab084e9e0 in QDBusPendingCallWatcher::finished(QDBusPendingCallWatcher*) () from /usr/lib/libQt5DBus.so.5
Comment 12 Nicolas Fella 2021-01-12 12:33:34 UTC
Git commit d1bb15dc4892d26201d21f12362979736df1d50c by Nicolas Fella.
Committed on 12/01/2021 at 12:33.
Pushed by nicolasfella into branch 'master'.

Fix removing pending notification from queue

If a notification is in the pending queue it is not yet in the
notifications map. When the notification is then closed we will hit the early return because the id wasn't found.

We need to still remove it from the queue so move the relevant block up.

If the notification is not removed from the queue it will stay as a
dangling pointer and blow up when the capabilities are queried and we
reemit the notification.

M  +8    -8    src/notifybypopup.cpp

https://invent.kde.org/frameworks/knotifications/commit/d1bb15dc4892d26201d21f12362979736df1d50c