Bug 500797 - kwin_wayland crashes on login with ASSERT: "m_pending.crtc" in file ./src/backends/drm/drm_pipeline.cpp, line 53
Summary: kwin_wayland crashes on login with ASSERT: "m_pending.crtc" in file ./src/bac...
Status: VERIFIED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 6.3.2
Platform: Neon Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 500957 501204 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-02-27 03:50 UTC by John Schroeder
Modified: 2025-03-23 22:33 UTC (History)
6 users (show)

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


Attachments
~/.config/kwinoutputconfig.json (25.64 KB, text/plain)
2025-02-27 16:51 UTC, John Schroeder
Details
Output of drm_info (64.60 KB, text/plain)
2025-02-27 16:51 UTC, John Schroeder
Details
list of packages that were upgraded before the issue started (16.19 KB, text/plain)
2025-03-03 21:28 UTC, Aleks
Details
output of drm-info (46.80 KB, text/x-log)
2025-03-03 21:28 UTC, Aleks
Details
kwinoutputconfig.json (5.48 KB, application/json)
2025-03-03 21:29 UTC, Aleks
Details
output of journalctl -b -1 -p3 (889.58 KB, text/x-log)
2025-03-03 21:32 UTC, Aleks
Details
drm_info for HP Zbook 15u G5 (81.80 KB, text/plain)
2025-03-10 13:33 UTC, Daniel Petrov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Schroeder 2025-02-27 03:50:48 UTC
SUMMARY
Logging in to a Wayland session with KDE Plasma 6.3.2 fails and returns to the login screen.

STEPS TO REPRODUCE
1. Login to Wayland session on KDE Neon.

OBSERVED RESULT
KDE Plasma fails to start and returns to the login screen.

EXPECTED RESULT
KDE Plasma session starts.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.3
KDE Plasma Version: 6.3.2
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.11.0-17-generic (64-bit)
Graphics Platform: X11 (Note: This was taken from kinfo during an X11 session because the Wayland session fails to start.)
Processors: 8 × Intel® Core™ i7-8665U CPU @ 1.90GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Intel® UHD Graphics 620

ADDITIONAL INFORMATION
This starting happening after upgrading to KDE Plasma 6.3.2 today. The problem was not seen with 6.3.1.

There is probably something specific with my configuration that is causing the problem since it does not seem to be affecting other users. I am using pam authentication, have some startup applications/scripts, have 3 monitors, and have a few plasmoids configured. Even though it is probably just my configuration, I thought it would be worth reporting a bug since it didn't happen in 6.3.1 and Plasma is failing to login.

