[master] 6fbf247 Restore the default SIGSEGV handler during pan_ic
Nils Goroll
nils.goroll at uplex.de
Mon Dec 1 09:55:05 CET 2014
commit 6fbf247c9b12b991c030a1e4f4942818e4c0927d
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Mon Dec 1 09:28:54 2014 +0100
Restore the default SIGSEGV handler during pan_ic
Leaving it enabled could hide panics.
Fixes #1639
diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index bc1f992..0549029 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -37,6 +37,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <signal.h>
#include "cache.h"
#include "cache_filter.h"
@@ -472,10 +473,21 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
const char *q;
struct req *req;
struct busyobj *bo;
+ struct sigaction sa;
AZ(pthread_mutex_lock(&panicstr_mtx)); /* Won't be released,
we're going to die
anyway */
+
+ /*
+ * should we trigger a SIGSEGV while handling a panic, our sigsegv
+ * handler would hide the panic, so we need to reset the handler to
+ * default
+ */
+ memset(&sa, 0, sizeof sa);
+ sa.sa_handler = SIG_DFL;
+ (void)sigaction(SIGSEGV, &sa, NULL);
+
switch(kind) {
case VAS_WRONG:
VSB_printf(pan_vsp,
More information about the varnish-commit
mailing list