MichalW / gnome-bluetooth-battery-indicator

Gnome-Shell extension displaying battery percentage for bluetooth devices
GNU General Public License v3.0
121 stars 40 forks source link

Occasionally explodes and spams bluetoothctl processes #70

Closed runderwo closed 2 weeks ago

runderwo commented 1 year ago

Hi, the plugin works well but occasionally it forkbombs the system, filling up the process table and producing extreme lag in gnome-shell (multiple seconds lag at a time, after which key events are repeated tens of times as if the key were stuck):

 215784 ?        S      0:00 bluetoothctl info 20:21:02:A0:00:32
 215788 ?        S      0:00 /bin/bash /home/nemesis/.local/share/gnome-shell/extensions/bluetooth-battery@michalw.github.com/scripts/bluetoothctl_battery.sh 20:21:02:A0:00:32
 215789 ?        S      0:00 bluetoothctl info 20:21:02:A0:00:32
 215792 ?        S      0:00 /bin/bash /home/nemesis/.local/share/gnome-shell/extensions/bluetooth-battery@michalw.github.com/scripts/bluetoothctl_battery.sh 20:21:02:A0:00:32
 215793 ?        S      0:00 bluetoothctl info 20:21:02:A0:00:32
<... repeat thousands of times ...>

While pursing root cause, it would probably make sense to add a safety valve so that no more than one subprocess can be active at one time.