Bug 512707 - KDE Linux - kwin crashes in KWin::DrmGpu::pageFlipHandler on login with libvirt VM
Summary: KDE Linux - kwin crashes in KWin::DrmGpu::pageFlipHandler on login with libvi...
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 6.4.80
Platform: KDE Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-28 03:51 UTC by John Schroeder
Modified: 2025-12-31 20:56 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
kwin crash log (12.03 KB, text/plain)
2025-11-28 03:51 UTC, John Schroeder
Details
Output of drm_info command (18.27 KB, text/plain)
2025-11-28 03:52 UTC, John Schroeder
Details
Output of kscreen-doctor -o command (2.38 KB, text/plain)
2025-11-28 03:53 UTC, John Schroeder
Details
kwin_wayland.gdb (11.50 KB, text/plain)
2025-12-14 20:12 UTC, John Schroeder
Details
kwin backtrace (26.63 KB, text/x-log)
2025-12-16 07:52 UTC, John Schroeder
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Schroeder 2025-11-28 03:51:58 UTC
Created attachment 187221 [details]
kwin crash log

SUMMARY
Logging into KDE Linux on libvirt VM causes kwin to crash.

STEPS TO REPRODUCE
1. Create a libvirt VM and install KDE Linux.
2. Setup GPU passthrough.
3. Login to KDE Plasma.

OBSERVED RESULT
kwin crashes shortly after login. A couple of crash windows appear before getting kicked back to the login screen.

EXPECTED RESULT
kwin does not crash and the desktop session remains.

SOFTWARE/OS VERSIONS
Operating System: KDE Linux 2025-11-27
KDE Plasma Version: 6.5.80
KDE Frameworks Version: 6.21.0
Qt Version: 6.10.0
Kernel Version: 6.17.8-arch1-1 (64-bit)
Graphics Platform: offscreen
Processors: 2 ร— AMD Phenom(tm) II X4 965 Processor
Memory: 4 GiB of RAM (3.8 GiB usable)

ADDITIONAL INFORMATION
KDE Linux builds 202511270254 and 202511220923 both crash. I have not tried builds between those. 202511180408 does not crash.

I have a crash log but I do not have debugging symbols installed. If someone could provide instructions, I could install the debugging symbols and recreate the issue since it happens on every login.
Comment 1 John Schroeder 2025-11-28 03:52:34 UTC
Created attachment 187222 [details]
Output of drm_info command
Comment 2 John Schroeder 2025-11-28 03:53:03 UTC
Created attachment 187223 [details]
Output of kscreen-doctor -o command
Comment 3 Harald Sitter 2025-11-28 10:21:17 UTC
debug symbols are downloaded automatically by gdb, assuming you let it.
Comment 4 David Edmundson 2025-11-28 10:49:52 UTC
Unfortunately this trace isn't actionable due to the missing symbols, hopefully this issue will get fixed through another report.
Comment 5 Bug Janitor Service 2025-12-13 03:46:16 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 6 John Schroeder 2025-12-14 20:12:54 UTC
Created attachment 187643 [details]
kwin_wayland.gdb
Comment 7 John Schroeder 2025-12-14 20:22:11 UTC
(Sorry, for the double post. I forgot to comment when I uploaded the log.)

I think I was able to get enough debugging info. The log showed the issue was in KWin::DrmGpu::pageFlipHandler.

Let me know I need to install more debug info.

Note: kwin was stuck in a crash loop so I could use the usual GUI tools (e.g. DrKonqi) to get debugging symbols. I was able to get debugging symbols by running a working image and crashing kwin one time with "kill -SIGSEGV $(pidof kwin_wayland)". In "KWin - Crash Handler", after clicking "See Developer Information", I was able to click "Install Debug Symbols". I also created /root/.gdbinit with "set debuginfod enabled on" in it.
Comment 8 Vlad Zahorodnii 2025-12-15 07:53:26 UTC
Unfortunately, the backtrace still lacks debug symbols.

@Harald is there something else that maybe needs to be installed?
Comment 9 Harald Sitter 2025-12-15 11:20:45 UTC
Mostly just needs to be a new enough build (couple days), so if you are still on 2025-11-27 you'll need to upgrade first.
Comment 10 John Schroeder 2025-12-15 15:36:58 UTC
The latest gdb dump was made from 202512140922 (or the image before it on 20251212). However, the debug symbols are probably still from the old November image where kwin doesn't crash for me.

