Bug 430441 - Dolphin 20.12.0 segmentation faults when trying to drag mounted partition in Places panel
Summary: Dolphin 20.12.0 segmentation faults when trying to drag mounted partition in ...
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: panels: places (show other bugs)
Version: 20.12.0
Platform: Mageia RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Chris Holland
URL:
Keywords:
: 430350 430519 430770 431179 431670 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-12-15 19:09 UTC by Aurélien Oudelet (auroud85_fr)
Modified: 2021-01-16 14:50 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In: 20.12.1


Attachments
Log file from journalctl when reproducing Dolphin segfault (2.41 KB, text/x-log)
2020-12-15 19:09 UTC, Aurélien Oudelet (auroud85_fr)
Details
Dolphin new disk usage bar in Places panel (67.83 KB, image/png)
2020-12-15 19:10 UTC, Aurélien Oudelet (auroud85_fr)
Details
New crash information added by DrKonqi (11.49 KB, text/plain)
2020-12-23 13:25 UTC, Rakin Rahman
Details
attachment-32599-0.html (1.29 KB, text/html)
2020-12-24 18:17 UTC, Rakin Rahman
Details
New crash information added by DrKonqi (7.10 KB, text/plain)
2020-12-30 08:23 UTC, Raúl
Details
New crash information added by DrKonqi (12.06 KB, text/plain)
2021-01-01 18:36 UTC, fapasv
Details
New crash information added by DrKonqi (10.33 KB, text/plain)
2021-01-04 12:45 UTC, nodo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aurélien Oudelet (auroud85_fr) 2020-12-15 19:09:09 UTC
Created attachment 134101 [details]
Log file from journalctl when reproducing Dolphin segfault

SUMMARY
Dolphin by default shows now Disk usage bar. (See attached screenshot.)
Browsing through directory/files is OK.
Click everywhere on UI is OK

But, in Places panel:
Dolphin 20.12.0 segfaults when I want to drag-drop mounted disk-partitions listed in left bar.

See attached reproducible segfault in a log attached.

STEPS TO REPRODUCE
1. Open Dolphin
2. Try to drag and drop (rearrange order) by click on a item (root partition for example) and move mouse cursor while hold click on the selected mounted linux partitions.
3. Observe a segfault. Dolphin unexpectedly quits.

OBSERVED RESULT
Segmentation fault:
kernel: dolphin[5413]: segfault at 10 ip 00007f880ff3e457 sp 00007fff993a1410 error 4 in libkdeinit5_dolphin.so[7f880ff10000+69000]
kernel: Code: 2f af fe ff 48 85 db 0f 84 fe fe ff ff 4c 89 e7 4c 8d 74 24 40 e8 99 6c fd ff 48 8b 45 00 48 89 ee 4c 89 ff ff 90 78 01 00 00 <41> 8b 4d 10 66 0f ef d2 41 8b 45 18 f2 0f 10 0b 66 0f ef c0 4c 89

EXPECTED RESULT
Arrange mounted partitions in Places panel.
Note that the workaround functions well: to manually rearrange mounted disk-partitions listed by Dolphin, use Open/Save dialog from a Plasma application like Kate/Kwrite, Select Files => Save. In opened dialog, you can rearrange mounted disk-partitions without segfault.

SOFTWARE/OS VERSIONS
Operating System: Mageia 8
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.2
Kernel Version: 5.10.1-desktop-1.mga8
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-6600K CPU @ 3.50GHz
Memory: 15.6 Gio of RAM
Graphics Processor: GeForce GTX 1660 Ti/PCIe/SSE2

ADDITIONAL INFORMATION
This affects many users of our distribution Mageia 8, actually in Beta 2 stage, see downstream bug report here:
https://bugs.mageia.org/show_bug.cgi?id=27819
Comment 1 Aurélien Oudelet (auroud85_fr) 2020-12-15 19:10:08 UTC
Created attachment 134102 [details]
Dolphin new disk usage bar in Places panel
Comment 2 Aurélien Oudelet (auroud85_fr) 2020-12-15 19:35:47 UTC
This appears after we added Dolphin 20.12.0 as this https://bugs.kde.org/show_bug.cgi?id=315405 was resolved.
Comment 3 Elvis Angelaccio 2020-12-15 22:08:11 UTC
Confirmed, thanks for the report. It crashes as soon as you try to drag the root place item.

Valgrind log:

==10475== Invalid read of size 4
==10475==    at 0x48FFC6C: QRect::top() const (qrect.h:206)
==10475==    by 0x48FF3CF: PlacesItemListWidget::paint(QPainter*, QStyleOptionGraphicsItem const*, QWidget*) (placesitemlistwidget.cpp:116)
==10475==    by 0x4AEC091: KItemListWidget::createDragPixmap(QStyleOptionGraphicsItem const*, QWidget*) (kitemlistwidget.cpp:370)
==10475==    by 0x4AF6E93: KStandardItemListWidget::createDragPixmap(QStyleOptionGraphicsItem const*, QWidget*) (kstandarditemlistwidget.cpp:550)
==10475==    by 0x4AD2D7E: KItemListView::createDragPixmap(KItemSet const&) const (kitemlistview.cpp:629)
==10475==    by 0x4AC2921: KItemListController::startDragging() (kitemlistcontroller.cpp:1273)
==10475==    by 0x4AC25D8: KItemListController::mouseMoveEvent(QGraphicsSceneMouseEvent*, QTransform const&) (kitemlistcontroller.cpp:592)
==10475==    by 0x4AC5329: KItemListController::processEvent(QEvent*, QTransform const&) (kitemlistcontroller.cpp:1110)
==10475==    by 0x4AD4527: KItemListView::event(QEvent*) (kitemlistview.cpp:937)
==10475==    by 0x63FA751: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.15.2)
==10475==    by 0x73C0A79: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/libQt5Core.so.5.15.2)
==10475==    by 0x67205D5: ??? (in /usr/lib/libQt5Widgets.so.5.15.2)
==10475==  Address 0x14 is not stack'd, malloc'd or (recently) free'd
Comment 4 Aurélien Oudelet (auroud85_fr) 2020-12-15 22:13:02 UTC
Note that this applies to all mounted partitions, not only the root (/) one.
Comment 5 Chris Holland 2020-12-18 00:01:10 UTC
Was able to quickly reproduce in the release/20.12 branch.

    [KCrash Handler]
    #4  0x00007f40709b9e70 in QRect::width (this=0x10) at /usr/include/qt/QtCore/qrect.h:266
    #5  0x00007f40709d642f in PlacesItemListWidget::paint (this=0x55e69f8e1a90, painter=0x7fffe660e4c0, option=0x0, widget=0x55e69f73be10) at /home/chris/Code/kde/dolphin/src/panels/places/placesitemlistwidget.cpp:118
    #6  0x00007f4070836883 in KItemListWidget::createDragPixmap (this=0x55e69f8e1a90, option=0x0, widget=0x55e69f73be10) at /home/chris/Code/kde/dolphin/src/kitemviews/kitemlistwidget.cpp:370
    #7  0x00007f4070840112 in KStandardItemListWidget::createDragPixmap (this=0x55e69f8e1a90, option=0x0, widget=0x55e69f73be10) at /home/chris/Code/kde/dolphin/src/kitemviews/kstandarditemlistwidget.cpp:550
    #8  0x00007f407081e5e7 in KItemListView::createDragPixmap (this=0x55e69f82e230, indexes=...) at /home/chris/Code/kde/dolphin/src/kitemviews/kitemlistview.cpp:628
    #9  0x00007f4070813763 in KItemListController::startDragging (this=0x55e69f801750) at /home/chris/Code/kde/dolphin/src/kitemviews/kitemlistcontroller.cpp:1264
    #10 0x00007f4070810b22 in KItemListController::mouseMoveEvent (this=0x55e69f801750, event=0x7fffe660ebf0, transform=...) at /home/chris/Code/kde/dolphin/src/kitemviews/kitemlistcontroller.cpp:598
    #11 0x00007f4070812ae7 in KItemListController::processEvent (this=0x55e69f801750, event=0x7fffe660ebf0, transform=...) at /home/chris/Code/kde/dolphin/src/kitemviews/kitemlistcontroller.cpp:1104

Weird, option=0x0. So QStyleOptionGraphicsItem* option is null. So it's breaking when I try to calculate the size of the capacitybar.

    QRect capacityRect(
        textInfo->pos.x(),
        option->rect.top() + option->rect.height() - CAPACITYBAR_HEIGHT - CAPACITYBAR_MARGIN,
        qMin((qreal)option->rect.width(), selectionRect().width()) - (textInfo->pos.x() - option->rect.left()),
        CAPACITYBAR_HEIGHT
    );

I wasn't aware that it could be null:
https://doc.qt.io/archives/qt-4.8/qgraphicswidget.html#paint
https://doc.qt.io/archives/qt-4.8/qgraphicsitem.html#paint

