Bug 388684 - Plasma crashes if screenshot notification disappears while drag-'n-dropping image
Summary: Plasma crashes if screenshot notification disappears while drag-'n-dropping i...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.11.4
Platform: Neon Linux
: NOR crash
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2018-01-08 15:02 UTC by Dakota Sullivan
Modified: 2018-01-11 13:03 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.12.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dakota Sullivan 2018-01-08 15:02:34 UTC
Application: plasmashell (5.11.4)

Qt Version: 5.9.3
Frameworks Version: 5.41.0
Operating System: Linux 4.10.0-42-generic x86_64
Distribution: KDE neon User Edition 5.11

-- Information about the crash:
- What I was doing when the application crashed:

I had just taken a screenshot and was trying to drag-and-drop the image from the notification into Slack, but apparently I took too long and the notification timed out and disappeared, along with Plasma.

The crash can be reproduced every time.

-- Backtrace:
Application: Plasma (plasmashell), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f506d15a8c0 (LWP 2294))]

Thread 8 (Thread 0x7f4f9cde8700 (LWP 3015)):
#0  0x00007f5067144e0c in roundToMillisecond (val=...) at kernel/qtimerinfo_unix.cpp:210
#1  QTimerInfoList::timerWait (this=0x7f4f98002cd0, tm=...) at kernel/qtimerinfo_unix.cpp:405
#2  0x00007f506714643e in timerSourcePrepareHelper (timeout=0x7f4f9cde7af4, src=<optimized out>) at kernel/qeventdispatcher_glib.cpp:132
#3  timerSourcePrepare (source=<optimized out>, timeout=0x7f4f9cde7af4) at kernel/qeventdispatcher_glib.cpp:165
#4  0x00007f50616e491d in g_main_context_prepare () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f50616e52bb in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007f50616e549c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007f50671466cb in QEventDispatcherGlib::processEvents (this=0x7f4f980008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#8  0x00007f50670eee2a in QEventLoop::exec (this=this@entry=0x7f4f9cde7cc0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#9  0x00007f5066f178f4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:515
#10 0x00007f4f9f2c6517 in KCupsConnection::run() () from /usr/lib/x86_64-linux-gnu/libkcupslib.so
#11 0x00007f5066f1c709 in QThreadPrivate::start (arg=0x56b3e70) at thread/qthread_unix.cpp:368
#12 0x00007f5065dc36ba in start_thread (arg=0x7f4f9cde8700) at pthread_create.c:333
#13 0x00007f506682b3dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 7 (Thread 0x7f4fb340a700 (LWP 2566)):
#0  0x00007f506681f70d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007f50616e538c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f50616e549c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f50671466cb in QEventDispatcherGlib::processEvents (this=0x7f4fac0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#4  0x00007f50670eee2a in QEventLoop::exec (this=this@entry=0x7f4fb3409c90, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#5  0x00007f5066f178f4 in QThread::exec (this=this@entry=0x2b02eb0) at thread/qthread.cpp:515
#6  0x00007f506ac0e046 in QQuickPixmapReader::run (this=0x2b02eb0) at util/qquickpixmapcache.cpp:868
#7  0x00007f5066f1c709 in QThreadPrivate::start (arg=0x2b02eb0) at thread/qthread_unix.cpp:368
#8  0x00007f5065dc36ba in start_thread (arg=0x7f4fb340a700) at pthread_create.c:333
#9  0x00007f506682b3dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 6 (Thread 0x7f503e7a0700 (LWP 2447)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f506c8c5d04 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Script.so.5
#2  0x00007f506c8c5d49 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Script.so.5
#3  0x00007f5065dc36ba in start_thread (arg=0x7f503e7a0700) at pthread_create.c:333
#4  0x00007f506682b3dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 5 (Thread 0x7f504c972700 (LWP 2373)):
#0  0x00007f5061729a79 in g_mutex_lock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007f50616e5488 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f50671466cb in QEventDispatcherGlib::processEvents (this=0x7f50440008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#3  0x00007f50670eee2a in QEventLoop::exec (this=this@entry=0x7f504c971ce0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#4  0x00007f5066f178f4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:515
#5  0x00007f506a06ed25 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
#6  0x00007f5066f1c709 in QThreadPrivate::start (arg=0x21e5210) at thread/qthread_unix.cpp:368
#7  0x00007f5065dc36ba in start_thread (arg=0x7f504c972700) at pthread_create.c:333
#8  0x00007f506682b3dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 4 (Thread 0x7f504ebe6700 (LWP 2363)):
#0  0x00007f506681f70d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007f50616e538c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f50616e549c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f50671466cb in QEventDispatcherGlib::processEvents (this=0x7f50400008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#4  0x00007f50670eee2a in QEventLoop::exec (this=this@entry=0x7f504ebe5ce0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#5  0x00007f5066f178f4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:515
#6  0x00007f506a06ed25 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
#7  0x00007f5066f1c709 in QThreadPrivate::start (arg=0x2180c60) at thread/qthread_unix.cpp:368
#8  0x00007f5065dc36ba in start_thread (arg=0x7f504ebe6700) at pthread_create.c:333
#9  0x00007f506682b3dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7f504ffff700 (LWP 2326)):
#0  0x00007f506681f70d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007f50616e538c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f50616e549c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f50671466cb in QEventDispatcherGlib::processEvents (this=0x7f50480008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#4  0x00007f50670eee2a in QEventLoop::exec (this=this@entry=0x7f504fffecd0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#5  0x00007f5066f178f4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:515
#6  0x00007f50675c5315 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#7  0x00007f5066f1c709 in QThreadPrivate::start (arg=0x7f5067839d40) at thread/qthread_unix.cpp:368
#8  0x00007f5065dc36ba in start_thread (arg=0x7f504ffff700) at pthread_create.c:333
#9  0x00007f506682b3dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7f5056781700 (LWP 2308)):
#0  0x00007f506681f70d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007f506b815c62 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007f506b8178d7 in xcb_wait_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007f50588c61f9 in QXcbEventReader::run (this=0x20bfff0) at qxcbconnection.cpp:1330
#4  0x00007f5066f1c709 in QThreadPrivate::start (arg=0x20bfff0) at thread/qthread_unix.cpp:368
#5  0x00007f5065dc36ba in start_thread (arg=0x7f5056781700) at pthread_create.c:333
#6  0x00007f506682b3dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7f506d15a8c0 (LWP 2294)):
[KCrash Handler]
#6  0x00007f506711cc92 in QObjectPrivate::isSignalConnected (checkDeclarative=false, signal_index=9, this=<optimized out>) at kernel/qobject_p.h:259
#7  QMetaObject::activate (sender=0x903ff30, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=6, argv=argv@entry=0x0) at kernel/qobject.cpp:3647
#8  0x00007f506711db87 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7f506b124220 <QQuickDrag::staticMetaObject>, local_signal_index=local_signal_index@entry=6, argv=argv@entry=0x0) at kernel/qobject.cpp:3628
#9  0x00007f506ad8237d in QQuickDrag::activeChanged (this=<optimized out>) at .moc/moc_qquickdrag_p.cpp:460
#10 QQuickDrag::setActive (this=<optimized out>, drag=drag@entry=true) at items/qquickdrag.cpp:976
#11 0x00007f506ad57fff in QQuickMouseArea::mouseMoveEvent (this=0xdbf5330, event=0x7ffe9d511cb0) at items/qquickmousearea.cpp:732
#12 0x00007f506accc028 in QQuickItem::event (this=0xdbf5330, ev=0x7ffe9d511cb0) at items/qquickitem.cpp:7777
#13 0x00007f50680d9b9c in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0xdbf5330, e=0x7ffe9d511cb0) at kernel/qapplication.cpp:3722
#14 0x00007f50680e15a7 in QApplication::notify (this=0x7ffe9d5121a0, receiver=0xdbf5330, e=0x7ffe9d511cb0) at kernel/qapplication.cpp:3481
#15 0x00007f50670f0df8 in QCoreApplication::notifyInternal2 (receiver=receiver@entry=0xdbf5330, event=event@entry=0x7ffe9d511cb0) at kernel/qcoreapplication.cpp:1018
#16 0x00007f506acdce37 in QCoreApplication::sendEvent (event=0x7ffe9d511cb0, receiver=0xdbf5330) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qcoreapplication.h:233
#17 QQuickWindow::sendEvent (this=this@entry=0x5e25b30, item=item@entry=0xdbf5330, e=e@entry=0x7ffe9d511cb0) at items/qquickwindow.cpp:2850
#18 0x00007f506ace241f in QQuickWindowPrivate::deliverMouseEvent (this=this@entry=0x5e25c00, pointerEvent=0x5547530) at items/qquickwindow.cpp:1673
#19 0x00007f506ace2d15 in QQuickWindowPrivate::deliverPointerEvent (this=this@entry=0x5e25c00, event=0x5547530) at items/qquickwindow.cpp:2193
#20 0x00007f506ace377e in QQuickWindowPrivate::handleMouseEvent (this=0x5e25c00, event=0x7ffe9d511cb0) at items/qquickwindow.cpp:2083
#21 0x00007f5067977f15 in QWindow::event (this=this@entry=0x5e25b30, ev=ev@entry=0x7ffe9d511cb0) at kernel/qwindow.cpp:2267
#22 0x00007f506ace4e85 in QQuickWindow::event (this=this@entry=0x5e25b30, e=e@entry=0x7ffe9d511cb0) at items/qquickwindow.cpp:1610
#23 0x00007f506cbf5e3b in PlasmaQuick::Dialog::event (this=0x5e25b30, event=0x7ffe9d511cb0) at /workspace/build/src/plasmaquick/dialog.cpp:1307
#24 0x00007f50680d9b9c in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5e25b30, e=0x7ffe9d511cb0) at kernel/qapplication.cpp:3722
#25 0x00007f50680e15a7 in QApplication::notify (this=0x7ffe9d5121a0, receiver=0x5e25b30, e=0x7ffe9d511cb0) at kernel/qapplication.cpp:3481
#26 0x00007f50670f0df8 in QCoreApplication::notifyInternal2 (receiver=receiver@entry=0x5e25b30, event=event@entry=0x7ffe9d511cb0) at kernel/qcoreapplication.cpp:1018
#27 0x00007f506796b860 in QCoreApplication::sendSpontaneousEvent (event=0x7ffe9d511cb0, receiver=0x5e25b30) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#28 QGuiApplicationPrivate::processMouseEvent (e=0x8b51ce0) at kernel/qguiapplication.cpp:1949
#29 0x00007f506796d7c5 in QGuiApplicationPrivate::processWindowSystemEvent (e=e@entry=0x8b51ce0) at kernel/qguiapplication.cpp:1733
#30 0x00007f506794781b in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:939
#31 0x00007f5058925440 in userEventSourceDispatch (source=<optimized out>) at qeventdispatcher_glib.cpp:77
#32 0x00007f50616e5197 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007f50616e53f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#34 0x00007f50616e549c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#35 0x00007f50671466af in QEventDispatcherGlib::processEvents (this=0x20e4130, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#36 0x00007f50670eee2a in QEventLoop::exec (this=this@entry=0x7ffe9d512060, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#37 0x00007f50670f7d64 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1291
#38 0x000000000041cf5b in ?? ()
#39 0x00007f5066744830 in __libc_start_main (main=0x41c550, argc=1, argv=0x7ffe9d512348, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe9d512338) at ../csu/libc-start.c:291
#40 0x000000000041d2f9 in _start ()

