alacritty: Deadlock when holding keys with high repeat rate
Linux X11
Alacritty version: alacritty 0.3.3-rc2 (58e2365)
TERM: xterm-256color
Sometimes (very seldom and you should try to break it) alacritty
starts rendering characters in a wrong position.
I’ve entered fullscreen pressed l
and then enter
, you can easily notice the difference between the command I’ve typed and the command that was not found
.
This issue happens very randomly. Can “probably” be reproduced by opening alacritty
and holding random key. You’ll probably should load your system (e.g. multiple yes >> /dev/null
) and set key repeat rate to e.g. xset r rate 90
(xset r rate 30
is enough, its just very slow to test it).
I think its something related to synchronization. I was able to get deadlock while testing this one. The gdb
info threads
for this app.
(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7fcf0478ea00 (LWP 4653) "alacritty" 0x00007fcf04f340d1 in poll () from /usr/lib/libc.so.6
2 Thread 0x7fcefc160700 (LWP 4708) "alacritty:cs0" 0x00007fcf05030bac in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
3 Thread 0x7fcefb809700 (LWP 4709) "alacrit:disk$0" 0x00007fcf05030bac in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
4 Thread 0x7fcefb008700 (LWP 4710) "alacritty:sh0" 0x00007fcf05030bac in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
5 Thread 0x7fcefa807700 (LWP 4711) "alacritty:sh1" 0x00007fcf05030bac in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
6 Thread 0x7fcefa006700 (LWP 4712) "alacritty:sh2" 0x00007fcf05030bac in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
7 Thread 0x7fcef9805700 (LWP 4713) "alacritt:shlo0" 0x00007fcf05030bac in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
8 Thread 0x7fcef9004700 (LWP 4714) "alacritt:shlo1" 0x00007fcf05030bac in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
9 Thread 0x7fcedbfff700 (LWP 4715) "alacritt:gdrv0" 0x00007fcf05030bac in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
10 Thread 0x7fcedad74700 (LWP 4716) "alacritty" 0x00007fcf04f340d1 in poll () from /usr/lib/libc.so.6
11 Thread 0x7fcedab73700 (LWP 4717) "alacritty" 0x00007fcf04f340d1 in poll () from /usr/lib/libc.so.6
12 Thread 0x7fceda972700 (LWP 4719) "config watcher" 0x00007fcf05030bac in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
13 Thread 0x7fceda771700 (LWP 4720) "pty reader" 0x00007fcf04f3f007 in epoll_wait () from /usr/lib/libc.so.6
14 Thread 0x7fceda570700 (LWP 4721) "config watcher" 0x00007fcf05030bac in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
15 Thread 0x7fceda36f700 (LWP 4722) "config watcher" 0x00007fcf04f3f007 in epoll_wait () from /usr/lib/libc.so.6
I’ve initially reproduce it on #2438 . But then discover it on master.
P.s. If any information about locked instance is required, I can provide it ( I’ll keep it running unless I randomly kill it).
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 30 (30 by maintainers)
@chrisduerr I’ve just put a bottle of beer on a keyboard and went to sleep, so I’ve cheated 🍺.
Can we get an
rr
capture of the repro? Might make it easier to trace where the deadlock is coming from.@chrisduerr After a bunch of test in different terminal emulators I was able to reproduce missing characters ( Got it in
kitty
andkonsole
, I wasn’t patient enough at my first attempt, this time after ~30 minutes of pressing characters I was able to reproduce the bug). So the original issue probably should be closed and reported tofish
shell. To ensure this I’ve also retestedzsh
for ~1 hour and didn’t get this behavior inalacritty
.However, the detected
deadlock
, which happens regardless ofSHELL
, looks like our or our dependencies’ problem and needs to be investigated.Should I close this issue and create a new one about
deadlock
or edit this one somehow?I was able to reproduce with
v0.3.2
(got deadlock) and wasn’t able withkitty
.I’ve just posted output of
alacritty --version
, but sure, I’ll check earlier version + other terminal emulators.