Stack Trace (from "journalctl -b -p err"):
kwin_wayland[3756]: ASSERT: "m_pending.crtc" in file ./src/backends/drm/drm_pipeline.cpp, line 53
systemd-coredump[3821]: Process 3756 (kwin_wayland) of user ********* dumped core.
                                                         ~
                                                         Module libnss_systemd.so.2 from deb systemd-255.4-1ubuntu8.5.amd64
                                                         Module libgomp.so.1 from deb gcc-14-14.2.0-4ubuntu2~24.04.amd64
                                                         Module libgcc_s.so.1 from deb gcc-14-14.2.0-4ubuntu2~24.04.amd64
                                                         Module libudev.so.1 from deb systemd-255.4-1ubuntu8.5.amd64
                                                         Module libzstd.so.1 from deb libzstd-1.5.5+dfsg2-2build1.1.amd64
                                                         Module libstdc++.so.6 from deb gcc-14-14.2.0-4ubuntu2~24.04.amd64
                                                         Module libsystemd.so.0 from deb systemd-255.4-1ubuntu8.5.amd64
                                                         Stack trace of thread 3756:
                                                         #0  0x00007c199389eb2c __pthread_kill_implementation (libc.so.6 + 0x9eb2c)
                                                         #1  0x00007c199384527e __GI_raise (libc.so.6 + 0x4527e)
                                                         #2  0x00007c199730d2ab _ZN6KCrash19defaultCrashHandlerEi (libKF6Crash.so.6 + 0x92ab)
                                                         #3  0x00007c1993845330 __restore_rt (libc.so.6 + 0x45330)
                                                         #4  0x00007c199389eb2c __pthread_kill_implementation (libc.so.6 + 0x9eb2c)
                                                         #5  0x00007c199384527e __GI_raise (libc.so.6 + 0x4527e)
                                                         #6  0x00007c19938288ff __GI_abort (libc.so.6 + 0x288ff)
                                                         #7  0x00007c199450c1ac n/a (libQt6Core.so.6 + 0x50c1ac)
                                                         #8  0x00007c199450d089 _ZNK14QMessageLogger5fatalEPKcz (libQt6Core.so.6 + 0x50d089)
                                                         #9  0x00007c199450d100 _Z9qt_assertPKcS0_i (libQt6Core.so.6 + 0x50d100)
                                                         #10 0x00007c1996bdc130 n/a (libkwin.so.6 + 0x1dc130)
                                                         #11 0x00007c1996ec6e89 _ZN4KWin9DrmOutput7presentERKSt10shared_ptrINS_11OutputFrameEE (libkwin.so.6 + 0x4c6e89)
                                                         #12 0x00007c1996c0c90a _ZN4KWin17WaylandCompositor9compositeEPNS_10RenderLoopE (libkwin.so.6 + 0x20c90a)
                                                         #13 0x00007c19944763e9 n/a (libQt6Core.so.6 + 0x4763e9)
                                                         #14 0x00007c1996c2d7c4 _ZN4KWin10RenderLoop14frameRequestedEPS0_ (libkwin.so.6 + 0x22d7c4)
                                                         #15 0x00007c1996c2e652 _ZN4KWin17RenderLoopPrivate8dispatchEv (libkwin.so.6 + 0x22e652)
                                                         #16 0x00007c19944763e9 n/a (libQt6Core.so.6 + 0x4763e9)
                                                         #17 0x00007c199442025d _ZN6QTimer7timeoutENS_14QPrivateSignalE (libQt6Core.so.6 + 0x42025d)
                                                         #18 0x00007c1994403806 _ZN7QObject5eventEP6QEvent (libQt6Core.so.6 + 0x403806)
                                                         #19 0x00007c1995801158 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt6Widgets.so.6 + 0x601158)
                                                         #20 0x00007c19944aefa0 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt6Core.so.6 + 0x4aefa0)
                                                         #21 0x00007c1994385f58 _ZN14QTimerInfoList14activateTimersEv (libQt6Core.so.6 + 0x385f58)
                                                         #22 0x00007c1994388fba _ZN20QEventDispatcherUNIX13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt6Core.so.6 + 0x388fba)
                                                         #23 0x00007c1994d5a7b2 _ZN23QUnixEventDispatcherQPA13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt6Gui.so.6 + 0x75a7b2)
                                                         #24 0x00007c19944b14d3 _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt6Core.so.6 + 0x4b14d3)
                                                         #25 0x00007c19944b2ffd _ZN16QCoreApplication4execEv (libQt6Core.so.6 + 0x4b2ffd)
                                                         #26 0x00005c40ecf96384 n/a (kwin_wayland + 0x66384)
                                                         #27 0x00007c199382a1ca __libc_start_call_main (libc.so.6 + 0x2a1ca)
                                                         #28 0x00007c199382a28b __libc_start_main_impl (libc.so.6 + 0x2a28b)
                                                         #29 0x00005c40ecf9c665 n/a (kwin_wayland + 0x6c665)
Comment 1 Zamundaaa 2025-02-27 14:05:49 UTC
Please attach ~/.config/kwinoutputconfig.json and the output of drm_info
Comment 2 John Schroeder 2025-02-27 16:51:00 UTC
Created attachment 178947 [details]
~/.config/kwinoutputconfig.json
Comment 3 John Schroeder 2025-02-27 16:51:43 UTC
Created attachment 178949 [details]
Output of drm_info
Comment 4 Nate Graham 2025-02-28 22:41:12 UTC
This is the thing that's supposed to be fixed in 6.3.2.1, right?
Comment 5 Daniel Petrov 2025-03-03 02:30:30 UTC
Glad I'm not alone here. I thought I broke something after forcing everything onto my GPU with `DRI_PRIME=1`

I also see the m_pending.crtc line:
    $ kwin_wayland
    No backend specified, automatically choosing drm
    Accepting client connections on sockets: QList("wayland-0")
    could not create a component for  "klip.desktop"
    could not create a component for  "proton-pass.desktop"
    could not create a component for  "unixtime.desktop"
    kwin_core: Applying output config failed!
    ASSERT: "m_pending.crtc" in file ./src/backends/drm/drm_pipeline.cpp, line 53
    KCrash: Application 'kwin_wayland' crashing... crashRecursionCounter = 2
Comment 6 Daniel Petrov 2025-03-03 02:42:13 UTC
> This is the thing that's supposed to be fixed in 6.3.2.1, right?

Maybe, but it isn't fixed for me. I have kwin version `4:6.3.2.1-0zneon+24.04+noble+release+build31` on KDE Neon 6.3. No amount of reinstalling resolved it.
Comment 7 Bug Janitor Service 2025-03-03 14:43:29 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7254
Comment 8 Daniel Petrov 2025-03-03 15:55:47 UTC
And for the sake of reproduction, here are my specs:

Software 		
	OS 						KDE Neon 6.3
	KDE Plasma Version 		6.3.2
	KDE Frameworks Version 	6.11.0
	Kernel Version 			6.11.0-17-generic (64-bit)
		
Hardware 		
	Processors 				8x Intel i7-8550U @ 1.80GHz
	Memory 					30.6 GiB of RAM
	Graphics Processor 1 		Intel UHD Graphics 620 (integrated)
	Graphics Processor 2 		AMD Radeon Pro WX 3100 (discrete)
	Manufacturer 			HP
	Product Name 			HP Zbook 15u G5
	System Version 			SBKPF
	Serial Number 			5CG9093Z1Y

