swaywm / sway

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

Crash with evdev_update_key_down_count: Assertion `device->key_count[code] > 0' failed. #7610

Open rsidd120 opened 1 year ago

rsidd120 commented 1 year ago

Unfortunately I restarted sway without obtaining this. If it recurs, I will update.

This was after two months of uptime (I suspend the laptop, I don't shut down or reboot except after system upgrades). I just clicked on a firefox window addressbar that I have clicked on many times before.

The relevant error in the log file seems to be 369:35:23.415 [DEBUG] [wlr] [types/wlr_xdg_activation_v1.c:47] Activation token 'b9eb30d3c1899db3744d773927e3a308' has expired sway: ../src/evdev.c:138: evdev_update_key_down_count: Assertion `device->key_count[code] > 0' failed. Gdk-Message: 06:32:27.036: Error reading events from display: Broken pipe

emersion commented 1 year ago

Sounds like a libinput bug.

rsidd120 commented 1 year ago

Should it crash sway though? I understand that assertions help with debugging and also I was running a non-release sway version. Unfortunately this happened after an uptime of 2 months and I don't know how reproducible it is or whether it has been fixed already. I am now running sway version 1.8.1-68d620a8 (May 27 2023).

rsidd commented 1 year ago

It happened again today, twice. I misunderstood the comment above: the assertion is in libinput code, not in sway. I have recompiled libinput changing that assertion to an "if" for the following line; I don't know whether that is correct and should I report it upstream to libinput folks?

rsidd commented 1 year ago

I have reported it on libinput. Summary: Changing the assert in libinput to an if solves the issue and I don't see any more crashes or strange behaviour.