LukeSmithxyz / dwmblocks

My status bar: my build of the modular dwmblocks
GNU General Public License v2.0
430 stars 368 forks source link

dwmblocks randomly hangs from time to time #118

Closed frei-0xff closed 1 year ago

frei-0xff commented 1 year ago

I've encountered the issue when the status bar suddenly stops updating because dwmblocks hangs for no apparent reason. It happens quite rarely but nevertheless consistently.

As I've been able to figure out it hangs in calls to Xlib functions and the reason is that dwmblocks calls setroot, that sets newly calculated status bar to dwm, from main program loop as well as from signal handlers which are invoked asynchronously at random times interrupting for the moment main program loop.

The problem is that Xlib functions are not reentrant and if called from signal handler while entered and not yet returned in main loop result in a deadlock and hang of the whole application.