+h_alrm(int signo) +{ + GLOBAL_CLP; + + F_SET(clp, CL_SIGALRM);
F_SET is |=, which is not atomic. This is unsafe. Safe signal handlers need to make single stores to atomic-sized variables, which tend to be int-sized, easier to declare as sig_atomic_t. Most often these are global scope with the following type: volatile sig_atomic_t variable I can see you copied an existing practice. Sadly all the other signal handlers are also broken in the same way. The flag bits should be replaced with seperate sig_atomic_t variables.