Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swaylock: Sway crashes when unplugging keyboard, if any options are used #5205

Closed
aqxa1 opened this issue Apr 11, 2020 · 3 comments · Fixed by swaywm/wlroots#2110
Closed

Comments

@aqxa1
Copy link

aqxa1 commented Apr 11, 2020

  • Problem
    If I unplug my keyboard when swaylock is awaiting input, sway crashes and it crashes severely enough that I need to reboot through SSH (or use sysrq). This only occurs if I configure the keyboard with any options like repeat_rate, xkb_options, etc. If I include an empty configuration like this:
input "1155:20518:CATEX_TECH._75EC-S" {
}

then the crash doesn't occur. It's also okay if I don't specify the input at all. The debug log I've attached includes configurations for multiple detected input devices: "1155:20518:CATEX_TECH._75EC-S" and "1155:20518:CATEX_TECH._75EC-S_Keyboard" however specifying just one of these still triggers the bug. I also tested a different keyboard and can trigger the bug with that keyboard as well. In sum to reproduce:

  1. Configure keyboard with any options
  2. Run swaylock
  3. Unplug keyboard
  • Sway Version:
    sway version 1.4-4d13cee5 (Apr 11 2020, branch 'HEAD')

  • Debug Log: Debug log Gist

  • Configuration File: Config gist

  • Stack Trace, if sway crashes:
    Attaching to sway and/or swaylock appears to prevent keyboard input completely (or is extremely slow). Will try again later if needed. I don't have coredumpctl as an option since I don't use systemd.

@r-c-f
Copy link
Contributor

r-c-f commented Apr 12, 2020

This is also easily triggered with the virtual keyboard -- something like this works with the wayland backend, avoiding the need to disconnect anything and ruin one's primary session in the process.

r-c-f added a commit to r-c-f/wlroots that referenced this issue Apr 12, 2020
Check for a NULL keyboard_state.keyboard value in
seat_client_create_keyboard() before trying to use it, as is done in
other functions like seat_client_send_repeat_info(). Prevents a segfault
in certain situations on keyboard removal, as seen in the sway issue
(swaywm/sway#5205)
@aqxa1
Copy link
Author

aqxa1 commented Apr 13, 2020

@r-c-f Just tested the wlroots PR and it looks to fix the issue on my end.

emersion pushed a commit to swaywm/wlroots that referenced this issue Apr 14, 2020
Check for a NULL keyboard_state.keyboard value in
seat_client_create_keyboard() before trying to use it, as is done in
other functions like seat_client_send_repeat_info(). Prevents a segfault
in certain situations on keyboard removal, as seen in the sway issue.

Closes: swaywm/sway#5205
Closes: #2073
@ficcdaf
Copy link

ficcdaf commented Jan 18, 2024

I am having the same issue in 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants