Bug 512448

Summary: plasmashell repeatedly crashing on multi-monitor desktop, usually when monitors are waking up from a sleep state wl_registry#51: error 0: invalid global kde_output_device_v2 (124)
Product: [Plasma] plasmashell Reporter: Brent Spillner <spillner>
Component: generic-crashAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: crash CC: kdedev, nate, spillner
Priority: NOR Keywords: multiscreen, wayland-only
Version First Reported In: 6.5.2   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=507691
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: stderr output from a crash when running under GDB
GDB backtrace, unfortunately debugging symbols are stripped but crash seems to come from qwaylandeglwindow.cpp:120

Description Brent Spillner 2025-11-21 21:52:03 UTC
SUMMARY
The Plasma shell regularly crashes (about once every 3-5 days of continuous use), taking away the panel.  So far, all crashes have occurred either when restoring a window from fullscreen to normal size, or (more commonly) when my monitors are waking up from a sleep state.  I can regain the panel by running "plasmashell --replace", but the replacement shell exhibits slightly different behavior (for example, newly opened windows aren't automatically drawn in front of older windows from applications started under a previous (now exited) plasmashell; there's also a systemsettings crash that I will detail in a separate bug report), so I usually just log out and back in to get a clean session.  However, after a crash about three days ago, I ran "plasmashell --replace" and left it running until it crashed again today.  Since I also kept the terminal session with the "plasmashell --replace" open, I was able to recover the error messages reprinted below, which appear to be an interleaving of faults in the Chromium browser (timestamped log entries; they also appear to contain PIDs and a source file name & line) and in plasmashell itself (the unannotated entries such as "kf.plasma.quick: Exposed with no visual parent. Window positioning broken") and ending with "The Wayland connection experienced a fatal error: Protocol error" right before plasmashell exited with code 255.

I don't know for a fact that the Chromium faults were the immediate cause of the plasmashell crash, but the timing certainly seems suspicious.  I plan to leave both another restarted plasmashell and this Chromium instance (which is still running without any app or tab crashes) running and will add to this report if/when the faults recur.

Certainly, bugs within Chromium are not within KDE's span of control, but if they can indeed trigger plasmashell or other KDE component crashes, that seems like undesirably fragile behavior for a desktop environment.

STEPS TO REPRODUCE
1. Launch a Plasma session over Wayland
2. Start Chromium within that session (I do so via an icon on the Task Manager section of the KDE panel, so the error messages copied below must have been logged via plasmashell, not because Chromium was a backgrounded process in the same terminal session).
3. Wait.  It may be relevant that I have a dual-monitor setup, both monitors go to sleep after 30 minutes of inactivity, and when waking up from inactivity, the secondary monitor generally comes back to life before the one designated as primary within the KDE settings panel.  I mention that because I know that it causes application windows to migrate from their original positions on the two-monitor virtual desktop, to all being crammed on the single secondary monitor for a second or two, and then to snap back to their original positions once the primary monitor wakes up.

OBSERVED RESULT
plasmashell process occasionally exits with an error (exit code 255).

EXPECTED RESULT
plasmashell should continue running until the user deliberately exits the Plasma session, or manually kills the plasmashell process for some reason.

SOFTWARE/OS VERSIONS
Linux: 6.16.12
KDE Plasma: 6.5.2 
KDE Frameworks: 6.19.0
Qt:  6.10.0
Wayland: 1.24
Graphics backend: in-kernel amdgpu driver, Mesa 25.3.0
Chromium: 142.0.7444.162

