From 7aedbea681303a2b934ee14a0498e4de2a44b7fb Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Tue, 13 Nov 2018 16:47:30 +0100 Subject: Don't wait for non-blocked signals SIGSEGV, SIGILL, SIGFPE and SIGBUS aren't blocked, but they're added to the set of signals passed to sigwait(). This is confusing (should these signals be consumed by sigwait() or by their respective signal handler?) and is undefined according to the POSIX man page (http://man7.org/linux/man-pages/man3/sigwait.3p.html). In practice, sigwait() was only triggered when manually sending the signals to accel-pppd ("pkill -FPE accel-pppd"). On normal circumstances though, these signals are triggered by invalid operations run by the program. In these cases the signal handler was run and sigwait() wasn't woken up. So let's remove SIGSEGV, SIGILL, SIGFPE and SIGBUS from the set passed to sigwait(). This simplifies the code, avoids undefined behaviour and doesn't change accel-ppp behaviour for real-world use cases. Signed-off-by: Guillaume Nault --- accel-pppd/main.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/accel-pppd/main.c b/accel-pppd/main.c index e346f457..54a0db1f 100644 --- a/accel-pppd/main.c +++ b/accel-pppd/main.c @@ -356,10 +356,6 @@ int main(int _argc, char **_argv) sigemptyset(&set); sigaddset(&set, SIGTERM); - sigaddset(&set, SIGSEGV); - sigaddset(&set, SIGILL); - sigaddset(&set, SIGFPE); - sigaddset(&set, SIGBUS); if (!no_sigint) sigaddset(&set, SIGINT); -- cgit v1.2.3