Reported using DrKonqi
Comment 1 Kai Uwe Broulik 2018-01-08 15:12:24 UTC
There's code that prevents it from auto-closing while dragging but I can see a situation where it would still close.

If you have a notification shown ontop of the screenshot one, then the top one closes, the notification moves up and that restarts the timer and then it will close and blow up.
Comment 2 Dakota Sullivan 2018-01-08 15:19:19 UTC
I can trigger the crash without another notification showing up, but I am running three screens all which have notification widgets in their panels, and it doesn't matter which screen I drag from.
Comment 3 Kai Uwe Broulik 2018-01-08 15:32:35 UTC
Can you test a patch? https://phabricator.kde.org/D9735
Comment 4 Dakota Sullivan 2018-01-08 16:02:22 UTC
That did not fix the issue. I was able to modify /usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationPopup.qml and change the layout direction after restarting Plasma, but applying your changes appeared to have no effect.
Comment 5 Dakota Sullivan 2018-01-08 16:06:50 UTC
Something else to note is that the notification item disappears even while I have my mouse hovering on top of it.
Comment 6 Kai Uwe Broulik 2018-01-08 16:18:14 UTC
Okay, that is then very weird and shouldn't be. hmm.
Comment 7 Dakota Sullivan 2018-01-08 16:30:59 UTC
Using the layout direction for debugging I can confirm that the "onContainsMouseChanged" and "onDraggingChanged" event handlers and "containsMouse" and "dragging" variables are working as far as I can tell. The issue seems to be something inside the notificationTimer where it doesn't stop properly.
Comment 8 Dakota Sullivan 2018-01-08 21:55:24 UTC
I did some more testing and it turns out I can only cause this when I have two or more System Tray plasmoids. I am guessing it has something to do with duplicate timers, but I am pretty new to KDE so I don't know how to fix this.
Comment 9 Kai Uwe Broulik 2018-01-08 21:56:55 UTC
You are right, this makes absolute sense. The data engine is shared between all applet. Since there can only be one hovered popup at a time, it will eventually time out and signal deletion of the message which will close the popup regardless.
Comment 10 Kai Uwe Broulik 2018-01-09 10:27:52 UTC
I made a more elaborate patch that makes the applet's aware of each other being dragged: https://phabricator.kde.org/D9754
Comment 11 Kai Uwe Broulik 2018-01-11 13:02:21 UTC
Git commit 86fe986934742ea2a877bf8cb8393c6f0591ef58 by Kai Uwe Broulik.
Committed on 11/01/2018 at 13:01.
Pushed by broulik into branch 'master'.

