mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-11 03:31:36 +00:00
BUG/MEDIUM: wdt: Don't ignore WDTSIG and DEBUGSIG in __signal_process_queue().
When running __signal_process_queue(), we ignore most signals. We can't, however, ignore WDTSIG and DEBUGSIG, otherwise that thread may end up waiting for another one that could hold a glibc lock, while the other thread wait for this one to enter debug_handler(). So make sure WDTSIG and DEBUGSIG aren't ignored, if they are defined. This probably explains the watchdog deadlock described in github issue This should be backported to 2.1, 2.0 and 1.9.
This commit is contained in:
parent
de01ea9878
commit
b0198cc413
10
src/signal.c
10
src/signal.c
@ -114,11 +114,19 @@ static void signal_init()
|
||||
/* man sigprocmask: If SIGBUS, SIGFPE, SIGILL, or SIGSEGV are
|
||||
generated while they are blocked, the result is undefined, unless
|
||||
the signal was generated by kill(2),
|
||||
sigqueue(3), or raise(3) */
|
||||
sigqueue(3), or raise(3).
|
||||
Do not ignore WDTSIG or DEBUGSIG either, or it may deadlock the
|
||||
watchdog */
|
||||
sigdelset(&blocked_sig, SIGBUS);
|
||||
sigdelset(&blocked_sig, SIGFPE);
|
||||
sigdelset(&blocked_sig, SIGILL);
|
||||
sigdelset(&blocked_sig, SIGSEGV);
|
||||
#ifdef DEBUGSIG
|
||||
sigdelset(&blocked_sig, DEBUGSIG);
|
||||
#endif
|
||||
#ifdef WDTSIG
|
||||
sigdelset(&blocked_sig, WDTSIG);
|
||||
#endif
|
||||
for (sig = 0; sig < MAX_SIGNAL; sig++)
|
||||
LIST_INIT(&signal_state[sig].handlers);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user