[master] cfaf64b Ignore the alternate stack if the handler is off

Federico G. Schwindt fgsch at lodoss.net
Sun Sep 24 21:24:07 UTC 2017


commit cfaf64b98b5acc8288b3753ed71faf134d6c64ac
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Sun Sep 24 21:56:38 2017 +0100

    Ignore the alternate stack if the handler is off

diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c
index 684d456..4d82fb6 100644
--- a/bin/varnishd/cache/cache_main.c
+++ b/bin/varnishd/cache/cache_main.c
@@ -124,7 +124,8 @@ void
 THR_Init(void)
 {
 #ifdef HAVE_SIGALTSTACK
-       AZ(sigaltstack(&altstack, NULL));
+	if (altstack.ss_sp != NULL)
+		AZ(sigaltstack(&altstack, NULL));
 #endif
 }
 
diff --git a/bin/varnishtest/tests/c00057.vtc b/bin/varnishtest/tests/c00057.vtc
index 5853b70..e9791d3 100644
--- a/bin/varnishtest/tests/c00057.vtc
+++ b/bin/varnishtest/tests/c00057.vtc
@@ -39,3 +39,12 @@ client c1 {
 } -run
 
 varnish v1 -cliok "panic.clear"
+
+# Also check without the handler
+varnish v1 -cliok "param.set sigsegv_handler off"
+varnish v1 -vcl+backend {} -start
+
+client c1 {
+	txreq
+	rxresp
+} -run


More information about the varnish-commit mailing list