Bug 508185

Summary: Plasma crashes when dragging .desktop file from ~/.local/applications/ to desktop
Product: [Plasma] plasmashell Reporter: Nate Graham <nate>
Component: Desktop icons & Folder View widgetAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: akselmo, hein, kde
Priority: HI    
Version First Reported In: 6.4.80   
Target Milestone: 1.0   
Platform: KDE Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.18
Sentry Crash Report:
Attachments: .desktop file

Description Nate Graham 2025-08-13 03:29:59 UTC
Created attachment 184023 [details]
.desktop file

STEPS TO REPRODUCE
1. Put the attached .desktop file in ~/.local/share/applications/
2. Run `kbuildsycoca6`
3. Drag the .desktop file to the actual desktop


OBSERVED RESULT
Plasma crashes. 100% reproducible for me. Backtrace:

Thread 1 (Thread 0x7f9fa390aa80 (LWP 1805)):
[KCrash Handler]
#4  std::__uniq_ptr_impl<KMountPointPrivate, std::default_delete<KMountPointPrivate> >::_M_ptr (this=0x8) at /usr/include/c++/15.1.1/bits/unique_ptr.h:193
#5  std::unique_ptr<KMountPointPrivate, std::default_delete<KMountPointPrivate> >::get (this=0x8) at /usr/include/c++/15.1.1/bits/unique_ptr.h:473
#6  std::unique_ptr<KMountPointPrivate, std::default_delete<KMountPointPrivate> >::operator-> (this=0x8) at /usr/include/c++/15.1.1/bits/unique_ptr.h:466
#7  KMountPoint::mountedFrom (this=0x0) at /usr/src/debug/kde-banana-kio-git/kio/src/core/kmountpoint.cpp:400
#8  0x00007f9fa8beb41a in KIO::DropJobPrivate::handleCopyToDirectory (this=0x5650e0433c80) at /usr/include/qt6/QtCore/qcomparehelpers.h:1100
#9  0x00007f9fa95bbe34 in QObject::event (this=<optimized out>, e=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:1431
#10 0x00007f9fab5ebc70 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5650dc50f5f0, e=0x5650dfdf87f0) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3303
#11 0x00007f9fa9563118 in QCoreApplication::notifyInternal2 (receiver=0x5650dc50f5f0, event=event@entry=0x5650dfdf87f0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1106
#12 0x00007f9fa95634fb in QCoreApplication::sendEvent (receiver=<optimized out>, event=0x5650dfdf87f0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1546
#13 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x5650d9f070f0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1879
#14 0x00007f9fa983acf8 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1733
#15 postEventSourceDispatch (s=0x5650d9f15950) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:246
#16 0x00007f9fa81b987d in g_main_dispatch (context=0x7f9f9c000f70) at ../glib/glib/gmain.c:3398
#17 0x00007f9fa81bacd7 in g_main_context_dispatch_unlocked (context=0x7f9f9c000f70) at ../glib/glib/gmain.c:4249
#18 g_main_context_iterate_unlocked (context=context@entry=0x7f9f9c000f70, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4314
#19 0x00007f9fa81baee5 in g_main_context_iteration (context=0x7f9f9c000f70, may_block=1) at ../glib/glib/gmain.c:4379
#20 0x00007f9fa98375e2 in QEventDispatcherGlib::processEvents (this=0x5650d9f163d0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#21 0x00007f9fa956f4b6 in QEventLoop::processEvents (this=0x7ffddd2ac480, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:104
#22 QEventLoop::exec (this=0x7ffddd2ac480, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:186
#23 0x00007f9fa95677c1 in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1449
#24 0x000056509fb272c1 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kde-banana-plasma-workspace-git/plasma-workspace/shell/main.cpp:188


EXPECTED RESULT
No crash!


ADDITIONAL INFORMATION
If I drag it to the desktop in another way (the Desktop places panel item, or the ~/Desktop folder in Dolphin), there's no crash.


SOFTWARE/OS VERSIONS
Operating System: KDE Linux 2025-08-12
KDE Plasma Version: 6.4.80
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.1
Kernel Version: 6.15.9-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7840U w/ Radeon™ 780M Graphics
Memory: 16 GiB of RAM (14.9 GiB usable)
Graphics Processor: AMD Radeon 780M Graphics
Comment 1 Akseli Lahtinen 2025-08-15 11:19:05 UTC
I can't get this crash to happen. Do you copy, link or move it?
Comment 2 Akseli Lahtinen 2025-08-15 11:20:10 UTC
(In reply to Akseli Lahtinen from comment #1)
> I can't get this crash to happen. Do you copy, link or move it?

I tried all three but no crash.
Comment 3 Nate Graham 2025-08-15 13:44:36 UTC
For me it crashes before the menu is even shown.

David E tracked it down, and it's fixed/worked around with https://invent.kde.org/frameworks/kio/-/merge_requests/1975.

The fact that it's mount-related may reveal that this is a problem specific to KDE Linux. This OS has some non-traditional mounts for its filesystem layout.
Comment 4 David Edmundson 2025-08-26 10:57:07 UTC
Git commit a8d2aaa1a8a9de8890c95b721a69b15886b50cd4 by David Edmundson.
Committed on 26/08/2025 at 10:57.
Pushed by davidedmundson into branch 'master'.

guard mount point lookup

Looking up a mount point for a path can fail. We should take care.

A check later that sourceDevice is valid is also adjusted as comparing two empty mount points should not be treated as the same device.

M  +15   -3    src/widgets/dropjob.cpp

https://invent.kde.org/frameworks/kio/-/commit/a8d2aaa1a8a9de8890c95b721a69b15886b50cd4