From 205116a248179a794aacf2f79ea39059921fc734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Fri, 16 Dec 2022 17:07:58 +0100 Subject: [PATCH] TEST --- .github/workflows/linux.yml | 48 +++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index e51543cb..f22335f3 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -107,6 +107,10 @@ jobs: # Force coloured output CFLAGS="-fcolor-diagnostics $CFLAGS" CXXFLAGS="-fcolor-diagnostics $CXXFLAGS" + + # * libclang_rt.asan-x86_64.so must be loaded as the first library + # See https://systemd.io/TESTING_WITH_SANITIZERS for details. + LD_PRELOAD="$(clang-${{matrix.llvm}} -print-file-name=libclang_rt.asan-x86_64.so)" else # GCC CC="gcc" @@ -115,15 +119,38 @@ jobs: # Force coloured output CFLAGS="-fdiagnostics-color $CFLAGS" CXXFLAGS="-fdiagnostics-color $CXXFLAGS" + + # libasan.so must be loaded as the first library + export LD_PRELOAD="$(gcc -print-file-name=libasan.so)" fi + # Make symbiotic use correct clang & friends from PATH (e.g. no + # disguised ccache or problems with unversioned tools not being + # in PATH). + # + # Also, clang's ASAN and UBSAN expect unversioned llvm-symbolizer + # in PATH. + PATH="$(llvm-config-${{matrix.llvm}} --bindir):$PATH" + + # Due to LD_PRELOAD above, leak sanitizer was reporting leaks + # literally in everything that was executed, e.g. make, shell, + # python and other tools that are not under our control. + ASAN_OPTIONS=detect_leaks=0 + + # Make UBSAN print whole stack traces + UBSAN_OPTIONS="print_stacktrace=1" + # Save the environment echo "CC=$CC" >> $GITHUB_ENV echo "CXX=$CXX" >> $GITHUB_ENV echo "CFLAGS=$CFLAGS" >> $GITHUB_ENV echo "CXXFLAGS=$CXXFLAGS" >> $GITHUB_ENV echo "LDFLAGS=$LDFLAGS" >> $GITHUB_ENV + echo "LD_PRELOAD=$LD_PRELOAD" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV + echo "PATH=$PATH" >> "$GITHUB_ENV" + echo "ASAN_OPTIONS=$ASAN_OPTIONS" >> "$GITHUB_ENV" + echo "UBSAN_OPTIONS=$UBSAN_OPTIONS" >> "$GITHUB_ENV" # Set up ccache sudo /usr/sbin/update-ccache-symlinks @@ -156,26 +183,7 @@ jobs: # FIXME: Remove when KLEE is rebased to latest upstream. if: matrix.llvm < 11 run: | - if [[ "${{matrix.compiler}}" = "clang" ]]; then - # * libclang_rt.asan-x86_64.so must be loaded as the first library - # See https://systemd.io/TESTING_WITH_SANITIZERS for details. - export LD_PRELOAD="$(clang-${{matrix.llvm}} -print-file-name=libclang_rt.asan-x86_64.so)" - else - export LD_PRELOAD="$(gcc -print-file-name=libasan.so)" - fi - - # Make symbiotic use correct clang & friends from PATH (e.g. no - # disguised ccache or problems with unversioned tools not being - # in PATH). - # - # Also, clang's ASAN and UBSAN expect unversioned llvm-symbolizer - # in PATH. - export PATH="$(llvm-config-${{matrix.llvm}} --bindir):$PATH" - - # Due to LD_PRELOAD above, leak sanitizer was reporting leaks - # literally in everything that was executed, e.g. make, shell, - # python and other tools that are not under our control. - ASAN_OPTIONS=detect_leaks=0 make -C tests + make -C tests - name: ccache statistics run: ccache -s