[master] 489dcd6 Bump the stack size when --enable-*san is used

Federico G. Schwindt fgsch at lodoss.net
Sat May 6 00:12:06 CEST 2017


commit 489dcd6264578c734ac4b41b44e3ae55eaa0c7e1
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Thu May 4 19:35:58 2017 +0100

    Bump the stack size when --enable-*san is used
    
    The generated code needs a larger stack when optimizations are
    disabled, i.e. with --enable-debugging-symbols.

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index c8f783f..6e24a05 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -276,7 +276,11 @@ init_params(struct cli *cli)
 	low = sysconf(_SC_THREAD_STACK_MIN);
 	MCF_ParamConf(MCF_MINIMUM, "thread_pool_stack", "%jdb", (intmax_t)low);
 
+#if defined(WITH_SANITIZERS)
+	def = 92 * 1024;
+#else
 	def = 48 * 1024;
+#endif
 	if (def < low)
 		def = low;
 	MCF_ParamConf(MCF_DEFAULT, "thread_pool_stack", "%jdb", (intmax_t)def);
diff --git a/configure.ac b/configure.ac
index d556c23..0c95ea0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -258,7 +258,7 @@ AC_ARG_ENABLE(msan,
 	MSAN_FLAGS="-fsanitize=memory")
 
 if test "x$UBSAN_FLAGS$TSAN_FLAGS$ASAN_FLAGS$MSAN_FLAGS" != "x"; then
-	SAN_CFLAGS="${UBSAN_FLAGS} ${TSAN_FLAGS} ${ASAN_FLAGS} ${MSAN_FLAGS} -fPIC -fPIE -fno-omit-frame-pointer"
+	SAN_CFLAGS="-DWITH_SANITIZERS=1 ${UBSAN_FLAGS} ${TSAN_FLAGS} ${ASAN_FLAGS} ${MSAN_FLAGS} -fPIC -fPIE -fno-omit-frame-pointer"
 	SAN_LDFLAGS="${UBSAN_FLAGS} ${TSAN_FLAGS} ${ASAN_FLAGS} ${MSAN_FLAGS} -pie"
 fi
 AC_SUBST(SAN_CFLAGS)



More information about the varnish-commit mailing list