From 933642c6ef7c3015222cba84c20f13a1ca0eafd6 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Thu, 7 Jun 2018 09:49:04 +0200 Subject: [PATCH] BUG/MINOR: don't ignore SIG{BUS,FPE,ILL,SEGV} during signal processing We don't have any reason of blocking those signals. 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). This should be backported to 1.8. --- src/signal.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/signal.c b/src/signal.c index f1f682188..0dadd762c 100644 --- a/src/signal.c +++ b/src/signal.c @@ -120,6 +120,14 @@ int signal_init() sigfillset(&blocked_sig); sigdelset(&blocked_sig, SIGPROF); + /* 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) */ + sigdelset(&blocked_sig, SIGBUS); + sigdelset(&blocked_sig, SIGFPE); + sigdelset(&blocked_sig, SIGILL); + sigdelset(&blocked_sig, SIGSEGV); for (sig = 0; sig < MAX_SIGNAL; sig++) LIST_INIT(&signal_state[sig].handlers);