Bug 428232 - Plasma crashes when dragging files on the desktop
Summary: Plasma crashes when dragging files on the desktop
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Folder (show other bugs)
Version: master
Platform: Other Linux
: NOR crash
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords:
: 400369 431458 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-10-25 14:38 UTC by Vlad Zahorodnii
Modified: 2021-08-29 21:32 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
the backtrace of the crash (19.58 KB, text/plain)
2020-10-25 14:38 UTC, Vlad Zahorodnii
Details
icon layout on my desktop (485.64 KB, image/png)
2020-10-25 14:40 UTC, Vlad Zahorodnii
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vlad Zahorodnii 2020-10-25 14:38:39 UTC
Created attachment 132727 [details]
the backtrace of the crash

SUMMARY
If icons are arranged in columns and one of the icons is dragged left and then right, plasma will crash.

STEPS TO REPRODUCE
1. Arrange icons on the desktop in columns
2. Drag any icon horizontally several times

OBSERVED RESULT
plasmashell hits an assert in QAbstractItemModel::beginRemoveRows()

EXPECTED RESULT
No crash

ADDITIONAL INFORMATION
Judging by the source code of Positioner::move(), the problem is that plasma removes rows and then notifies QAbstractItemModel about the removal.
Comment 1 Vlad Zahorodnii 2020-10-25 14:40:29 UTC
Created attachment 132728 [details]
icon layout on my desktop

I can easily reproduce this crash by dragging the trash icon somewhere left, and then dragging it back to the original position.
Comment 2 Vlad Zahorodnii 2020-10-25 14:46:10 UTC
Currently, I work around this crash by commenting out `Q_ASSERT(last < rowCount(parent));` in QAbstractItemModel::beginRemoveRows().
Comment 3 Vlad Zahorodnii 2021-01-02 19:16:35 UTC
Another way to crash plasma:

Download a video from youtube using youtube-dl while the current working directory is ~/Desktop.
Comment 4 David Edmundson 2021-01-02 19:25:23 UTC
Pasting a snippet inline for future searching.

    frame #3: 0x00007ffff406a890 libQt5Core.so.5`QMessageLogger::fatal(this=0x00007fffffff1ab0, msg="ASSERT: \"%s\" in file %s, line %d") const at qlogging.cpp:893:21
    frame #4: 0x00007ffff40612c0 libQt5Core.so.5`qt_assert(assertion="last < rowCount(parent)", file="itemmodels/qabstractitemmodel.cpp", line=2815) at qglobal.cpp:3358:46
    frame #5: 0x00007ffff4285e1f libQt5Core.so.5`QAbstractItemModel::beginRemoveRows(this=0x0000555555a71f40, parent=0x00007fffffff1c10, first=3, last=82) at qabstractitemmodel.cpp:2815:5
    frame #6: 0x00007fff973ada5f libfolderplugin.so`Positioner::move(this=0x0000555555a71f40, moves=0x00007fffffff1f38) at positioner.cpp:448:24
    frame #7: 0x00007fff9736f43c libfolderplugin.so`Positioner::qt_static_metacall(_o=0x0000555555a71f40, _c=InvokeMetaMethod, _id=23, _a=0x00007fffffff1eb0) at moc_positioner.cpp:243:26
    frame #8: 0x00007fff9736f911 libfolderplugin.so`Positioner::qt_metacall(this=0x0000555555a71f40, _c=InvokeMetaMethod, _id=23, _a=0x00007fffffff1eb0) at moc_positioner.cpp:346:31
Comment 5 Nate Graham 2021-02-23 05:02:00 UTC
*** Bug 400369 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2021-02-23 05:02:23 UTC
*** Bug 431458 has been marked as a duplicate of this bug. ***