summaryrefslogtreecommitdiff
path: root/src/debug.c
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2022-03-22 17:37:34 +0200
committerGitHub <noreply@github.com>2022-03-22 17:37:34 +0200
commit6761d10cc34a904982f28ca146bef0747abf3e06 (patch)
tree259af203e82e14fa485f325782b8cc5c484cbdb0 /src/debug.c
parentf3855a093049bccf530c93a6c386e826bd58e90e (diff)
downloadredis-6761d10cc34a904982f28ca146bef0747abf3e06.tar.gz
crash log, print killer pid only when si_code is SI_USER (#10454)
Avoid printing "Killed by PID" when si_code != SI_USER. Apparently SI_USER isn't always set to 0. e.g. on Mac it's 0x10001 and the check that did <= was wrong.
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/debug.c b/src/debug.c
index 2f57e7de3..5d32ef0bc 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -1952,7 +1952,7 @@ void sigsegvHandler(int sig, siginfo_t *info, void *secret) {
serverLog(LL_WARNING,
"Accessing address: %p", (void*)info->si_addr);
}
- if (info->si_code <= SI_USER && info->si_pid != -1) {
+ if (info->si_code == SI_USER && info->si_pid != -1) {
serverLog(LL_WARNING, "Killed by PID: %ld, UID: %d", (long) info->si_pid, info->si_uid);
}