[master] c66a5a2 Handle sigbus like sigsegv

Nils Goroll nils.goroll at uplex.de
Mon Jun 4 12:02:25 UTC 2018


commit c66a5a2620a07aefb1a65394ad25470153dc37f1
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Jun 4 14:01:15 2018 +0200

    Handle sigbus like sigsegv
    
    For the purpose of our signal handler (and, in particular, the stack
    overflow detection heuristic) they are identical.
    
    Fixes #2695 (as confirmed by @lkarsten)

diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c
index bfc76b4..8b7a63e 100644
--- a/bin/varnishd/cache/cache_main.c
+++ b/bin/varnishd/cache/cache_main.c
@@ -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;
diff --git a/bin/varnishtest/tests/c00057.vtc b/bin/varnishtest/tests/c00057.vtc
index f33a8bd..09a9c1c 100644
--- a/bin/varnishtest/tests/c00057.vtc
+++ b/bin/varnishtest/tests/c00057.vtc
@@ -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"
 


More information about the varnish-commit mailing list