Open
Description
For a long time now, Waybar has been occasionally deadlocking. The root cause is that Waybar's signal handlers, defined here:
Lines 77 to 101 in 056295c
are not async-signal-safe.
Very few standard library functions are async-signal-safe (in C and in C++). Notably, memory allocation (as used here:
Line 302 in 056295c
The deadlock can be reproduced by toggling the bar (by sending SIGUSR1
) very fast. I used this shell script:
while true; do killall -SIGUSR1 waybar; done
On my computer, this deadlocks Waybar within 15 seconds, and spamming my "toggle bar" hotkey generally reduced this to 5 seconds.
Potentially related to #348