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

            Bug ID: 487306
           Summary: Nested kwin_wayland was unresponsive in VMs using the
                    virgl driver with an XWayland crash
    Classification: Plasma
           Product: kwin
           Version: 6.0.4
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: wayland-generic
          Assignee: kwin-bugs-n...@kde.org
          Reporter: matt.fagn...@bell.net
  Target Milestone: ---

SUMMARY

I booted the Fedora Rawhide/41 KDE Plasma live image
Fedora-KDE-Live-x86_64-Rawhide-20240518.n.0.iso in a QEMU/KVM VM using GNOME
Boxes with 3D acceleration enabled using the virgl driver from mesa 24.1.0-rc4.
Plasma 6.0.4 on Wayland started. I started Konsole. I tried to run a nested
kwin_wayland session using the instructions at
https://community.kde.org/KWin/Wayland
export $(dbus-launch)
kwin_wayland --xwayland 

The nested kwin_wayland window appeared but was unresponsive. The kwin_wayland
output in Konsole showed a crash in XWayland.

kwin_wayland --xwayland
No backend specified, automatically choosing Wayland because WAYLAND_DISPLAY is
set
unable to lock lockfile /run/user/1000/wayland-0.lock, maybe another compositor
is running
Accepting client connections on sockets: QList("wayland-1")
OpenGL vendor string:                   Mesa
OpenGL renderer string:                 virgl (AMD Radeon R5 Graphics
(radeonsi, carrizo, LLVM 18.1...)
OpenGL version string:                  4.3 (Core Profile) Mesa 24.1.0-rc4
OpenGL shading language version string: 4.30
Driver:                                 Unknown
GPU class:                              Unknown
OpenGL version:                         4.3
GLSL version:                           4.30
Mesa version:                           24.1
Requires strict binding:                no
Virtual Machine:                        no
Timer query support:                    yes
linux_dmabuf_feedback.main_device: Failed to fetch DRM device
linux_dmabuf_feedback.tranche_target_device: Failed to fetch DRM device
linux_dmabuf_feedback.tranche_target_device: Failed to fetch DRM device
(EE)
(EE) Backtrace:
(EE) 0: /usr/bin/Xwayland (0x557c2ad2d000+0x1660c2) [0x557c2ae930c2]
(EE) 1: /usr/bin/Xwayland (0x557c2ad2d000+0x1661c5) [0x557c2ae931c5]
(EE) 2: /lib64/libc.so.6 (0x7f55eb00c000+0x40750) [0x7f55eb04c750]
(EE) 3: /usr/bin/Xwayland (0x557c2ad2d000+0x41075) [0x557c2ad6e075]
(EE) 4: /usr/bin/Xwayland (0x557c2ad2d000+0x3466f) [0x557c2ad6166f]
(EE) 5: /usr/bin/Xwayland (0x557c2ad2d000+0x1fa76) [0x557c2ad4ca76]
(EE) 6: /lib64/libc.so.6 (0x7f55eb00c000+0x2a1c8) [0x7f55eb0361c8]
(EE) 7: /lib64/libc.so.6 (__libc_start_main+0x8b) [0x7f55eb03628b]
(EE) 8: /usr/bin/Xwayland (0x557c2ad2d000+0x224c5) [0x557c2ad4f4c5]
(EE)
(EE) Segmentation fault at address 0x8
(EE)
Fatal server error:
(EE) Caught signal 11 (Segmentation fault). Server aborting
(EE)

The Xwayland crash was in xwl_glamor_gbm_init_main_dev in frame 10 from
xorg-x11-server-Xwayland-24.1.0-1.fc41. The crashing line in
xwl_glamor_gbm_init_main_dev had a null pointer main_dev so
main_dev->available_nodes looked like a null pointer dereference. 

Core was generated by `/usr/bin/Xwayland :1 -listenfd 61 -listenfd 62
-displayfd 52 -rootless -wm 56'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill_implementation (threadid=<optimized out>,
signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
Downloading source file
/usr/src/debug/glibc-2.39.9000-18.fc41.x86_64/nptl/pthread_kill.c
44            return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO
(ret) : 0;
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>,
signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007f55eb0a41f3 in __pthread_kill_internal (threadid=<optimized out>,
signo=6) at pthread_kill.c:78
#2  0x00007f55eb04c69e in __GI_raise (sig=sig@entry=6) at
../sysdeps/posix/raise.c:26
#3  0x00007f55eb034942 in __GI_abort () at abort.c:79
#4  0x0000557c2ae9c86a in OsAbort () at ../os/utils.c:1283
#5  0x0000557c2ae9caee in AbortServer () at ../os/log.c:892
#6  FatalError (f=<optimized out>) at ../os/log.c:1030
#7  0x0000557c2ae93222 in OsSigHandler (unused=<optimized out>, signo=11,
sip=<optimized out>) at ../os/osinit.c:156
#8  OsSigHandler (signo=11, sip=<optimized out>, unused=<optimized out>) at
../os/osinit.c:110
#9  <signal handler called>
#10 xwl_glamor_gbm_init_main_dev (xwl_screen=<optimized out>) at
../hw/xwayland/xwayland-glamor-gbm.c:1517
#11 xwl_glamor_gbm_init_egl (xwl_screen=<optimized out>) at
../hw/xwayland/xwayland-glamor-gbm.c:1552
#12 xwl_glamor_init (xwl_screen=0x557c42ab86d0) at
../hw/xwayland/xwayland-glamor.c:232
#13 0x0000557c2ad6166f in xwl_screen_init (pScreen=0x557c42ab8040,
argc=<optimized out>, argv=<optimized out>) at
../hw/xwayland/xwayland-screen.c:1109
#14 0x0000557c2ad4ca76 in AddScreen (pfnInit=<optimized out>, argc=<optimized
out>, argv=<optimized out>) at ../dix/dispatch.c:3993
#15 InitOutput (screen_info=<optimized out>, argc=<optimized out>,
argv=<optimized out>) at ../hw/xwayland/xwayland.c:455
#16 dix_main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>)
at ../dix/main.c:193
#17 main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at
../dix/stubmain.c:34
(gdb) frame 10
#10 xwl_glamor_gbm_init_main_dev (xwl_screen=<optimized out>) at
../hw/xwayland/xwayland-glamor-gbm.c:1517
Downloading source file
/usr/src/debug/xorg-x11-server-Xwayland-24.1.0-1.fc41.x86_64/redhat-linux-build/../hw/xwayland/xwayland-glamor-gbm.c
1517        if (!(main_dev->available_nodes & (1 << DRM_NODE_RENDER))) {
(gdb) p main_dev
$1 = (drmDevice *) 0x0
(gdb) p main_dev->available_nodes
Cannot access memory at address 0x8

The errors in the kwin_wayland output like "linux_dmabuf_feedback.main_device:
Failed to fetch DRM device" might be related. The problem happened 3/3 times I
ran kwin_wayland --xwayland. The problem didn't happen when I ran nested
kwin_wayland without the --xwayland option.

STEPS TO REPRODUCE
1. Boot a Fedora 40 KDE Plasma installation updated to 2024-5-20 with
updates-testing enabled
2. Log in to Plasma 6.0.4 on Wayland
3. Start Konsole
4. Install GNOME Boxes if it isn't already with sudo dnf install gnome-boxes
5. Download Fedora-KDE-Live-x86_64-Rawhide-20240518.n.0.iso from
https://koji.fedoraproject.org/koji/buildinfo?buildID=2453143 
6. Start GNOME Boxes
7. Boot Fedora-KDE-Live-x86_64-Rawhide-20240518.n.0.iso in a GNOME Boxes
QEMU/KVM VM with 3 GiB RAM, UEFI enabled, and 3D acceleration enabled
8. Start Konsole
9. In Konsole, run 
export $(dbus-launch)
kwin_wayland --xwayland 

OBSERVED RESULT
Nested kwin_wayland was unresponsive in VMs using the virgl driver with an
XWayland crash

EXPECTED RESULT
Nested kwin_wayland would be responsive in VMs using the virgl driver and
Xwayland wouldn't crash.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Rawhide
(available in About System)
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION

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

Reply via email to