Is there a way to have gdb download debug symbols at the command line when I attach to the kwin process?
Comment 11 Harald Sitter 2025-12-15 16:41:11 UTC
drkonqi should find the symbols just fine then. I notice your trace output isn't from drkonqi though.

You could probably also access the crash after the fact via drkonqi-coredump-gui
Comment 12 John Schroeder 2025-12-16 07:52:36 UTC
Created attachment 187694 [details]
kwin backtrace

Thanks for the help! I was able to run "drkonqi-coredump-gui" and generate a (hopefully) "useful" backtrace.

Let me know if there is still more I can do. I can reproduce this consistently so I don't have a problem creating a new log or backtrace.

Some details on the crash:
1. Only happens when I use GPU passthrough (noted in the description).
2. Only happens when opening some apps (non-flatpak?). Konsole, Kate, Dolphin, System Settings, etc. crash. Firefox does not.
3. Does not happen immediately after login (as noted in the ticket). kwin will only crash immediately if I had an app (e.g. Dolphin) open from a previous session and the app re-opens due to it being in the saved session.

Note: Here are some details that came up for me. (Probably not useful to anyone else.)
1. I lost my "golden" 202511180408 image because I had automatic updates checked. However, that image wasn't useful for getting crash info.
2. I was able to boot into newer images (202512140922 and 202512150254) without GPU passthrough and run drkonqi-coredump-gui that way.
3. I had to increase my VM RAM size from 4GB to 8GB in order to not have the error message "KDE This backtrace is very limited because there was not enough memory available to generate a full backtrace. You can close some applications and try again."
Comment 13 Vlad Zahorodnii 2025-12-16 09:36:03 UTC
#4  0x00007f54e99c7b7a in KWin::DrmGpu::pageFlipHandler (fd=<optimized out>, sequence=<optimized out>, sec=4179, usec=973550, crtc_id=<optimized out>, user_data=0x56472cef6da0) at /usr/src/debug/kde-banana-kwin-git/kwin/src/backends/drm/drm_gpu.cpp:574
#5  0x00007f54e64790e0 in drmHandleEvent () from /usr/lib/libdrm.so.2
#6  0x00007f54e99c29ad in KWin::DrmGpu::dispatchEvents (this=<optimized out>) at /usr/src/debug/kde-banana-kwin-git/kwin/src/backends/drm/drm_gpu.cpp:582
#7  0x00007f54e6deb34f 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:461
#8  doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4257
#9  0x00007f54e6df63c0 in QMetaObject::activate<void, QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal> (sender=0x564727c837a0, mo=<optimized out>, local_signal_index=0, ret=0x0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs.h:319
#10 QSocketNotifier::activated (this=0x564727c837a0, _t1=..., _t2=<optimized out>, _t3=...) at /usr/src/debug/qt6-base/build/src/corelib/Core_autogen/include/moc_qsocketnotifier.cpp:161
#11 QSocketNotifier::event (this=0x564727c837a0, e=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qsocketnotifier.cpp:324
#12 0x00007f54e7e731c0 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x564727c837a0, e=0x7fff605c77c0) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3305
#13 0x00007f54e6d7e958 in QCoreApplication::notifyInternal2 (receiver=0x564727c837a0, event=0x7fff605c77c0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1109
#14 0x00007f54e6f41cb9 in QCoreApplication::sendEvent (receiver=<optimized out>, event=0x7fff605c77c0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1549
#15 QEventDispatcherUNIXPrivate::activateSocketNotifiers (this=this@entry=0x564727ab2fd0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_unix.cpp:276
#16 0x00007f54e6f4277c in QEventDispatcherUNIX::processEvents (this=<optimized out>, flags=..., flags@entry=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_unix.cpp:498
#17 0x00007f54e7ba5b73 in QUnixEventDispatcherQPA::processEvents (this=<optimized out>, flags=...) at /usr/src/debug/qt6-base/qtbase/src/gui/platform/unix/qunixeventdispatcher.cpp:28
#18 0x00007f54e6d89786 in QEventLoop::processEvents (this=0x7fff605c7990, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:104
#19 QEventLoop::exec (this=0x7fff605c7990, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:186
#20 0x00007f54e6d833f1 in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1452
#21 0x00007f54e7e6e32a in QApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2575
#22 0x000056472004dd1c in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kde-banana-kwin-git/kwin/src/main_wayland.cpp:634