[master] d2e7ccb Enable LSAN and use-after-scope checks

Federico G. Schwindt fgsch at lodoss.net
Thu Aug 24 00:17:05 CEST 2017


commit d2e7ccb1b72c2b31c70f70cc3558eb36067f76ba
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Wed Aug 23 23:13:53 2017 +0100

    Enable LSAN and use-after-scope checks
    
    The former is work in progress.

diff --git a/.travis.yml b/.travis.yml
index 9d17423..98239ec 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,7 +37,8 @@ before_install:
       sudo apt-get install -y clang-4.0 llvm-4.0;
       export CC=clang-4.0;
       export CONFIGURE_ARGS="--enable-developer-warnings --enable-debugging-symbols --enable-asan --enable-ubsan";
-      export ASAN_OPTIONS=detect_odr_violation=1,detect_leaks=0,detect_stack_use_after_return=1,detect_invalid_pointer_pairs=1,abort_on_error=1;
+      export ASAN_OPTIONS=abort_on_error=1,detect_odr_violation=1,detect_leaks=1,detect_stack_use_after_return=1,detect_invalid_pointer_pairs=1;
+      export LSAN_OPTIONS=suppressions=$(pwd)/tools/lsan.suppr;
       export UBSAN_OPTIONS=halt_on_error=1,print_stacktrace=1,suppressions=$(pwd)/tools/ubsan.suppr;
     fi
   - ./autogen.sh
diff --git a/configure.ac b/configure.ac
index abcd5d1..0f714d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -249,7 +249,9 @@ ASAN_CFLAGS=
 ASAN_LDFLAGS=
 AC_ARG_ENABLE(asan,
 	AS_HELP_STRING([--enable-asan],[enable address sanitizer (default is NO)]),
-	ASAN_FLAGS="-fsanitize=address")
+	ASAN_FLAGS="-fsanitize=address"
+	AX_CHECK_COMPILE_FLAG([-fsanitize=address -fsanitize-address-use-after-scope],
+			      [ASAN_FLAGS="${ASAN_FLAGS} -fsanitize-address-use-after-scope"]))
 
 MSAN_CFLAGS=
 MSAN_LDFLAGS=
diff --git a/tools/lsan.suppr b/tools/lsan.suppr
new file mode 100644
index 0000000..a92ec8b
--- /dev/null
+++ b/tools/lsan.suppr
@@ -0,0 +1,2 @@
+leak:varnishtest
+leak:MCF_ParamConf



More information about the varnish-commit mailing list