Bug 492624 - On Wayland, plasmashell crashes when dragging an applet from the widget explorer over a Show Activity Manager widget
Summary: On Wayland, plasmashell crashes when dragging an applet from the widget explo...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: generic-crash (show other bugs)
Version: master
Platform: Other Linux
: NOR crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-03 23:56 UTC by cwo
Modified: 2024-09-18 13:23 UTC (History)
1 user (show)

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


Attachments
backtrace of crash (9.61 KB, text/plain)
2024-09-03 23:56 UTC, cwo
Details
another backtrace (9.08 KB, text/plain)
2024-09-04 00:03 UTC, cwo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cwo 2024-09-03 23:56:44 UTC
Created attachment 173300 [details]
backtrace of crash

SUMMARY

This sequence of steps crashes plasmashell on both bare metal Tuxedo OS with git master session of workspace, and stock Fedora 40 in a vm. Crash is very consistently reproducible.

Terminal output at time of crash is: 

QWaylandDataOffer: timeout reading from pipe
QWaylandDataOffer: error reading data for mimeType text/x-plasmoidservicename

Top lines of backtrace:

#0  QMimeData::hasImage() const (this=this@entry=0x55555f9f5be0)
    at ./src/corelib/tools/qarraydatapointer.h:439
#1  0x00007ffff5bb4e33 in QWaylandMimeHelper::getByteArray(QMimeData*, QString const&)
    (mimeData=0x55555f9f5be0, mimeType=...) at ./src/shared/qwaylandmimehelper.cpp:18
#2  0x00007ffff5ba4db9 in QtWaylandClient::QWaylandDataSource::data_source_send(QString const&, int)
    (this=<optimized out>, mime_type=<optimized out>, fd=137) at ./src/client/qwaylanddatasource.cpp:46
#3  0x00007ffff5be3faa in QtWayland::wl_data_source::handle_send(void*, wl_data_source*, char const*, int)
    (data=0x55555f4369e0, object=<optimized out>, mime_type=0x7fffdc05e98c "text/x-plasmoidservicename", fd=137) at ./obj-x86_64-linux-gnu/src/client/qwayland-wayland.cpp:756
#4  0x00007ffff68dfe2e in ffi_call_unix64 () at ../src/x86/unix64.S:105
#5  0x00007ffff68dc493 in ffi_call_int
    (cif=<optimized out>, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=<optimized out>) at ../src/x86/ffi64.c:672
#6  0x00007ffff7c1e611 in wl_closure_invoke
    (closure=closure@entry=0x7fffdc05e8b0, flags=flags@entry=1, target=<optimized out>, 
    target@entry=0x55555f23db90, opcode=opcode@entry=1, data=<optimized out>)
    at ../../src/wayland/src/connection.c:1236
#7  0x00007ffff7c1a331 in dispatch_event
    (display=display@entry=0x55555568fb60, queue=queue@entry=0x55555568fc58)
    at ../../src/wayland/src/wayland-client.c:1681
#8  0x00007ffff7c1b443 in dispatch_queue (queue=0x55555568fc58, display=0x55555568fb60)
    at ../../src/wayland/src/wayland-client.c:1827
#9  wl_display_dispatch_queue_pending (display=0x55555568fb60, queue=0x55555568fc58)
    at ../../src/wayland/src/wayland-client.c:2069


STEPS TO REPRODUCE
1. Add Show Activity Manager (or on Plasme 6.1, Activities) widget to the panel; make sure that two activities exist 
2. Open Widget Explorer by right-clicking the panel and selecting "Add or Manage Widgets…" (in Plasma 6.1, "Add Widgets…"
3. Drag Analog Clock from the Widget Explorer over the Show Activity Manager widget and hover a bit so the sidebar pops up - this may sometimes require leaving and reentering the widget with the mouse

OBSERVED RESULT

Crash

EXPECTED RESULT

No Crash

SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.1.80
KDE Frameworks Version: 6.6.0 according to kinfo (but this is from a dev session with workspace kde-built earlier today) 
Qt Version: 6.7.2

ADDITIONAL INFORMATION

Fedora backtrace seems similar; the crash also tends to crash drkonqui so it's a bit tough to get a good one. I can try harder if that would help. (Attached backtrace is from running plasmashell in gdb)
Comment 1 cwo 2024-09-04 00:03:13 UTC
Created attachment 173301 [details]
another backtrace

For the sake of completeness, here's another crash backtrace that seems mostly similar (but with some of the top lines different). Symbols are not quite as nice. I thought that I triggered this crash only with the Sticky Notes widget, but I can't reproduce this anymore - I had the two widgets right next to each other, and it's possible that Show Activity Manager was the culprit then as well and it only seemed like sticky notes caused it because the crash is delayed. I now suspect that it's the same thing.
Comment 2 David Redondo 2024-09-04 08:38:03 UTC
It looks like dragging over the applet (can also be on desktop) closes the widget explorer and I assume the Drag object is deleted.
Comment 3 Bug Janitor Service 2024-09-04 09:40:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2498
Comment 4 David Redondo 2024-09-04 13:05:35 UTC
Git commit d4b87ac6f4d2c323be149c03a61959fc74d6435c by David Redondo.
Committed on 04/09/2024 at 12:56.
Pushed by davidre into branch 'master'.

applets/showActivityManager: Only show activityManager when drag contains windows

It doesn't make sense to show it on something that can't be dropped
into it.
This fixes the crash in the mentioned bug but there is a more general
issue that applets can interfere with the edit mode widget dragging.
FIXED-IN:6.1.5

M  +5    -1    applets/showActivityManager/package/contents/ui/main.qml
M  +12   -0    imports/activitymanager/switcherbackend.cpp
M  +1    -0    imports/activitymanager/switcherbackend.h

https://invent.kde.org/plasma/plasma-desktop/-/commit/d4b87ac6f4d2c323be149c03a61959fc74d6435c
Comment 5 David Redondo 2024-09-18 13:23:23 UTC
Git commit c75143b89a2ae68b2b0fc75b8844ca9dedf8de59 by David Redondo.
Committed on 18/09/2024 at 13:13.
Pushed by davidre into branch 'Plasma/6.1'.

applets/showActivityManager: Only show activityManager when drag contains windows

It doesn't make sense to show it on something that can't be dropped
into it.
This fixes the crash in the mentioned bug but there is a more general
issue that applets can interfere with the edit mode widget dragging.
FIXED-IN:6.1.5


(cherry picked from commit d4b87ac6f4d2c323be149c03a61959fc74d6435c)

Co-authored-by: David Redondo <kde@david-redondo.de>

M  +5    -1    applets/showActivityManager/package/contents/ui/main.qml
M  +12   -0    imports/activitymanager/switcherbackend.cpp
M  +1    -0    imports/activitymanager/switcherbackend.h

https://invent.kde.org/plasma/plasma-desktop/-/commit/c75143b89a2ae68b2b0fc75b8844ca9dedf8de59