From 9c20b29dba87a42d07f2cb9bb49718c95265a6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Tue, 1 Dec 2020 18:02:13 +0100 Subject: [PATCH] improved sanitizer builds in CI (#2928) --- .github/workflows/asan.yml | 9 ++++----- .github/workflows/ubsan.yml | 11 +++++------ .travis.yml | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/asan.yml b/.github/workflows/asan.yml index 3f49c58f5..0d2a688b0 100644 --- a/.github/workflows/asan.yml +++ b/.github/workflows/asan.yml @@ -20,20 +20,19 @@ jobs: - name: Install missing software on ubuntu run: | sudo apt-get update - sudo apt-get install libxml2-utils - sudo apt-get install z3 libz3-dev + sudo apt-get install libz3-4 libz3-dev cp externals/z3_version_old.h externals/z3_version.h - name: Build run: | cp externals/z3_version_old.h externals/z3_version.h - CXXFLAGS="-fsanitize=address -Og -g3" make cppcheck testrunner -j$(nproc) USE_Z3=yes + CC=clang CXX=clang++ CXXFLAGS="-fsanitize=address -O1 -g3 -DCPPCHK_GLIBCXX_DEBUG" make cppcheck testrunner -j$(nproc) USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes - name: Run tests run: | - ./testrunner + ASAN_OPTIONS=detect_stack_use_after_return=1 ./testrunner - name: Bughunting lib run: | - ./cppcheck -D__CPPCHECK__ --bug-hunting -j$(nproc) lib + ASAN_OPTIONS=detect_stack_use_after_return=1 ./cppcheck -D__CPPCHECK__ --bug-hunting -j$(nproc) lib diff --git a/.github/workflows/ubsan.yml b/.github/workflows/ubsan.yml index 527eb98ea..268a82a78 100644 --- a/.github/workflows/ubsan.yml +++ b/.github/workflows/ubsan.yml @@ -20,20 +20,19 @@ jobs: - name: Install missing software on ubuntu run: | sudo apt-get update - sudo apt-get install libxml2-utils - sudo apt-get install z3 libz3-dev + sudo apt-get install libz3-4 libz3-dev cp externals/z3_version_old.h externals/z3_version.h - name: Build run: | cp externals/z3_version_old.h externals/z3_version.h - CXXFLAGS="-fsanitize=undefined -Og -g3" make cppcheck testrunner -j$(nproc) USE_Z3=yes + CC=clang CXX=clang++ CXXFLAGS="-fsanitize=undefined -fsanitize=nullability -O1 -g3 -DCPPCHK_GLIBCXX_DEBUG" make cppcheck testrunner -j$(nproc) USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes - name: Run tests run: | - ./testrunner + UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./testrunner - - name: checkcfg + - name: Bughunting lib run: | - make checkcfg + UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./cppcheck -D__CPPCHECK__ --bug-hunting -j$(nproc) lib diff --git a/.travis.yml b/.travis.yml index 16531efc2..e215c0ffe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ env: - CXXFLAGS="${ORIGINAL_CXXFLAGS} -O2 -march=native -Wstrict-aliasing=2 -Werror=strict-aliasing" - CPPCHECK=${TRAVIS_BUILD_DIR}/cppcheck - ASAN_OPTIONS=detect_stack_use_after_return=1 - - UBSAN_OPTIONS=print_stacktrace=1 + - UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 matrix: - CXXFLAGS="${CXXFLAGS} -DCHECK_INTERNAL" - CXXFLAGS="${CXXFLAGS} -DCHECK_INTERNAL" MAKEFLAGS="HAVE_RULES=yes" MATCHCOMPILER=yes VERIFY=1