[Notifications] Use custom DragHelper instead of Qt's Drag attached property

Qt's Drag attached property doesn't like it at all when it gets deleted during drag. (QTBUG-65701)
Even though we try very hard to keep the popup open, when you have multiple notification applets, their dialogs don't know each
other but access a shared data engine.

This means that, since there can only we one hovered dialog at a time, another notification applet might still dismiss the
notification and have our dialog close.

By using a singleton NotificationHelper we 1.) decouple the Drag from the item and 2.) share the "is dragging" state between applets.
FIXED-IN: 5.12.0

Differential Revision: https://phabricator.kde.org/D9754

M  +24   -15   applets/notifications/package/contents/ui/ThumbnailStrip.qml
M  +1    -0    applets/notifications/plugin/CMakeLists.txt
A  +84   -0    applets/notifications/plugin/draghelper.cpp     [License: GPL (v2+)]
A  +53   -0    applets/notifications/plugin/draghelper.h     [License: GPL (v2+)]
M  +10   -0    applets/notifications/plugin/notificationshelperplugin.cpp

https://commits.kde.org/plasma-workspace/86fe986934742ea2a877bf8cb8393c6f0591ef58
Comment 12 Kai Uwe Broulik 2018-01-11 13:03:52 UTC
Git commit ade1817522f62cf7f7d552e9954ba5eb8faa9c0b by Kai Uwe Broulik.
Committed on 11/01/2018 at 13:03.
Pushed by broulik into branch 'master'.

[Notifications] Don't restart hide timer on reposition while dragging

We checked for dragging in onContainsMouseChanged but not here.

Differential Revision: https://phabricator.kde.org/D9735

M  +1    -1    applets/notifications/package/contents/ui/NotificationPopup.qml

https://commits.kde.org/plasma-workspace/ade1817522f62cf7f7d552e9954ba5eb8faa9c0b