]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ci: add address and undefined sanitizer tasks
authorJunio C Hamano <gitster@pobox.com>
Thu, 20 Oct 2022 16:20:59 +0000 (09:20 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 Oct 2022 16:20:59 +0000 (09:20 -0700)
The current code is clean with these two sanitizers, and we would
like to keep it that way by running the checks for any new code.

The signal of "passed with asan, but not ubsan" (or vice versa) is
not that useful in practice, so it is tempting to run both santizers
in a single task, but it seems to take forever, so tentatively let's
try having two separate ones.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.github/workflows/main.yml
ci/lib.sh

index 831f4df56c51dc96b17465a5120d28bf11a63351..bd6f75b8e0fed74880a2608618b7480d4018797d 100644 (file)
@@ -251,6 +251,12 @@ jobs:
           - jobname: linux-leaks
             cc: gcc
             pool: ubuntu-latest
+          - jobname: linux-asan
+            cc: gcc
+            pool: ubuntu-latest
+          - jobname: linux-ubsan
+            cc: gcc
+            pool: ubuntu-latest
     env:
       CC: ${{matrix.vector.cc}}
       CC_PACKAGE: ${{matrix.vector.cc_package}}
index 1b0cc2b57db8667f3cbc9ae8b6223dd7997e7485..e3d49d3296d589a1adfc764994e60bf4c9c84346 100755 (executable)
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -278,6 +278,12 @@ linux-leaks)
        export GIT_TEST_PASSING_SANITIZE_LEAK=true
        export GIT_TEST_SANITIZE_LEAK_LOG=true
        ;;
+linux-asan)
+       export SANITIZE=address
+       ;;
+linux-ubsan)
+       export SANITIZE=undefined
+       ;;
 esac
 
 MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}"