ADDITIONAL INFORMATION (messages on stderr):
kf.plasma.quick: Exposed with no visual parent. Window positioning broken.
[25391:25391:1120/062658.793032:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.794117:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.795404:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.796782:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.798261:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.799507:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.801471:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.802884:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.804630:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.806090:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.807713:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.809286:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.810535:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.811777:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.813273:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.814607:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.816052:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.819585:ERROR:chrome/browser/ui/views/user_education/impl/browser_user_education_interface_impl.cc:154] Attempting to show IPH IPH_TabSearch before browser initialization complete; IPH will not be shown.
[25391:25391:1120/062658.893177:ERROR:content/browser/network_service_instance_impl.cc:613] Network service crashed, restarting service.
[25391:25412:1120/062659.059930:ERROR:google_apis/gcm/engine/registration_request.cc:292] Registration response error message: DEPRECATED_ENDPOINT
[25704:25709:1120/062707.494485:ERROR:services/network/p2p/socket_manager.cc:137] Failed to resolve address for ec2-52-23-111-175.compute-1.amazonaws.com., errorcode: -105
[25391:25408:1120/062718.222118:ERROR:net/cert/internal/cert_issuer_source_aia.cc:35] Error parsing cert retrieved from AIA (as DER):
ERROR: Couldn't read tbsCertificate as SEQUENCE
ERROR: Failed parsing Certificate

[25391:25412:1120/062727.395665:ERROR:google_apis/gcm/engine/registration_request.cc:292] Registration response error message: DEPRECATED_ENDPOINT
[25704:25709:1120/062755.655560:ERROR:net/socket/ssl_client_socket_impl.cc:916] handshake failed; returned -1, SSL error code 1, net_error -101
Fontconfig error: Cannot load default config file: No such file: (null)
Fontconfig error: Cannot load default config file: No such file: (null)
[25704:25709:1120/062756.225523:ERROR:net/socket/ssl_client_socket_impl.cc:916] handshake failed; returned -1, SSL error code 1, net_error -200
[25704:25709:1120/062757.977788:ERROR:net/socket/ssl_client_socket_impl.cc:916] handshake failed; returned -1, SSL error code 1, net_error -101
[25429:25492:1120/062758.509120:ERROR:gpu/command_buffer/service/shared_image/shared_image_manager.cc:526] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox.
[25429:25492:1120/062758.509191:ERROR:gpu/command_buffer/service/shared_image/shared_image_manager.cc:526] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox.
[25391:25412:1120/062821.760862:ERROR:google_apis/gcm/engine/registration_request.cc:292] Registration response error message: DEPRECATED_ENDPOINT
[25391:25412:1120/062942.381696:ERROR:google_apis/gcm/engine/registration_request.cc:292] Registration response error message: DEPRECATED_ENDPOINT
[25391:25412:1120/063304.493084:ERROR:google_apis/gcm/engine/registration_request.cc:292] Registration response error message: DEPRECATED_ENDPOINT
[25391:25412:1120/063922.116540:ERROR:google_apis/gcm/engine/registration_request.cc:292] Registration response error message: DEPRECATED_ENDPOINT
wl_registry#51: error 0: invalid global kde_output_device_v2 (124)
warning: queue "mesa egl surface queue" 0x7fb58cb47210 destroyed while proxies still attached:
  wp_presentation#43 still attached
qt.qpa.wayland: Could not create EGL surface (EGL error 0x3000)

The Wayland connection experienced a fatal error: Protocol error

[1]+  Exit 255                   plasmashell --replace  (wd: ~)
Comment 1 Brent Spillner 2025-11-24 20:44:11 UTC
plasmashell crashed again today; this time Chromium was not running, so there must be other causes.  The error messages were a little different and seem to confirm that it's an issue with the set of available screens changing (e.g. when one screen resumes before another):

kde.plasmashell: requesting unexisting screen available rect -1
kf.plasma.quick: Exposed with no visual parent. Window positioning broken.
kde.plasmashell: requesting unexisting screen available rect -1
kde.plasmashell: requesting unexisting screen available rect -1
kde.plasmashell: requesting unexisting screen available rect -1
kde.plasmashell: requesting unexisting screen available rect -1
wl_registry#51: error 0: invalid global kde_output_device_v2 (158)
warning: queue "mesa egl surface queue" 0x7f2fbc42e650 destroyed while proxies still attached:
  wp_presentation#43 still attached
