Xwayland: null pointer dereference in `xwl_glamor_gbm_init_main_dev`
Only happens in nested kwin wayland compositor:
kwin_wayland 'Xwayland :10'
- kwin version - 6.0.5
- xwayland - 1126d55f
Xwayland 23.2.7 doesn't crash
(II) Raising the file descriptors limit to 524288
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: build/hw/xwayland/Xwayland (0x623fdb6d7000+0x21b460) [0x623fdb8f2460]
(EE) 1: build/hw/xwayland/Xwayland (0x623fdb6d7000+0x2205f3) [0x623fdb8f75f3]
(EE) 2: /usr/lib/libc.so.6 (0x7a838e42c000+0x3cae0) [0x7a838e468ae0]
(EE) 3: build/hw/xwayland/Xwayland (0x623fdb6d7000+0x55830) [0x623fdb72c830]
(EE) 4: build/hw/xwayland/Xwayland (0x623fdb6d7000+0x5598a) [0x623fdb72c98a]
(EE) 5: build/hw/xwayland/Xwayland (0x623fdb6d7000+0x505ad) [0x623fdb7275ad]
(EE) 6: build/hw/xwayland/Xwayland (0x623fdb6d7000+0x42082) [0x623fdb719082]
(EE) 7: build/hw/xwayland/Xwayland (0x623fdb6d7000+0xe010c) [0x623fdb7b710c]
(EE) 8: build/hw/xwayland/Xwayland (0x623fdb6d7000+0x31360) [0x623fdb708360]
(EE) 9: build/hw/xwayland/Xwayland (0x623fdb6d7000+0xe591b) [0x623fdb7bc91b]
(EE) 10: build/hw/xwayland/Xwayland (0x623fdb6d7000+0x56e27) [0x623fdb72de27]
(EE) 11: /usr/lib/libc.so.6 (0x7a838e42c000+0x25c88) [0x7a838e451c88]
(EE) 12: /usr/lib/libc.so.6 (__libc_start_main+0x8c) [0x7a838e451d4c]
(EE) 13: build/hw/xwayland/Xwayland (0x623fdb6d7000+0x2ffd5) [0x623fdb706fd5]
(EE)
(EE) Segmentation fault at address 0x8
(EE)
Fatal server error:
(EE) Caught signal 11 (Segmentation fault). Server aborting
(EE)
Thread 1 (Thread 0x7ffff6c9f9c0 (LWP 9737) "Xwayland"):
#0 0x00005555555a9830 in xwl_glamor_gbm_init_main_dev (xwl_screen=0x5555558a7100) at ../hw/xwayland/xwayland-glamor-gbm.c:1517
xwl_gbm = 0x5555558aca80
main_dev = 0x0
#1 0x00005555555a998a in xwl_glamor_gbm_init_egl (xwl_screen=0x5555558a7100) at ../hw/xwayland/xwayland-glamor-gbm.c:1552
xwl_gbm = 0x5555558aca80
major = -8240
minor = 32767
renderer = 0x7fffffffdfc0 "\360\337\377\377\377\177"
gbm_backend_name = 0x5555555a41e2 <xwl_glamor_has_wl_interfaces+24> "\205\300u4H\213E\370\213\200\250\001"
egl_vendor = 0x60 <error: Cannot access memory at address 0x60>
#2 0x00005555555a45ad in xwl_glamor_init (xwl_screen=0x5555558a7100) at ../hw/xwayland/xwayland-glamor.c:232
screen = 0x5555558a6a70
no_glamor_env = 0x0
#3 0x0000555555596082 in xwl_screen_init (pScreen=0x5555558a6a70, argc=2, argv=0x7fffffffe308) at ../hw/xwayland/xwayland-screen.c:1109
allow_commits = "_XWAYLAND_ALLOW_COMMITS"
xwl_screen = 0x5555558a7100
red_mask = 16711680
blue_mask = 255
green_mask = 65280
ret = 1
bpc = 8
green_bpc = 8
i = 2
xwl_width = 640
xwl_height = 480
use_fixed_size = 1
#4 0x000055555563410c in AddScreen (pfnInit=0x55555559548a <xwl_screen_init>, argc=2, argv=0x7fffffffe308) at ../dix/dispatch.c:3993
i = 0
pScreen = 0x5555558a6a70
ret = 0
#5 0x0000555555585360 in InitOutput (screen_info=0x555555879fc0 <screenInfo>, argc=2, argv=0x7fffffffe308) at ../hw/xwayland/xwayland.c:455
depths = {1, 4, 8, 15, 16, 24, 32}
bpp = {1, 8, 8, 16, 16, 32, 32}
i = 7
#6 0x000055555563991b in dix_main (argc=2, argv=0x7fffffffe308, envp=0x7fffffffe320) at ../dix/main.c:193
i = 256
alwaysCheckForInput = {0, 1}
#7 0x00005555555aae27 in main (argc=2, argv=0x7fffffffe308, envp=0x7fffffffe320) at ../dix/stubmain.c:34