Bug 373005 - Dolphin crashes when dragging unused device somewhere
Summary: Dolphin crashes when dragging unused device somewhere
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: panels: places (show other bugs)
Version: 16.08.3
Platform: openSUSE Linux
: NOR minor
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL: https://phabricator.kde.org/D5535
Keywords:
: 372242 378370 378954 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-11-27 21:38 UTC by Sascha Zenglein
Modified: 2017-06-11 17:31 UTC (History)
6 users (show)

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


Attachments
Debug information from dolphin crash (5.43 KB, text/plain)
2016-11-28 16:54 UTC, Kishore Gopalakrishnan
Details
Debug information from crash (6.40 KB, text/plain)
2016-11-28 19:18 UTC, Kishore Gopalakrishnan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha Zenglein 2016-11-27 21:38:03 UTC
If dragging a device that is unused from the (normally left) side panel into some folder, dolphin crashes. 
Dolphin should either mount to the dragged directory or tell the user that it's not possible.
Comment 1 Kishore Gopalakrishnan 2016-11-28 16:54:55 UTC
Created attachment 102505 [details]
Debug information from dolphin crash
Comment 2 Kishore Gopalakrishnan 2016-11-28 16:57:07 UTC
(In reply to kishore96 from comment #1)
> Created attachment 102505 [details]
> Debug information from dolphin crash

Was able to reproduce with dolphin version 16.08.3 on Arch Linux.

PS: Sorry for messing up this thread. I'm a bit unfamiliar with the interface.
Comment 3 Kishore Gopalakrishnan 2016-11-28 19:18:53 UTC
Created attachment 102508 [details]
Debug information from crash

The previous attachment was when I was missing some debug information. This attachment contains a more complete trace, after I compiled the required packages with debug symbols.
Comment 4 Christoph Feck 2016-11-30 15:09:51 UTC
This could be a crash in QMimeData.

Application: Dolphin (dolphin), signal: Segmentation fault
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fac36846800 (LWP 2854))]

Thread 6 (Thread 0x7fac0d0d3700 (LWP 2859)):
#0  0x00007fac297b40ca in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#1  0x00007fac297b4724 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007fac297b489c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007fac302d980b in QEventDispatcherGlib::processEvents (this=0x7fac080008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#4  0x00007fac30280b12 in QEventLoop::exec (this=this@entry=0x7fac0d0d2dc0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:210
#5  0x00007fac300c049e in QThread::exec (this=<optimized out>) at thread/qthread.cpp:507
#6  0x00007fac300c5d5d in QThreadPrivate::start (arg=0x13f4c30) at thread/qthread_unix.cpp:344
#7  0x00007fac2b8ef454 in start_thread () from /usr/lib/libpthread.so.0
#8  0x00007fac3618f7df in clone () from /usr/lib/libc.so.6

Thread 5 (Thread 0x7fac15995700 (LWP 2858)):
#0  0x00007fac2b8f510f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007fac16f51ec3 in ?? () from /usr/lib/xorg/modules/dri/swrast_dri.so
#2  0x00007fac16f51d27 in ?? () from /usr/lib/xorg/modules/dri/swrast_dri.so
#3  0x00007fac2b8ef454 in start_thread () from /usr/lib/libpthread.so.0
#4  0x00007fac3618f7df in clone () from /usr/lib/libc.so.6

Thread 4 (Thread 0x7fac16196700 (LWP 2857)):
#0  0x00007fac2b8f510f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007fac16f51ec3 in ?? () from /usr/lib/xorg/modules/dri/swrast_dri.so
#2  0x00007fac16f51d27 in ?? () from /usr/lib/xorg/modules/dri/swrast_dri.so
#3  0x00007fac2b8ef454 in start_thread () from /usr/lib/libpthread.so.0
#4  0x00007fac3618f7df in clone () from /usr/lib/libc.so.6

Thread 3 (Thread 0x7fac1cf51700 (LWP 2856)):
#0  0x00007fac3618648d in poll () from /usr/lib/libc.so.6
#1  0x00007fac297b4786 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007fac297b489c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007fac302d980b in QEventDispatcherGlib::processEvents (this=0x7fac100008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#4  0x00007fac30280b12 in QEventLoop::exec (this=this@entry=0x7fac1cf50d90, flags=..., flags@entry=...) at kernel/qeventloop.cpp:210
#5  0x00007fac300c049e in QThread::exec (this=this@entry=0x7fac3097fd40 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread.cpp:507
#6  0x00007fac306fc275 in QDBusConnectionManager::run (this=0x7fac3097fd40 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:196
#7  0x00007fac300c5d5d in QThreadPrivate::start (arg=0x7fac3097fd40 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:344
#8  0x00007fac2b8ef454 in start_thread () from /usr/lib/libpthread.so.0
#9  0x00007fac3618f7df in clone () from /usr/lib/libc.so.6

Thread 2 (Thread 0x7fac1ed11700 (LWP 2855)):
#0  0x00007fac3618648d in poll () from /usr/lib/libc.so.6
#1  0x00007fac28eeb8e0 in ?? () from /usr/lib/libxcb.so.1
#2  0x00007fac28eed679 in xcb_wait_for_event () from /usr/lib/libxcb.so.1
#3  0x00007fac21065889 in QXcbEventReader::run (this=0x10411b0) at qxcbconnection.cpp:1337
#4  0x00007fac300c5d5d in QThreadPrivate::start (arg=0x10411b0) at thread/qthread_unix.cpp:344
#5  0x00007fac2b8ef454 in start_thread () from /usr/lib/libpthread.so.0
#6  0x00007fac3618f7df in clone () from /usr/lib/libc.so.6

