https://bugs.kde.org/show_bug.cgi?id=454379

Fabian Vogt <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #23 from Fabian Vogt <[email protected]> ---
I had a quick look. Turns out I never hit this issue because the clipboard
history doesn't always work here, I had to restart plasmashell.

tl;dr: When dolphin quits, Plasma takes ownership of the selection. When it
gets focus it doesn't remember and asks itself (through wayland) about its
content -> deadlock.

Using WAYLAND_DEBUG=1, I the issue is visible:

When dolphin exits, the selection is cleared. plasmashell is notified about
that:

[2622585.375] [email protected](nil)
[2622585.384]  -> [email protected]()

And subsequently takes ownership of the selection:

[2622585.434]  -> [email protected]_data_source(new id
zwlr_data_control_source_v1@207)
[2622585.447]  -> [email protected]("text/uri-list")
[2622585.453]  ->
[email protected]("application/x-kio-metadata")
[2622585.459]  ->
[email protected]("application/x-kde-cutselection")
[2622585.464]  ->
[email protected]("application/x-kde-onlyReplaceEmpty")
[2622585.472]  ->
[email protected]("text/plain;charset=utf-8")
[2622585.481]  ->
[email protected]_selection(zwlr_data_control_source_v1@207)
[2622585.548]  -> [email protected]()
[2622586.048]  -> [email protected]()
[2622586.080]  -> [email protected]()

Plasmashell is then notified about its own change (which is a bit weird but so
far ok):
[2622586.111] [email protected]_offer(new id
zwlr_data_control_offer_v1@4278190091)
[2622586.121] [email protected]("text/uri-list")
[2622586.128]
[email protected]("application/x-kio-metadata")
[2622586.134]
[email protected]("application/x-kde-cutselection")
[2622586.139]
[email protected]("application/x-kde-onlyReplaceEmpty")
[2622586.144]
[email protected]("text/plain;charset=utf-8")
[2622586.151]
[email protected](zwlr_data_control_offer_v1@4278190091)
[2622587.436] [email protected]_id(157)
[2622587.447] [email protected]_id(144)
[2622587.450] [email protected]_id(211)
[2622587.458] [email protected]("text/uri-list", fd 39)

The issue starts when plasmashell gains keyboard focus:

[2633917.635] [email protected](3533, wl_surface@211, array[0])
[2633917.652]  -> [email protected](new id wl_callback@160)
[2633917.659] [email protected](3528, 0, 0, 0, 0)

At that point the plain wayland selection protocol announces its contents
(currently held by plasmashell itself):

[2633917.669] [email protected]_offer(new id wl_data_offer@4278190092)
[2633917.678] [email protected]("text/uri-list")
[2633917.685] [email protected]("application/x-kio-metadata")
[2633917.691] [email protected]("application/x-kde-cutselection")
[2633917.697]
[email protected]("application/x-kde-onlyReplaceEmpty")
[2633917.702] [email protected]("text/plain;charset=utf-8")
[2633917.708] [email protected]_actions(0)
[2633917.713] [email protected](wl_data_offer@4278190092)

Plasma is immediately interested in its "application/x-kde-cutselection"
content and asks for it:
#0  0x00007ffff511c470 in QtWayland::wl_data_offer::receive(QString const&,
int)@plt () at /lib64/libQt5WaylandClient.so.5
#1  0x00007ffff514d0b4 in  () at /lib64/libQt5WaylandClient.so.5
#2  0x00007ffff5f99584 in QInternalMimeData::retrieveData(QString const&,
QVariant::Type) const () at /lib64/libQt5Gui.so.5
#3  0x00007ffff5b01520 in  () at /lib64/libQt5Core.so.5
#4  0x00007ffff5b024dd in QMimeData::data(QString const&) const () at
/lib64/libQt5Core.so.5
#5  0x00007ffff4ea5ff1 in KIO::isClipboardDataCut(QMimeData const*)
(mimeData=mimeData@entry=0x555559b865d0) at
/usr/src/debug/kio-5.100.0/src/widgets/paste.cpp:360
#6  0x00007ffff073b9bf in
KFilePreviewGeneratorPrivate::applyCutItemEffect(KFileItemList const&)
(this=this@entry=0x55555641e8e0, items=...) at
/usr/src/debug/kio-5.100.0/src/filewidgets/kfilepreviewgenerator.cpp:871
#7  0x00007ffff073d327 in KFilePreviewGeneratorPrivate::updateCutItems()
(this=0x55555641e8e0) at
/usr/src/debug/kio-5.100.0/src/filewidgets/kfilepreviewgenerator.cpp:684
[...]
#13 0x00007ffff5f89b1d in QClipboard::emitChanged(QClipboard::Mode) () at
/lib64/libQt5Gui.so.5

[2633917.886]  ->
[email protected]("application/x-kde-cutselection", fd 43)

This is a deadllock: Plasmashell is asking for its own selection content.
Timeout to the rescue!

QWaylandDataOffer: timeout reading from pipe
QWaylandDataOffer: error reading data for mimeType
application/x-kde-cutselection

After the timeout the event processing resumes:

[2634919.439] [email protected]_offer(new id
zwp_primary_selection_offer_v1@4278190093)
[2634919.464] [email protected]("text/plain")
[2634919.473]
[email protected]("text/plain;charset=utf-8")
[2634919.482] [email protected]("STRING")
[2634919.490] [email protected]("text/plain")
[2634919.497] [email protected]("text/html")
[2634919.504] [email protected]("TARGETS")
[2634919.515] [email protected]("MULTIPLE")
[2634919.525] [email protected]("TIMESTAMP")
[2634919.534] [email protected]("SAVE_TARGETS")
[2634919.544]
[email protected](zwp_primary_selection_offer_v1@4278190093)
[2634919.558] [email protected](3534, wl_surface@211)
[2634919.571] [email protected](685, 516, array[4])
[2634919.585] [email protected](3535)
[2634919.616] [email protected]()
[2634919.625] [email protected]()
[2634919.632] [email protected]()
[2634919.640] [email protected](3535)

Eventually plasmashell gets the request sent from plasmashell in the past:
[2634919.657]
[email protected]("application/x-kde-cutselection", fd 41)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to