git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] ci: add address and undefined sanitizer tasks

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 21, 2022, 05:59 UTC
Message-ID
<xmqqtu3xogxr.fsf@gitster.g>
In-Reply-To
<Y0SyH34tdXQK2qhA@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> You can make it a bit faster by running both at once as
> SANITIZE=address,undefined.

With a single combined sanitier job, we saw failures at CI of p4 tests, where the server "goes away" in the middle of tests, for apparently no reason, and I just speculated perhaps the tests taking too long may be causing an impatient server side to go away before the client side finishes its work or something. After splitting the ASan and UBSan jobs into two and ejecting a topic out of 'seen', CI started passing for the first time in several days.

So, here is what I ended up using, at least for now.
----- >8 --------- >8 --------- >8 --------- >8 --------- >8 -----
Subject: [PATCH] ci: add address and undefined sanitizer tasks

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 | 6 ++++++
 ci/lib.sh                  | 6 ++++++
 2 files changed, 12 insertions(+)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 831f4df56c..bd6f75b8e0 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -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}}
diff --git a/ci/lib.sh b/ci/lib.sh
index 1b0cc2b57d..e3d49d3296 100755
--- 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}"
-- 
2.38.1-312-ge3e2987aab
Previous: Junio C HamanoNext: Jeff King
Message 5 of 9 in “ci: add address and undefined sanitizer tasks”
  1. ci: add address and undefined sanitizer tasksJunio C Hamano, Oct 9, 2022
  2. Junio C HamanoOct 10, 2022
  3. Jeff KingOct 11, 2022
  4. Junio C HamanoOct 11, 2022
  5. Junio C HamanoOct 21, 2022
  6. Jeff KingOct 21, 2022
  7. ci: add address and undefined sanitizer tasksJunio C Hamano, Oct 11, 2022
  8. Jeff KingOct 11, 2022
  9. Ævar Arnfjörð BjarmasonOct 11, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.