Thread 1 (Thread 0x7fac36846800 (LWP 2854)):
[KCrash Handler]
#6  0x00007fac302a91a6 in QMimeDataPrivate::retrieveTypedData (this=0x152c830, format=..., type=type@entry=QVariant::ByteArray) at kernel/qmimedata.cpp:112
#7  0x00007fac302aa38d in QMimeData::data (this=<optimized out>, mimeType=...) at kernel/qmimedata.cpp:560
#8  0x00007fac349c9ea1 in KIO::isClipboardDataCut (mimeData=<optimized out>) at /home/kishore/Downloads/kio/src/kio-5.28.0/src/widgets/paste.cpp:355
#9  0x00007fac349f077e in KIO::PasteJobPrivate::slotStart (this=0x15613d0) at /home/kishore/Downloads/kio/src/kio-5.28.0/src/widgets/pastejob.cpp:55
#10 0x00007fac349f0b11 in KIO::PasteJob::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /home/kishore/Downloads/kio/src/build/src/widgets/moc_pastejob.cpp:95
#11 0x00007fac302b06d9 in QObject::event (this=0x152c4d0, e=<optimized out>) at kernel/qobject.cpp:1263
#12 0x00007fac311f4fc4 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x152c4d0, e=0x156ca90) at kernel/qapplication.cpp:3799
#13 0x00007fac311fcb70 in QApplication::notify (this=0x7fff3a447c70, receiver=0x152c4d0, e=0x156ca90) at kernel/qapplication.cpp:3159
#14 0x00007fac3028241a in QCoreApplication::notifyInternal2 (receiver=0x152c4d0, event=event@entry=0x156ca90) at kernel/qcoreapplication.cpp:988
#15 0x00007fac30285166 in QCoreApplication::sendEvent (event=0x156ca90, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#16 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x1022fa0) at kernel/qcoreapplication.cpp:1649
#17 0x00007fac302856b8 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1503
#18 0x00007fac302d9773 in postEventSourceDispatch (s=0x106c780) at kernel/qeventdispatcher_glib.cpp:276
#19 0x00007fac297b4587 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#20 0x00007fac297b47f0 in ?? () from /usr/lib/libglib-2.0.so.0
#21 0x00007fac297b489c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#22 0x00007fac302d97ef in QEventDispatcherGlib::processEvents (this=0x10732d0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#23 0x00007fac30280b12 in QEventLoop::exec (this=this@entry=0x7fff3a4478e0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:210
#24 0x00007fac302896fc in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1261
#25 0x00007fac30a78d6c in QGuiApplication::exec () at kernel/qguiapplication.cpp:1639
#26 0x00007fac311f4f15 in QApplication::exec () at kernel/qapplication.cpp:2975
#27 0x00007fac364a70d5 in kdemain (argc=<optimized out>, argv=<optimized out>) at /home/kishore/Downloads/dolphin/src/dolphin-16.08.3/src/main.cpp:150
#28 0x00007fac360c7291 in __libc_start_main () from /usr/lib/libc.so.6
#29 0x000000000040066a in _start ()
Comment 5 Elvis Angelaccio 2016-12-24 14:26:38 UTC
*** Bug 372242 has been marked as a duplicate of this bug. ***
Comment 6 Elvis Angelaccio 2017-04-21 16:39:56 UTC
*** Bug 378370 has been marked as a duplicate of this bug. ***
Comment 7 Elvis Angelaccio 2017-04-21 16:40:44 UTC
*** Bug 378954 has been marked as a duplicate of this bug. ***
Comment 8 Elvis Angelaccio 2017-04-21 16:41:46 UTC
https://phabricator.kde.org/D5535
Comment 9 Elvis Angelaccio 2017-06-11 17:31:24 UTC
Git commit c85ca114553c198af79eedacdb6b40ac4cab20e0 by Elvis Angelaccio.
Committed on 11/06/2017 at 17:11.
Pushed by elvisangelaccio into branch 'Applications/17.04'.

Ignore drops-onto-items from invalid places items

If the QMimeData object created by PlacesItemModel doesn't have any url
set (e.g. when dragging unmounted devices), it is detected by the
resulting DropJob as "drop raw data" because the mimeData has one format set
(the internalMimeType() used for dragging between places items).

This results in a crash because the DropJob schedules a PasteJob, but in
the meantime the QDrag from Dolphin ends and deletes the mimeData object
that was passed to the paste job.

The fix is to prevent the DropJob in the first place. We can introduce a
new internal mimetype that we use to blacklist drops-onto-items (while
still allowing drops-between-items). This way PlacesItemModel can set
the blacklist flag if the mimeData is being created without urls.
FIXED-IN: 17.04.3

Test Plan:
Drag and drop an unmounted device to another place item or the DolphinView, doesn't crash anymore.
Dropping the unmounted device between two places item still works.

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

M  +1    -1    src/kitemviews/kitemlistcontroller.cpp
M  +5    -0    src/kitemviews/kitemmodelbase.cpp
M  +10   -0    src/kitemviews/kitemmodelbase.h
M  +3    -0    src/panels/places/placesitemmodel.cpp

https://commits.kde.org/dolphin/c85ca114553c198af79eedacdb6b40ac4cab20e0