Segfault in wlr_keyboard_set_keymap()
Steps to reproduce:
- Start a nested wlroots compositor (tested with tinywl)
- Reproducible with both Sway and Weston as host compositors.
- Switch TTY
- Switch back to the host compositor
Thread 1 "tinywl" received signal SIGSEGV, Segmentation fault.
get_meta (p=p@entry=0x7fffeb48f2c0 "") at src/malloc/mallocng/meta.h:141
141 src/malloc/mallocng/meta.h: No such file or directory.
(gdb) bt
#0 get_meta (p=p@entry=0x7fffeb48f2c0 "") at src/malloc/mallocng/meta.h:141
#1 0x00007ffff7f8ac2e in __libc_free (p=0x7fffeb48f2c0) at src/malloc/mallocng/free.c:105
#2 0x00007ffff7e18844 in xkb_keymap_unref () from /usr/lib/libxkbcommon.so.0
#3 0x00007ffff7ee718b in wlr_keyboard_set_keymap (kb=0x7ffff77e7080, keymap=0x7fffeb0556b0) at ../types/wlr_keyboard.c:168
#4 0x0000555555556bdb in server_new_keyboard (server=0x7fffffffe730, device=0x7ffff77e7080) at ../tinywl/tinywl.c:247
#5 0x0000555555556d46 in server_new_input (listener=0x7fffffffe818, data=0x7ffff77e7080) at ../tinywl/tinywl.c:283
#6 0x00007ffff7f075c5 in wlr_signal_emit_safe (signal=0x7ffff7dffc48, data=0x7ffff77e7080) at ../util/signal.c:29
#7 0x00007ffff7eb0760 in new_input_reemit (listener=0x7ffff7d22d60, data=0x7ffff77e7080) at ../backend/multi/backend.c:164
#8 0x00007ffff7f075c5 in wlr_signal_emit_safe (signal=0x7ffff7ffe6f8, data=0x7ffff77e7080) at ../util/signal.c:29
#9 0x00007ffff7eb5591 in init_seat_keyboard (seat=0x7ffff77e7060) at ../backend/wayland/seat.c:116
#10 0x00007ffff7eb5f8d in seat_handle_capabilities (data=0x7ffff77e7060, wl_seat=0x7ffff7c30c90, caps=WL_SEAT_CAPABILITY_KEYBOARD) at ../backend/wayland/seat.c:317
#11 0x00007ffff7b847ea in ?? () from /usr/lib/libffi.so.8
#12 0x00007ffff7b839d5 in ?? () from /usr/lib/libffi.so.8
#13 0x00007ffff7bb06e1 in wl_closure_invoke (closure=closure@entry=0x7fffeb031880, flags=flags@entry=1, target=<optimized out>, target@entry=0x7ffff7c30c90, opcode=opcode@entry=0, data=<optimized out>)
at ../src/connection.c:1027
#14 0x00007ffff7bacb5a in dispatch_event (display=display@entry=0x7ffff7ffe560, queue=<optimized out>, queue=<optimized out>) at ../src/wayland-client.c:1595
#15 0x00007ffff7bae3ec in dispatch_queue (queue=0x7ffff7ffe630, display=0x7ffff7ffe560) at ../src/wayland-client.c:1741
#16 wl_display_dispatch_queue_pending (display=0x7ffff7ffe560, queue=0x7ffff7ffe630) at ../src/wayland-client.c:1983
#17 0x00007ffff7eb1104 in dispatch_events (fd=6, mask=1, data=0x7ffff7ffe6e0) at ../backend/wayland/backend.c:67
#18 0x00007ffff7e4b78a in wl_event_loop_dispatch (loop=0x7ffff7dffb80, timeout=timeout@entry=-1) at ../src/event-loop.c:1027
#19 0x00007ffff7e493b5 in wl_display_run (display=0x7ffff7f60e40) at ../src/wayland-server.c:1408
#20 0x00005555555582b6 in main (argc=1, argv=0x7fffffffe928) at ../tinywl/tinywl.c:905
Edited by Kirill Primak