qt.qpa.wayland: Could not create EGL surface (EGL error 0x3000)

The Wayland connection experienced a fatal error: Protocol error

[1]+  Exit 255                   plasmashell --replace  (wd: ~)
Comment 3 TraceyC 2025-11-25 17:27:27 UTC
Thanks for the crash report. As the message at the top of the summary says, if something crashed, we need a backtrace of it so we can figure out what's going on. Can you please attach a backtrace of the crash using the coredumpctl command-line program, as detailed in https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl ?

Thanks.
Comment 4 Brent Spillner 2025-11-27 13:12:23 UTC
I avoid systemd so I don't have coredumpctl, and my coredumpsize ulimit in that session was zero anyway.  However, plasmashell just crashed again, so I've restarted it under GDB (although my system package has debugging symbols stripped) and will share the dump from the next crash.

The stderr output from this crash is pasted below; it looks like the "invalid global kde_output_device_v2" message is still the common denominator, with the crash sequence always unfolding the same way from that point on, although there may be several different preceding trigger paths:

[21023:21197:1126/062516.386730:ERROR:gpu/command_buffer/service/shared_image/shared_image_manager.cc:526] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox.
[21023:21197:1126/062516.386791:ERROR:gpu/command_buffer/service/shared_image/shared_image_manager.cc:526] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox.
[21023:21197:1126/062516.386818:ERROR:gpu/command_buffer/service/shared_image/shared_image_manager.cc:526] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox.
[21023:21197:1126/062516.386872:ERROR:gpu/command_buffer/service/shared_image/shared_image_manager.cc:526] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox.
[21023:21197:1126/062516.386895:ERROR:gpu/command_buffer/service/shared_image/shared_image_manager.cc:526] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox.
[21023:21197:1126/062516.386914:ERROR:gpu/command_buffer/service/shared_image/shared_image_manager.cc:526] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox.
wl_registry#51: error 0: invalid global kde_output_device_v2 (208)
warning: queue "mesa egl surface queue" 0x7f9a2cb1ef00 destroyed while proxies still attached:
  wp_presentation#43 still attached
qt.qpa.wayland: Could not create EGL surface (EGL error 0x3000)

The Wayland connection experienced a fatal error: Protocol error
Comment 5 Brent Spillner 2025-12-03 21:13:10 UTC
Created attachment 187326 [details]
stderr output from a crash when running under GDB
Comment 6 Brent Spillner 2025-12-03 21:14:28 UTC
(In reply to TraceyC from comment #3)
> Thanks for the crash report. As the message at the top of the summary says,
> if something crashed, we need a backtrace of it so we can figure out what's
> going on. Can you please attach a backtrace of the crash using the
> coredumpctl command-line program, as detailed in
> https://community.kde.org/Guidelines_and_HOWTOs/Debugging/
> How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl ?
> 
> Thanks.

plasmashell crashed again today, but I just realized that these particular crashes will /never/ generate a core because it shuts itself down and exits "normally" from the OS perspective, albeit with a non-zero status code, i.e. it's invoking exit(255) instead of raising an uncaught signal.

Today's crash was again while the monitors were waking up from sleep, and with a very similiar stderr trace to all of the previous instances (attached).  Of note, in case it wasn't clear from my earlier reporting, this is not a deterministic failure; the monitors wake successfully dozens of times between every pair of crashes, and as far as I can recall I've never had two crashes within 24-48 hours of each other (so there may be some resource that's being gradually exhausted).