(I'm not alone in using an eight year old laptop! Guess I can hold off on upgrading for another year or two!)
Comment 9 Aleks 2025-03-03 21:26:55 UTC
I'm seeing the same issue but with a twist: I have 2 screens connected: my main screen is using DP, second is on HDMI.
After upgrading my packages today I'm no longer able to use wayland if my second screen is connected (login loop). Workaround is hopping to a terminal, logging in and using X11 to able to use the second screen. (so hardware is oke)
I've provided drm_info, a list of the updated packages this morning and kwinoutputconfig.json.
Comment 10 Aleks 2025-03-03 21:28:00 UTC
Created attachment 179086 [details]
list of packages that were upgraded before the issue started

list of packages that were upgraded before the issue started
Comment 11 Aleks 2025-03-03 21:28:34 UTC
Created attachment 179087 [details]
output of drm-info
Comment 12 Aleks 2025-03-03 21:29:50 UTC
Created attachment 179088 [details]
kwinoutputconfig.json
Comment 13 Aleks 2025-03-03 21:32:26 UTC
Created attachment 179089 [details]
output of journalctl -b -1 -p3
Comment 14 Zamundaaa 2025-03-03 22:01:03 UTC
Git commit e652bdd3118fa55563caf0125deb0999f5ebd503 by Xaver Hugl.
Committed on 03/03/2025 at 20:33.
Pushed by zamundaaa into branch 'Plasma/6.3'.

backends/drm: fix testing for more connectors than CRTCs

The connectors may not actually be enabled, so the checks could sometimes result in
wrongly returning Error::NotEnoughCrtcs.
Related: bug 500819

(cherry picked from commit aa11d89a90bc4eb77bfe191a2cadede4d957d2a9)

M  +7    -7    src/backends/drm/drm_gpu.cpp

https://invent.kde.org/plasma/kwin/-/commit/e652bdd3118fa55563caf0125deb0999f5ebd503
Comment 15 Zamundaaa 2025-03-03 22:07:12 UTC
(In reply to Aleks from comment #9)
> I'm seeing the same issue but with a twist: I have 2 screens connected: my
> main screen is using DP, second is on HDMI.
> After upgrading my packages today I'm no longer able to use wayland if my
> second screen is connected (login loop). Workaround is hopping to a
> terminal, logging in and using X11 to able to use the second screen. (so
> hardware is oke)
> I've provided drm_info, a list of the updated packages this morning and
> kwinoutputconfig.json.
The problem doesn't appear on some fixed number of screens, but it happens when you use the maximum number of displays the GPU is able to drive - in your case, that's two (only two CRTCs in the drm_info output).

With that, I'm quite confident that the commit fixes it. Please test it, and reopen if necessary.
Comment 16 Nate Graham 2025-03-05 21:20:07 UTC
*** Bug 500957 has been marked as a duplicate of this bug. ***
Comment 17 Méven 2025-03-08 08:38:21 UTC
*** Bug 501204 has been marked as a duplicate of this bug. ***
Comment 18 Aleks 2025-03-09 07:15:15 UTC
I received the update in my Tumbleweed release and it indeed works again, thanks @Zamundaaa
Comment 19 Daniel Petrov 2025-03-10 13:31:11 UTC
> but it happens when you use the maximum number of displays the GPU is able to drive

Curious, my drm-info says I have the following connectors:
0. eDP (Laptop display)
1. DisplayPort
2. HDMI-A
3. DisplayPort
4. HDMI-A
5. DisplayPort
6. DisplayPort

And three CRTCs. I am only using two of the four available DisplayPorts, along with the Laptop display, does that mean I'm using all available displays? If that's the case, why is my system reporting four DisplayPort connectors if one of them is utterly useless?
Comment 20 Daniel Petrov 2025-03-10 13:33:11 UTC
Created attachment 179265 [details]
drm_info for HP Zbook 15u G5
Comment 21 Zamundaaa 2025-03-10 21:34:49 UTC
(In reply to Daniel Petrov from comment #19)
> And three CRTCs. I am only using two of the four available DisplayPorts,
> along with the Laptop display, does that mean I'm using all available
> displays?
Yes.
> If that's the case, why is my system reporting four DisplayPort
> connectors if one of them is utterly useless?
Not sure, sometimes drivers do weird things. Theoretically (we don't support this) with display cloning a crtc could send the exact same image to multiple displays at once, might be for that.
Comment 22 John Schroeder 2025-03-13 16:10:08 UTC
Verified fixed in KDE Neon Testing repo with version 6.3.3. I am able to login to the Wayland session using the maximum number of monitors (3 external monitors for the machine that was used when reporting the issue).

Package: kwin-wayland
Version: 4:6.3.3.1+p24.04+vstable+git20250312.1708-0

This probably isn't the right place for this comment but it would be nice to get some kind of test (if one hasn't been added already) for this scenario where the maximum number of monitors is used with a Wayland session.