]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add ASan (AddressSanitizer) build and tests to ci.
authorYann Ylavic <ylavic@apache.org>
Sat, 5 Dec 2020 19:11:22 +0000 (19:11 +0000)
committerYann Ylavic <ylavic@apache.org>
Sat, 5 Dec 2020 19:11:22 +0000 (19:11 +0000)
Github: closes #152

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1884136 13f79535-47bb-0310-9956-ffa450edef68

.travis.yml
test/travis_run_linux.sh

index c0573f4f81f76d80b2e7c07527f1f82bd5152cb2..7cbf3d1566248609f5090304b8f48fd5f11e7fc6 100644 (file)
@@ -302,6 +302,15 @@ jobs:
       dist: focal
       env: NOTEST_CFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined" NOTEST_LIBS=-lubsan
            CONFIG="--enable-mods-shared=reallyall --disable-http2" TEST_UBSAN=1
+    # -------------------------------------------------------------------------
+    - name: Linux Ubuntu Focal, ASan
+      dist: focal
+      env: NOTEST_CFLAGS="-ggdb -fsanitize=address -fno-sanitize-recover=address -fno-omit-frame-pointer"
+           APR_VERSION=1.7.x APR_CONFIG="--enable-pool-debug"
+           APU_VERSION=1.7.x APU_CONFIG="--with-crypto --with-ldap"
+           CONFIG="--enable-mods-shared=reallyall"
+           TEST_ASAN=1
+           CLEAR_CACHE=1
   allow_failures:
     # Non-x86 are sometimes flaky:
     - arch: s390x
index 390a8d2e4a6dfb9e70990a99dac6b14df8e87e0b..cf9064a848d7dc961f969d85f6bfa9de21220154 100755 (executable)
@@ -84,6 +84,10 @@ if ! test -v SKIP_TESTING; then
         export UBSAN_OPTIONS="log_path=$PWD/ubsan.log"
     fi
 
+    if test -v TEST_ASAN; then
+        export ASAN_OPTIONS="log_path=$PWD/asan.log"
+    fi
+
     if test -v WITH_TEST_SUITE; then
         make check TESTS="${TESTS}" TEST_CONFIG="${TEST_ARGS}"
         RV=$?
@@ -147,9 +151,18 @@ if ! test -v SKIP_TESTING; then
         RV=3
     fi
 
+    if test -v TEST_ASAN && ls asan.log.* &> /dev/null; then
+        cat asan.log.*
+
+        # ASan can report memory leaks, fail on errors only
+        if grep -q "ERROR: AddressSanitizer:" `ls asan.log.*`; then
+            RV=4
+        fi
+    fi
+
     if test -f test/perl-framework/t/core; then
         gdb -ex 'thread apply all backtrace' -batch ./httpd test/perl-framework/t/core
-        RV=4
+        RV=5
     fi
 
     exit $RV