I can easily check if option is null with `if (m_drawCapacityBar && option)`, it won't draw the capacitybar in the drag though.

    // We check if option=nullptr since it is null when the place is dragged.
    // https://bugs.kde.org/show_bug.cgi?id=430441
    if (m_drawCapacityBar && option) {
Comment 6 Bug Janitor Service 2020-12-18 00:18:14 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/146
Comment 7 Chris Holland 2020-12-18 00:32:37 UTC
*** Bug 430350 has been marked as a duplicate of this bug. ***
Comment 8 Aurélien Oudelet (auroud85_fr) 2020-12-18 10:28:52 UTC
Glad this gets fixed.
Comment 9 Chris Holland 2020-12-18 19:22:01 UTC
Git commit ef093154046f91a59bc7e0fe1f22b590f45a0b0b by Chris Holland.
Committed on 18/12/2020 at 00:10.
Pushed by ngraham into branch 'release/20.12'.

Fix crash when device with capacitybar is dragged

M  +2    -1    src/panels/places/placesitemlistwidget.cpp

https://invent.kde.org/system/dolphin/commit/ef093154046f91a59bc7e0fe1f22b590f45a0b0b
Comment 10 Rakin Rahman 2020-12-23 13:25:50 UTC
Created attachment 134286 [details]
New crash information added by DrKonqi

dolphin (20.12.0) using Qt 5.15.2

- What I was doing when the application crashed:
I was dragging mounted partition but suddenly its crashed... Whenever I do that, dolphin crashes..
Im running KDE Neon 5.20.4

-- Backtrace (Reduced):
#4  PlacesItemListWidget::paint (this=0x55aa3e4b5860, painter=0x7fff704c03e8, option=0x0, widget=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qrect.h:742
#5  0x00007f9085e7f9c1 in KItemListWidget::createDragPixmap (this=this@entry=0x55aa3e4b5860, option=0x0, widget=0x55aa3e3f3950) at ./src/kitemviews/kitemlistwidget.cpp:370
#6  0x00007f9085e8b4ab in KStandardItemListWidget::createDragPixmap (this=0x55aa3e4b5860, option=<optimized out>, widget=<optimized out>) at ./src/kitemviews/kstandarditemlistwidget.cpp:550
#7  0x00007f9085e7a6b7 in KItemListView::createDragPixmap (this=0x55aa3e3ddc50, indexes=...) at ./src/kitemviews/kitemlistview.cpp:629
#8  0x00007f9085e6b659 in KItemListController::startDragging (this=this@entry=0x55aa3e3edda0) at ./src/kitemviews/kitemlistcontroller.cpp:1273
Comment 11 Chris Holland 2020-12-23 14:30:20 UTC
The bug has been fixed and will be released in KDE Apps / Dolphin v20.12.1 which is scheduled to be released January 7, 2021. KDE Neon should package the release for you to update to it shortly afterwards.

https://community.kde.org/Schedules/release_service/20.12_Release_Schedule#Thursday.2C_January_7.2C_2021:_release_service_20.12.1_release
Comment 12 Rakin Rahman 2020-12-24 18:17:11 UTC
Created attachment 134314 [details]
attachment-32599-0.html

Thank u sooooo much for your help!!!!

On Wed, Dec 23, 2020 at 8:30 PM Chris Holland <bugzilla_noreply@kde.org>
wrote:

> https://bugs.kde.org/show_bug.cgi?id=430441
>
> --- Comment #11 from Chris Holland <zrenfire@gmail.com> ---
> The bug has been fixed and will be released in KDE Apps / Dolphin v20.12.1
> which is scheduled to be released January 7, 2021. KDE Neon should package
> the
> release for you to update to it shortly afterwards.
>
>
> https://community.kde.org/Schedules/release_service/20.12_Release_Schedule#Thursday.2C_January_7.2C_2021:_release_service_20.12.1_release
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 13 Elvis Angelaccio 2020-12-28 20:36:18 UTC
*** Bug 430519 has been marked as a duplicate of this bug. ***
Comment 14 Elvis Angelaccio 2020-12-28 21:25:18 UTC
*** Bug 430770 has been marked as a duplicate of this bug. ***
Comment 15 Raúl 2020-12-30 08:23:55 UTC
Created attachment 134396 [details]
New crash information added by DrKonqi

dolphin (20.12.0) using Qt 5.15.2

- What I was doing when the application crashed:

I just drag a mounted partition in places panel.

-- Backtrace (Reduced):
#4  QRect::width (this=0x10) at /usr/include/qt5/QtCore/qrect.h:266
#5  PlacesItemListWidget::paint (this=0x55aa63bba2d0, painter=0x7ffdae21e188, option=0x0, widget=<optimized out>) at /usr/src/debug/dolphin-20.12.0-2.1.x86_64/src/panels/places/placesitemlistwidget.cpp:117
#6  0x00007f0bb2871bfd in KItemListWidget::createDragPixmap (this=this@entry=0x55aa63bba2d0, option=0x0, widget=0x55aa639ab150) at /usr/src/debug/dolphin-20.12.0-2.1.x86_64/src/kitemviews/kitemlistwidget.cpp:370
#7  0x00007f0bb2871d67 in KStandardItemListWidget::createDragPixmap (this=0x55aa63bba2d0, option=<optimized out>, widget=<optimized out>) at /usr/src/debug/dolphin-20.12.0-2.1.x86_64/src/kitemviews/kstandarditemlistwidget.cpp:550
#8  0x00007f0bb2859c74 in KItemListView::createDragPixmap (this=<optimized out>, indexes=...) at /usr/src/debug/dolphin-20.12.0-2.1.x86_64/src/kitemviews/kitemlistview.cpp:629
Comment 16 fapasv 2021-01-01 18:36:45 UTC
Created attachment 134441 [details]
New crash information added by DrKonqi

dolphin (20.12.0) using Qt 5.15.2

- What I was doing when the application crashed:
Drag mounted partitions on place panel dolphin crask

-- Backtrace (Reduced):
#4  PlacesItemListWidget::paint (this=0x55890b862c70, painter=0x7ffe57464518, option=0x0, widget=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qrect.h:742
#5  0x00007fd1e46799c1 in KItemListWidget::createDragPixmap (this=this@entry=0x55890b862c70, option=0x0, widget=0x55890b791f30) at ./src/kitemviews/kitemlistwidget.cpp:370
#6  0x00007fd1e46854ab in KStandardItemListWidget::createDragPixmap (this=0x55890b862c70, option=<optimized out>, widget=<optimized out>) at ./src/kitemviews/kstandarditemlistwidget.cpp:550
#7  0x00007fd1e46746b7 in KItemListView::createDragPixmap (this=0x55890b77e7c0, indexes=...) at ./src/kitemviews/kitemlistview.cpp:629
#8  0x00007fd1e4665659 in KItemListController::startDragging (this=this@entry=0x55890b78cfb0) at ./src/kitemviews/kitemlistcontroller.cpp:1273
Comment 17 nodo 2021-01-04 12:45:32 UTC
Created attachment 134534 [details]
New crash information added by DrKonqi

dolphin (20.12.0) using Qt 5.15.2

- What I was doing when the application crashed:

I had done as was stated in the bug report this one was attached to, attemtping to rearrange mounted places causes a exception that results in Dolphin crashing instantly.

Further Remarks:

OS is originally KDE Neon, but remixed personally. I cannot recall the appropriate version number, but it was built around October 2020 with the latest User Edition KDE Neon ISO.

-- Backtrace (Reduced):
#4  PlacesItemListWidget::paint (this=0x5637b99829b0, painter=0x7ffe44d41b08, option=0x0, widget=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qrect.h:742
#5  0x00007f55d48ed9c1 in KItemListWidget::createDragPixmap (this=this@entry=0x5637b99829b0, option=0x0, widget=0x5637b9c03b90) at ./src/kitemviews/kitemlistwidget.cpp:370
#6  0x00007f55d48f94ab in KStandardItemListWidget::createDragPixmap (this=0x5637b99829b0, option=<optimized out>, widget=<optimized out>) at ./src/kitemviews/kstandarditemlistwidget.cpp:550
#7  0x00007f55d48e86b7 in KItemListView::createDragPixmap (this=0x5637b9d3b060, indexes=...) at ./src/kitemviews/kitemlistview.cpp:629
#8  0x00007f55d48d9659 in KItemListController::startDragging (this=this@entry=0x5637b9cfb300) at ./src/kitemviews/kitemlistcontroller.cpp:1273
Comment 18 Christoph Feck 2021-01-05 11:58:09 UTC
*** Bug 431179 has been marked as a duplicate of this bug. ***
Comment 19 Nate Graham 2021-01-16 14:50:56 UTC
*** Bug 431670 has been marked as a duplicate of this bug. ***