Anyway, I've restarted it, again under GDB, with a breakpoint on exit() this time, and I'll gcore when it quits on me again, but I'm skeptical that will add much value in troubleshooting a fault of this nature in a multithreaded program.
Comment 7 Brent Spillner 2025-12-07 15:16:39 UTC
Trace from the newest crash pasted below; it looks like the failures are being triggered (or at least recognized) within the !sizeWithMargins.isEmpty() && !m_waylandEglWindow && create && mSurface QMetaCallEvents branch of QWaylandEglWindow::updateSurface().  Specifically, the eglCreateWindowSurface() call at https://github.com/qt/qtbase/blob/dev/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglwindow.cpp#L120 is ultimately triggering QWaylandIntegration::clientBufferIntegration() -> QWaylandIntegration::Initialize() -> QWaylandDisplay::initEventThread() -> checkWaylandError(), and then returning a failure code back up the stack.  I don't know enough about wayland-egl to know what's causing the failure, but perhaps QMetaCallEvents are being delivered out-of-order from the EGL backend's perspective?  Are there any good tools for tracing that event queue?

wl_registry#51: error 0: invalid global kde_output_device_v2 (168)
[Thread 0x7fffec80f6c0 (LWP 22651) exited]
warning: queue "mesa egl surface queue" 0x7fff58509540 destroyed while proxies still attached:
  wp_presentation#43 still attached
qt.qpa.wayland: Could not create EGL surface (EGL error 0x3000)

[Thread 0x7fff567fc6c0 (LWP 28719) exited]
[Thread 0x7fff56ffd6c0 (LWP 28718) exited]
[Thread 0x7fff577fe6c0 (LWP 28717) exited]
[Thread 0x7fff57fff6c0 (LWP 28716) exited]
[Thread 0x7fff6512f6c0 (LWP 28715) exited]
[Thread 0x7fffa2ffd6c0 (LWP 28714) exited]
[Thread 0x7fffbeffd6c0 (LWP 28713) exited]
The Wayland connection experienced a fatal error: Protocol error

Thread 1 "plasmashell" hit Breakpoint 4.1, 0x00007ffff3b76e10 in _exit () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff3b76e10 in _exit () at /lib64/libc.so.6
#1  0x00007ffff56671b7 in QtWaylandClient::QWaylandDisplay::checkWaylandError() () at /usr/lib64/libQt6WaylandClient.so.6
#2  0x00007ffff445d772 in QObject::event(QEvent*) () at /usr/lib64/libQt6Core.so.6
#3  0x00007ffff6ef4238 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQt6Widgets.so.6
#4  0x00007ffff43ed898 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib64/libQt6Core.so.6
#5  0x00007ffff43f146e in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib64/libQt6Core.so.6
#6  0x00007ffff477e417 in ??? () at /usr/lib64/libQt6Core.so.6
#7  0x00007ffff2842ad6 in ??? () at /usr/lib64/libglib-2.0.so.0
#8  0x00007ffff2845bdf in ??? () at /usr/lib64/libglib-2.0.so.0
#9  0x00007ffff284630c in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#10 0x00007ffff477e5b8 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt6Core.so.6
#11 0x00007ffff43fc296 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt6Core.so.6
#12 0x00007ffff43f61ac in QCoreApplication::exec() () at /usr/lib64/libQt6Core.so.6
#13 0x000000000042e391 in ??? ()
#14 0x00007ffff3ab6d14 in __libc_start_call_main () at /lib64/libc.so.6
#15 0x00007ffff3ab6dc6 in __libc_start_main_impl () at /lib64/libc.so.6
#16 0x000000000042e4a1 in ??? ()
Comment 8 Brent Spillner 2025-12-07 15:28:13 UTC
Created attachment 187415 [details]
GDB backtrace, unfortunately debugging symbols are stripped but crash seems to come from qwaylandeglwindow.cpp:120
Comment 9 TraceyC 2025-12-08 23:14:24 UTC
Thanks for the backtrace and the additional detail. I wouldn't worry about the missing symbols at this point, since this is a protocol error.
Comment 10 Nate Graham 2025-12-09 18:32:57 UTC

*** This bug has been marked as a duplicate of bug 507691 ***