*** If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports *** SUMMARY kwin_wayland and plasmashell consume 100% of a single CPU core when screen is locked. STEPS TO REPRODUCE 1. lock screen 2. ssh into your system 3. run top, observe kwin_wayland and plasmashell consuming 100% of a single CPU core OBSERVED RESULT kwin_wayland and plasmashell consume 100% of a single CPU core EXPECTED RESULT kwin_wayland and plasmashell are idle SOFTWARE/OS VERSIONS Windows: macOS: (available in the Info Center app, or by running `kinfo` in a terminal window) Linux/KDE Plasma: Archlinux KDE Plasma Version: 6.1.4 KDE Frameworks Version: 6.4.0 Qt Version: 6.7.2 ADDITIONAL INFORMATION plasmashell backtrace: #0 QPlatformClipboard::emitChanged (this=0x561ea0b792a0, mode=QClipboard::Clipboard) at /usr/src/debug/qt6-base/qtbase/src/gui/kernel/qplatformclipboard.cpp:87 #1 0x0000715a5cfc6b11 in SystemClipboard::setMimeData (this=0x561ea1d6fd50, data=0x561ea0f7d260, mode=QClipboard::Clipboard) at /usr/src/debug/plasma-workspace/plasma-workspace-6.1.4/klipper/systemclipboard.cpp:112 #2 Klipper::setClipboard (this=this@entry=0x561ea1da6ef0, item=..., mode=mode@entry=2, updateReason=updateReason@entry=Klipper::ClipboardUpdateReason::PreventEmptyClipboard) at /usr/src/debug/plasma-workspace/plasma-workspace-6.1.4/klipper/klipper.cpp:688 #3 0x0000715a5cfc6fba in Klipper::slotReceivedEmptyClipboard (this=0x561ea1da6ef0, mode=QClipboard::Clipboard) at /usr/src/debug/plasma-workspace/plasma-workspace-6.1.4/klipper/klipper.cpp:544 #4 0x0000715a95ba16f7 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:469 #5 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4086 #6 0x0000715a5cfdbb51 in SystemClipboard::receivedEmptyClipboard (this=0x561ea1d6fd50, _t1=QClipboard::Clipboard) at /usr/src/debug/plasma-workspace/build/klipper/libklipper_common_static_autogen/include/moc_systemclipboard.cpp:210 #7 SystemClipboard::checkClipData (this=0x561ea1d6fd50, mode=QClipboard::Clipboard) at /usr/src/debug/plasma-workspace/plasma-workspace-6.1.4/klipper/systemclipboard.cpp:155 #8 0x0000715a95ba16f7 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:469 #9 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4086 #10 0x0000715a9691db01 in KSystemClipboard::changed (this=<optimized out>, _t1=<optimized out>) at /usr/src/debug/kguiaddons/build/src/KF6GuiAddons_autogen/include/moc_ksystemclipboard.cpp:142 #11 0x0000715a95ba16f7 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:469 #12 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4086 #13 0x0000715a961a1a7f in QClipboard::changed (this=0x561ea120f5a0, _t1=<optimized out>) at /usr/src/debug/qt6-base/build/src/gui/Gui_autogen/include/moc_qclipboard.cpp:181 #14 QClipboard::emitChanged (this=0x561ea120f5a0, mode=QClipboard::Clipboard) at /usr/src/debug/qt6-base/qtbase/src/gui/kernel/qclipboard.cpp:558 #15 QPlatformClipboard::emitChanged (this=<optimized out>, mode=QClipboard::Clipboard) at /usr/src/debug/qt6-base/qtbase/src/gui/kernel/qplatformclipboard.cpp:89 #16 QPlatformClipboard::emitChanged (this=<optimized out>, mode=QClipboard::Clipboard) at /usr/src/debug/qt6-base/qtbase/src/gui/kernel/qplatformclipboard.cpp:86 #17 0x0000715a95ba16f7 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:469 #18 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4086 #19 0x0000715a96f3e596 in ffi_call_unix64 () at ../src/x86/unix64.S:104 #20 0x0000715a96f3b00e in ffi_call_int (cif=cif@entry=0x7ffc45d71330, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=closure@entry=0x0) at ../src/x86/ffi64.c:673 #21 0x0000715a96f3dbd3 in ffi_call (cif=cif@entry=0x7ffc45d71330, fn=<optimized out>, rvalue=rvalue@entry=0x0, avalue=avalue@entry=0x7ffc45d71400) at ../src/x86/ffi64.c:710 #22 0x0000715a984fe860 in wl_closure_invoke (closure=closure@entry=0x715a6c003900, target=<optimized out>, target@entry=0x561ea1f94fe0, opcode=opcode@entry=2, data=<optimized out>, flags=1) at ../wayland-1.23.0/src/connection.c:1228 #23 0x0000715a984ff0d9 in dispatch_event (display=display@entry=0x561ea0a22d50, queue=queue@entry=0x561ea0a22e48) at ../wayland-1.23.0/src/wayland-client.c:1670 #24 0x0000715a984ff4f3 in dispatch_queue (display=0x561ea0a22d50, queue=0x561ea0a22e48) at ../wayland-1.23.0/src/wayland-client.c:1816 #25 wl_display_dispatch_queue_pending (display=0x561ea0a22d50, queue=0x561ea0a22e48) at ../wayland-1.23.0/src/wayland-client.c:2058 #26 0x0000715a9774c456 in QtWaylandClient::QWaylandDisplay::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /usr/src/debug/qt6-wayland/qtwayland/src/client/qwaylanddisplay.cpp:227 #27 0x0000715a95ba194a in doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4098 #28 0x0000715a95da2d05 in QAbstractEventDispatcher::awake (this=0x561ea0b89cc0) at /usr/src/debug/qt6-base/build/src/corelib/Core_autogen/include/moc_qabstracteventdispatcher.cpp:158 #29 QEventDispatcherGlib::processEvents (this=0x561ea0b89cc0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:401 #30 0x0000715a95b4f01e in QEventLoop::processEvents (this=0x7ffc45d717c0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:100 #31 QEventLoop::exec (this=0x7ffc45d717c0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:182 #32 0x0000715a95b4934d in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qflags.h:74 #33 0x0000715a97af83ba in QApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2555 #34 0x0000561e686d7d86 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/plasma-workspace/plasma-workspace-6.1.4/shell/main.cpp:188 kwin_wayland backtrace: Thread 1 "kwin_wayland" hit Breakpoint 4, wl_client_connection_data (fd=<optimized out>, mask=<optimized out>, data=0x5e5ad315a060) at ../wayland-1.23.0/src/wayland-server.c:409 409 if (!(resource_flags & WL_MAP_ENTRY_LEGACY) && (gdb) print message $39 = (const struct wl_message *) 0x70fce9d254d8 <zwp_primary_selection_source_v1_requests.lto_priv+24> (gdb) bt #0 wl_client_connection_data (fd=<optimized out>, mask=<optimized out>, data=0x5e5ad315a060) at ../wayland-1.23.0/src/wayland-server.c:409 #1 0x000070fce7c7f0a2 in wl_event_loop_dispatch (loop=0x5e5ad213aea0, timeout=<optimized out>) at ../wayland-1.23.0/src/event-loop.c:1105 #2 0x000070fce9a767fa in KWin::Display::dispatchEvents (this=<optimized out>) at /usr/src/debug/kwin/kwin-6.1.4/src/wayland/display.cpp:121 #3 0x000070fce6fa16f7 in QtPrivate::QSlotObjectBase::call (this=<optimized out>, r=<optimized out>, a=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:469 #4 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4086 #5 0x000070fce6faa850 in QSocketNotifier::activated (this=0x5e5ad2fef0b0, _t1=..., _t2=<optimized out>, _t3=...) at /usr/src/debug/qt6-base/build/src/corelib/Core_autogen/include/moc_qsocketnotifier.cpp:195 #6 QSocketNotifier::event (this=0x5e5ad2fef0b0, e=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qsocketnotifier.cpp:327 #7 0x000070fce80fc51c in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5e5ad2fef0b0, e=0x7ffd58556eb0) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3287 #8 0x000070fce6f44d28 in QCoreApplication::notifyInternal2 (receiver=0x5e5ad2fef0b0, event=0x7ffd58556eb0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1142 #9 0x000070fce70c5b60 in QCoreApplication::sendEvent (receiver=<optimized out>, event=0x7ffd58556eb0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1583 #10 QEventDispatcherUNIXPrivate::activateSocketNotifiers (this=this@entry=0x5e5ad20c26a0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_unix.cpp:251 #11 0x000070fce70c6676 in QEventDispatcherUNIX::processEvents (this=<optimized out>, flags=..., flags@entry=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_unix.cpp:467 #12 0x000070fce79f9693 in QUnixEventDispatcherQPA::processEvents (this=<optimized out>, flags=...) at /usr/src/debug/qt6-base/qtbase/src/gui/platform/unix/qunixeventdispatcher.cpp:27 #13 0x000070fce6f4f01e in QEventLoop::processEvents (this=0x7ffd58557090, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:100 #14 QEventLoop::exec (this=0x7ffd58557090, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:182 #15 0x000070fce6f4934d in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qflags.h:74 #16 0x000070fce80f83ba in QApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2555 #17 0x00005e5ac5684035 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kwin/kwin-6.1.4/src/main_wayland.cpp:639
Could be related to BUG484323 which was originally reported for X11
Might be the same as bug 489644?
(In reply to Zamundaaa from comment #2) > Might be the same as bug 489644? I'm running kwin-6.1.4, which already has a fix for 489644 (c91040d3deee8a2028562451fa056c002f35ae42 in origin/Plasma/6.1 branch), but I'm still seeing the issue.
The backtrace looks suspect, it's apparently not using data_control waylandclipboard in kguiaddons. Is you kguiaddons build with wayland/from distro?
(In reply to David Redondo from comment #4) > The backtrace looks suspect, it's apparently not using data_control > waylandclipboard in kguiaddons. Is you kguiaddons build with wayland/from > distro? It's coming from distro, it has wayland in dependencies and plasma-wayland-protocols in makedeps. See https://gitlab.archlinux.org/archlinux/packaging/packages/kguiaddons/-/blob/bdb649fb62712ac260968f5343b63d350561f408/PKGBUILD
It is somehow related to clipboard. If I have anything (e.g. text) in clipboard prior to locking the screen, I see the issue. If I explicitly clear clipboard, I don't see the issue.
BTW, it is not a cosmetic issue. On my 2020 Dell XPS 15 power consumption jumps x2 when screen is locked vs idle with screen unlocked.
On wayland this code path should not wp_primary_clipboard but it seems it is. Can you share a relevant WAYLAND_DEBUG log plasmashell?
The log is over 4M even when compressed, so I cannot attach it to the bug. See https://drive.google.com/file/d/10nyKKcdiKLcDA0L1laSgOmUK_-zpJKBB/view?usp=sharing
(In reply to David Redondo from comment #8) > On wayland this code path should not wp_primary_clipboard but it seems it is. > Can you share a relevant WAYLAND_DEBUG log plasmashell? Do you need any other logs? Or could you give any pointers on how to debug it? It doesn't look like it's something trivial (at least it involves plasmashell and kwin) and I'm not really familiar with modern Plasma architecture.
Another symptom is when I see the issue: sometimes if I open clipboard history in a tray, I don't see current clipboard contents in the list and clipboard contents reset to previous one, and CPU usage drops back to normal.
Created attachment 173221 [details] Screencast demonstrating the issue It looks like clipboard widget isn't working properly and it may be related to the issue
With "Middle Click: Pastes selected text" disabled I don't see the issue anymore, so I'll use it as a workaround. In the log from https://bugs.kde.org/show_bug.cgi?id=491648#c9 you can see that something generates a ton of zwp_primary_selection_source_v1.offer/zwp_primary_selection_source_v1.cancelled pairs, so it's obviously something wrong in this functionality implementation. I'm not sure if it's Qt, Plasma or kwin. Feel free to ping me if you need more logs or if you want me to poke it with gdb.
Can you post the output of `journalctl --boot --user-unit plasma-plasmashell`? Also do you have QT_QPA_PLATFORM envvar set? > Linux/KDE Plasma: Archlinux Are you using stock arch linux packages?
> Also do you have QT_QPA_PLATFORM envvar set? Nvm, it's irrelevant for this bug report. > Are you using stock arch linux packages? Oh I see https://bugs.kde.org/show_bug.cgi?id=491648#c5 --- As David pointed out in a comment above, plasmashell doesn't use the data control protocol, which is a red flag. Maybe WaylandClipboard fails to initialize, hopefully the logs would contain some info
Setting NEEDSINFO while we wait for the output of `journalctl --boot --user-unit plasma-plasmashell`
I cannot reproduce it anymore after upgrading to 6.1.5. I use stock Archlinux packages and I don't have QT_QPA_PLATFORM set. I guess you don't want `journalctl --boot --user-unit plasma-plasmashell` output if I cannot reproduce it?
Yeah, there's no point to provide logs if you can't reproduce the issue. Thank you for the update. Please reopen the bug report if the issue comes back. In which case, please provide plasmashell logs and it won't hurt to capture wayland debug logs again too