Skip to content

Commit

Permalink
crash log, print killer pid only when si_code is SI_USER (redis#10454)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
oranagra authored Mar 22, 2022
1 parent f3855a0 commit 6761d10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 6761d10

Please sign in to comment.