From 7a0c5fdf12d9cd035e41734f518aa4568dc48c9d Mon Sep 17 00:00:00 2001 From: Matt Stancliff Date: Thu, 22 May 2014 15:34:02 -0400 Subject: [PATCH] Disable recursive watchdog signal handler If we are in the signal handler, we don't want to handle the signal again. In extreme cases, this can cause a stack overflow and segfault Redis. Fixes #1771 --- src/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug.c b/src/debug.c index 3fb491cb..c7e05830 100644 --- a/src/debug.c +++ b/src/debug.c @@ -947,7 +947,7 @@ void enableWatchdog(int period) { /* Watchdog was actually disabled, so we have to setup the signal * handler. */ sigemptyset(&act.sa_mask); - act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO; + act.sa_flags = SA_ONSTACK | SA_SIGINFO; act.sa_sigaction = watchdogSignalHandler; sigaction(SIGALRM, &act, NULL); }