swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.24k stars 1.08k forks source link

Segfault on USB keyboard reconnection #6270

Closed ar3s3ru closed 3 years ago

ar3s3ru commented 3 years ago

Please read the following before submitting:

Please fill out the following:

From journalctl -xef I can see that sway fails on xkb_keymap_num_layouts on libxkbcommon library. It seems to be related to the fact that, upon reconnection, the keyboard seems to communicate a number of keycodes higher than the library supports (might be wrong here, I have no clue about how this library or these systems work):

May 13 17:36:45 ar3s3ru-latitude5320 kernel: usb 3-4: USB disconnect, device number 40
May 13 17:36:47 ar3s3ru-latitude5320 kernel: usb 3-4: new full-speed USB device number 41 using xhci_hcd
May 13 17:36:47 ar3s3ru-latitude5320 /usr/lib/gdm-wayland-session[206619]: [2021-05-13 17:36:47.371] [error] mpd: Failed to connect to MPD: Connection refused
May 13 17:36:47 ar3s3ru-latitude5320 /usr/lib/gdm-wayland-session[206619]: [2021-05-13 17:36:47.371] [error] mpd: Failed to connect to MPD: Connection refused
May 13 17:36:47 ar3s3ru-latitude5320 kernel: usb 3-4: New USB device found, idVendor=feed, idProduct=6061, bcdDevice= 0.03
May 13 17:36:47 ar3s3ru-latitude5320 kernel: usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
May 13 17:36:47 ar3s3ru-latitude5320 kernel: usb 3-4: Product: Preonic
May 13 17:36:47 ar3s3ru-latitude5320 kernel: usb 3-4: Manufacturer: OLKB
May 13 17:36:47 ar3s3ru-latitude5320 kernel: usb 3-4: SerialNumber: 0
May 13 17:36:47 ar3s3ru-latitude5320 kernel: input: OLKB Preonic as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.0/0003:FEED:6061.003B/input/input92
May 13 17:36:47 ar3s3ru-latitude5320 kernel: hid-generic 0003:FEED:6061.003B: input,hidraw1: USB HID v1.11 Keyboard [OLKB Preonic] on usb-0000:00:14.0-4/input0
May 13 17:36:47 ar3s3ru-latitude5320 kernel: input: OLKB Preonic as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.1/0003:FEED:6061.003C/input/input93
May 13 17:36:47 ar3s3ru-latitude5320 kernel: hid-generic 0003:FEED:6061.003C: input,hidraw2: USB HID v1.11 Mouse [OLKB Preonic] on usb-0000:00:14.0-4/input1
May 13 17:36:47 ar3s3ru-latitude5320 kernel: input: OLKB Preonic System Control as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.2/0003:FEED:6061.003D/input/input94
May 13 17:36:47 ar3s3ru-latitude5320 kernel: input: OLKB Preonic Consumer Control as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.2/0003:FEED:6061.003D/input/input95
May 13 17:36:47 ar3s3ru-latitude5320 kernel: hid-generic 0003:FEED:6061.003D: input,hidraw3: USB HID v1.11 Device [OLKB Preonic] on usb-0000:00:14.0-4/input2
May 13 17:36:47 ar3s3ru-latitude5320 kernel: hid-generic 0003:FEED:6061.003E: hiddev96,hidraw4: USB HID v1.11 Device [OLKB Preonic] on usb-0000:00:14.0-4/input3
May 13 17:36:47 ar3s3ru-latitude5320 kernel: input: OLKB Preonic as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.4/0003:FEED:6061.003F/input/input96
May 13 17:36:47 ar3s3ru-latitude5320 kernel: hid-generic 0003:FEED:6061.003F: input,hidraw5: USB HID v1.11 Keyboard [OLKB Preonic] on usb-0000:00:14.0-4/input4
May 13 17:36:47 ar3s3ru-latitude5320 upowerd[930]: treating change event as add on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-4
May 13 17:36:47 ar3s3ru-latitude5320 systemd-logind[754]: Watching system buttons on /dev/input/event29 (OLKB Preonic System Control)
May 13 17:36:47 ar3s3ru-latitude5320 systemd-logind[754]: Watching system buttons on /dev/input/event30 (OLKB Preonic Consumer Control)
May 13 17:36:47 ar3s3ru-latitude5320 systemd-logind[754]: Watching system buttons on /dev/input/event26 (OLKB Preonic)
May 13 17:36:47 ar3s3ru-latitude5320 systemd-logind[754]: Watching system buttons on /dev/input/event31 (OLKB Preonic)
May 13 17:36:47 ar3s3ru-latitude5320 audit[206597]: ANOM_ABEND auid=1000 uid=1000 gid=1000 ses=27 pid=206597 comm="sway" exe="/usr/bin/sway" sig=11 res=1
May 13 17:36:47 ar3s3ru-latitude5320 /usr/lib/gdm-wayland-session[222193]: The XKEYBOARD keymap compiler (xkbcomp) reports:
May 13 17:36:47 ar3s3ru-latitude5320 /usr/lib/gdm-wayland-session[222193]: > Warning:          Unsupported maximum keycode 569, clipping.
May 13 17:36:47 ar3s3ru-latitude5320 /usr/lib/gdm-wayland-session[222193]: >                   X11 cannot support keycodes above 255.
May 13 17:36:47 ar3s3ru-latitude5320 /usr/lib/gdm-wayland-session[222193]: Errors from xkbcomp are not fatal to the X server
May 13 17:36:47 ar3s3ru-latitude5320 kernel: sway[206597]: segfault at 1d4 ip 00007fdf4143e5a0 sp 00007ffee428a648 error 4 in libxkbcommon.so.0.0.0[7fdf41426000+1f000]
May 13 17:36:47 ar3s3ru-latitude5320 kernel: Code: 3b 08 74 13 41 83 c0 01 48 83 c0 0c 44 39 c2 75 e9 41 b8 ff ff ff ff 48 83 c4 08 44 89 c0 5b 5d c3 66 0f 1f 84 00 00 00 00 00 <8b> 87 d4 01 00 00 c3 66 0f 1f 84 00 00 00 00 00 39 b7 d8 01 00 00
May 13 17:36:47 ar3s3ru-latitude5320 kernel: audit: type=1701 audit(1620920207.773:1191): auid=1000 uid=1000 gid=1000 ses=27 pid=206597 comm="sway" exe="/usr/bin/sway" sig=11 res=1
May 13 17:36:47 ar3s3ru-latitude5320 audit: BPF prog-id=201 op=LOAD
May 13 17:36:47 ar3s3ru-latitude5320 audit: BPF prog-id=202 op=LOAD
May 13 17:36:47 ar3s3ru-latitude5320 audit: BPF prog-id=203 op=LOAD
May 13 17:36:47 ar3s3ru-latitude5320 systemd[1]: Started Process Core Dump (PID 222194/UID 0).
░░ Subject: A start job for unit systemd-coredump@7-222194-0.service has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit systemd-coredump@7-222194-0.service has finished successfully.
░░
░░ The job identifier is 14151.
May 13 17:36:47 ar3s3ru-latitude5320 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@7-222194-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 13 17:36:47 ar3s3ru-latitude5320 kernel: audit: type=1334 audit(1620920207.779:1192): prog-id=201 op=LOAD
May 13 17:36:47 ar3s3ru-latitude5320 kernel: audit: type=1334 audit(1620920207.779:1193): prog-id=202 op=LOAD
May 13 17:36:47 ar3s3ru-latitude5320 kernel: audit: type=1334 audit(1620920207.779:1194): prog-id=203 op=LOAD
May 13 17:36:47 ar3s3ru-latitude5320 kernel: audit: type=1130 audit(1620920207.779:1195): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@7-222194-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 13 17:36:48 ar3s3ru-latitude5320 systemd-coredump[222197]: [🡕] Process 206597 (sway) of user 1000 dumped core.

                                                               Stack trace of thread 206597:
                                                               #0  0x00007fdf4143e5a0 xkb_keymap_num_layouts (libxkbcommon.so.0 + 0x1d5a0)
                                                               #1  0x000055e5856de9b6 n/a (sway + 0x139b6)
                                                               #2  0x000055e5856e4b82 n/a (sway + 0x19b82)
                                                               #3  0x000055e5856fcaf1 n/a (sway + 0x31af1)
                                                               #4  0x00007fdf414dc2ce n/a (libwlroots.so.8 + 0x732ce)
                                                               #5  0x00007fdf414dc2ce n/a (libwlroots.so.8 + 0x732ce)
                                                               #6  0x00007fdf414a3bfe n/a (libwlroots.so.8 + 0x3abfe)
                                                               #7  0x00007fdf4152b07a wl_event_loop_dispatch (libwayland-server.so.0 + 0xb07a)
                                                               #8  0x00007fdf41528be7 wl_display_run (libwayland-server.so.0 + 0x8be7)
                                                               #9  0x000055e5856db8db n/a (sway + 0x108db)
                                                               #10 0x00007fdf41240b25 __libc_start_main (libc.so.6 + 0x27b25)
                                                               #11 0x000055e5856dbc5e n/a (sway + 0x10c5e)

                                                               Stack trace of thread 206599:
                                                               #0  0x00007fdf4120b9ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                                               #1  0x00007fdf41205260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                                               #2  0x00007fdf3ecaa0dc n/a (iris_dri.so + 0x1c70dc)
                                                               #3  0x00007fdf3eca3ff8 n/a (iris_dri.so + 0x1c0ff8)
                                                               #4  0x00007fdf411ff299 start_thread (libpthread.so.0 + 0x9299)
                                                               #5  0x00007fdf41318053 __clone (libc.so.6 + 0xff053)

                                                               Stack trace of thread 206601:
                                                               #0  0x00007fdf4120b9ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                                               #1  0x00007fdf41205260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                                               #2  0x00007fdf3ecaa0dc n/a (iris_dri.so + 0x1c70dc)
                                                               #3  0x00007fdf3eca3ff8 n/a (iris_dri.so + 0x1c0ff8)
                                                               #4  0x00007fdf411ff299 start_thread (libpthread.so.0 + 0x9299)
                                                               #5  0x00007fdf41318053 __clone (libc.so.6 + 0xff053)

                                                               Stack trace of thread 206600:
                                                               #0  0x00007fdf4120b9ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                                               #1  0x00007fdf41205260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                                               #2  0x00007fdf3ecaa0dc n/a (iris_dri.so + 0x1c70dc)
                                                               #3  0x00007fdf3eca3ff8 n/a (iris_dri.so + 0x1c0ff8)
                                                               #4  0x00007fdf411ff299 start_thread (libpthread.so.0 + 0x9299)
                                                               #5  0x00007fdf41318053 __clone (libc.so.6 + 0xff053)

                                                               Stack trace of thread 206602:
                                                               #0  0x00007fdf4120b9ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                                               #1  0x00007fdf41205260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                                               #2  0x00007fdf3ecaa0dc n/a (iris_dri.so + 0x1c70dc)
                                                               #3  0x00007fdf3eca3ff8 n/a (iris_dri.so + 0x1c0ff8)
                                                               #4  0x00007fdf411ff299 start_thread (libpthread.so.0 + 0x9299)
                                                               #5  0x00007fdf41318053 __clone (libc.so.6 + 0xff053)

                                                               Stack trace of thread 206603:
                                                               #0  0x00007fdf4120b9ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                                               #1  0x00007fdf41205260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                                               #2  0x00007fdf3ecaa0dc n/a (iris_dri.so + 0x1c70dc)
                                                               #3  0x00007fdf3eca3ff8 n/a (iris_dri.so + 0x1c0ff8)
                                                               #4  0x00007fdf411ff299 start_thread (libpthread.so.0 + 0x9299)
                                                               #5  0x00007fdf41318053 __clone (libc.so.6 + 0xff053)

                                                               Stack trace of thread 206604:
                                                               #0  0x00007fdf4120b9ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                                               #1  0x00007fdf41205260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                                               #2  0x00007fdf3ecaa0dc n/a (iris_dri.so + 0x1c70dc)
                                                               #3  0x00007fdf3eca3ff8 n/a (iris_dri.so + 0x1c0ff8)
                                                               #4  0x00007fdf411ff299 start_thread (libpthread.so.0 + 0x9299)
                                                               #5  0x00007fdf41318053 __clone (libc.so.6 + 0xff053)

                                                               Stack trace of thread 206609:
                                                               #0  0x00007fdf4120b9ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                                               #1  0x00007fdf41205260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                                               #2  0x00007fdf3ecaa0dc n/a (iris_dri.so + 0x1c70dc)
                                                               #3  0x00007fdf3eca3ff8 n/a (iris_dri.so + 0x1c0ff8)
                                                               #4  0x00007fdf411ff299 start_thread (libpthread.so.0 + 0x9299)
                                                               #5  0x00007fdf41318053 __clone (libc.so.6 + 0xff053)

                                                               Stack trace of thread 206605:
                                                               #0  0x00007fdf4120b9ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                                               #1  0x00007fdf41205260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                                               #2  0x00007fdf3ecaa0dc n/a (iris_dri.so + 0x1c70dc)
                                                               #3  0x00007fdf3eca3ff8 n/a (iris_dri.so + 0x1c0ff8)
                                                               #4  0x00007fdf411ff299 start_thread (libpthread.so.0 + 0x9299)
                                                               #5  0x00007fdf41318053 __clone (libc.so.6 + 0xff053)

                                                               Stack trace of thread 206606:
                                                               #0  0x00007fdf4120b9ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                                               #1  0x00007fdf41205260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                                               #2  0x00007fdf3ecaa0dc n/a (iris_dri.so + 0x1c70dc)
                                                               #3  0x00007fdf3eca3ff8 n/a (iris_dri.so + 0x1c0ff8)
                                                               #4  0x00007fdf411ff299 start_thread (libpthread.so.0 + 0x9299)
                                                               #5  0x00007fdf41318053 __clone (libc.so.6 + 0xff053)

                                                               Stack trace of thread 206611:
                                                               #0  0x00007fdf4120b9ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                                               #1  0x00007fdf41205260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                                               #2  0x00007fdf3ecaa0dc n/a (iris_dri.so + 0x1c70dc)
                                                               #3  0x00007fdf3eca3ff8 n/a (iris_dri.so + 0x1c0ff8)
                                                               #4  0x00007fdf411ff299 start_thread (libpthread.so.0 + 0x9299)
                                                               #5  0x00007fdf41318053 __clone (libc.so.6 + 0xff053)

                                                               Stack trace of thread 206612:
                                                               #0  0x00007fdf4120b9ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                                               #1  0x00007fdf41205260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                                               #2  0x00007fdf3ecaa0dc n/a (iris_dri.so + 0x1c70dc)
                                                               #3  0x00007fdf3eca3ff8 n/a (iris_dri.so + 0x1c0ff8)
                                                               #4  0x00007fdf411ff299 start_thread (libpthread.so.0 + 0x9299)
                                                               #5  0x00007fdf41318053 __clone (libc.so.6 + 0xff053)

                                                               Stack trace of thread 206608:
                                                               #0  0x00007fdf4120b9ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                                               #1  0x00007fdf41205260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                                               #2  0x00007fdf3ecaa0dc n/a (iris_dri.so + 0x1c70dc)
                                                               #3  0x00007fdf3eca3ff8 n/a (iris_dri.so + 0x1c0ff8)
                                                               #4  0x00007fdf411ff299 start_thread (libpthread.so.0 + 0x9299)
                                                               #5  0x00007fdf41318053 __clone (libc.so.6 + 0xff053)

                                                               Stack trace of thread 206615:
                                                               #0  0x00007fdf4120b9ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                                               #1  0x00007fdf41205260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                                               #2  0x00007fdf3ecaa0dc n/a (iris_dri.so + 0x1c70dc)
                                                               #3  0x00007fdf3eca3ff8 n/a (iris_dri.so + 0x1c0ff8)
                                                               #4  0x00007fdf411ff299 start_thread (libpthread.so.0 + 0x9299)
                                                               #5  0x00007fdf41318053 __clone (libc.so.6 + 0xff053)

                                                               Stack trace of thread 206610:
                                                               #0  0x00007fdf4120b9ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                                               #1  0x00007fdf41205260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                                               #2  0x00007fdf3ecaa0dc n/a (iris_dri.so + 0x1c70dc)
                                                               #3  0x00007fdf3eca3ff8 n/a (iris_dri.so + 0x1c0ff8)
                                                               #4  0x00007fdf411ff299 start_thread (libpthread.so.0 + 0x9299)
                                                               #5  0x00007fdf41318053 __clone (libc.so.6 + 0xff053)

                                                               Stack trace of thread 206613:
                                                               #0  0x00007fdf4120b9ba __futex_abstimed_wait_common64 (libpthread.so.0 + 0x159ba)
                                                               #1  0x00007fdf41205260 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf260)
                                                               #2  0x00007fdf3ecaa0dc n/a (iris_dri.so + 0x1c70dc)
                                                               #3  0x00007fdf3eca3ff8 n/a (iris_dri.so + 0x1c0ff8)
                                                               #4  0x00007fdf411ff299 start_thread (libpthread.so.0 + 0x9299)
                                                               #5  0x00007fdf41318053 __clone (libc.so.6 + 0xff053)

                                                               Stack trace of thread 206824:
                                                               #0  0x00007fdf4130d37f __poll (libc.so.6 + 0xf437f)
                                                               #1  0x00007fdf4170dae8 n/a (/usr/lib/libglib-2.0.so.0.6800.1 (deleted) + 0xa7ae8)
fluix-dev commented 3 years ago

Your stack trace is missing debug symbols. You can get symbols by compiling from source, reproducing the crash and then running coredumpctl gdb and then bt full.

Here are some instructions to compile from source: https://github.com/swaywm/sway/wiki/Development-Setup#compiling-as-a-subproject

ar3s3ru commented 3 years ago

Closing this as it's not happening anymore on latest release. Thanks again for the quick answer 💯