summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Stancliff <matt@genges.com>2014-05-22 15:34:02 -0400
committerantirez <antirez@gmail.com>2014-05-26 17:53:40 +0200
commit75266018eebe1633b4b083afaece793d2b005766 (patch)
treeef79151b3b48ede32812b6ab821f7f33cc35af1f
parentedc41baca5a38848cf121c5966ff6590e8b24f0a (diff)
downloadredis-75266018eebe1633b4b083afaece793d2b005766.tar.gz
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
-rw-r--r--src/debug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/debug.c b/src/debug.c
index b6735749b..c47b4f20c 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -931,7 +931,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);
}