mirror of
https://github.com/fluencelabs/redis
synced 2025-04-12 12:16:03 +00:00
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
This commit is contained in:
parent
88c2307535
commit
7a0c5fdf12
@ -947,7 +947,7 @@ void enableWatchdog(int period) {
|
|||||||
/* Watchdog was actually disabled, so we have to setup the signal
|
/* Watchdog was actually disabled, so we have to setup the signal
|
||||||
* handler. */
|
* handler. */
|
||||||
sigemptyset(&act.sa_mask);
|
sigemptyset(&act.sa_mask);
|
||||||
act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO;
|
act.sa_flags = SA_ONSTACK | SA_SIGINFO;
|
||||||
act.sa_sigaction = watchdogSignalHandler;
|
act.sa_sigaction = watchdogSignalHandler;
|
||||||
sigaction(SIGALRM, &act, NULL);
|
sigaction(SIGALRM, &act, NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user