Skip to content

Commit

Permalink
Handle sigbus like sigsegv
Browse files Browse the repository at this point in the history
For the purpose of our signal handler (and, in particular, the stack
overflow detection heuristic) they are identical.

Fixes varnishcache#2695 (as confirmed by @lkarsten)
  • Loading branch information
nigoroll authored and dmatetelki committed Mar 14, 2019
1 parent 42b7365 commit 5ad557f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bin/varnishd/cache/cache_main.c
Expand Up @@ -243,9 +243,10 @@ child_signal_handler(int s, siginfo_t *si, void *c)
memset(&sa, 0, sizeof sa);
sa.sa_handler = SIG_DFL;
(void)sigaction(SIGSEGV, &sa, NULL);
(void)sigaction(SIGBUS, &sa, NULL);
(void)sigaction(SIGABRT, &sa, NULL);

while (s == SIGSEGV) {
while (s == SIGSEGV || s == SIGBUS) {
req = THR_GetRequest();
if (req == NULL || req->wrk == NULL)
break;
Expand Down
2 changes: 1 addition & 1 deletion bin/varnishtest/tests/c00057.vtc
Expand Up @@ -76,7 +76,7 @@ client c2 -connect ${v2_sock} {
expect_close
} -run

varnish v2 -cliexpect "Segmentation [fF]ault" "panic.show"
varnish v2 -cliexpect "[bB]us error|Segmentation [fF]ault" "panic.show"

varnish v2 -cliok "panic.clear"

Expand Down

0 comments on commit 5ad557f

Please sign in to comment.