From d1b8ac889437d08b5dac6fdc9e9afe7d4f75909d Mon Sep 17 00:00:00 2001 From: bigfooted Date: Fri, 23 Oct 2026 12:55:03 +0200 Subject: [PATCH] Fix TSan CI build: keep sanitizer flags out of ninja bootstrap, lower ASLR entropy Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/regression.yml | 4 ++++ preconfigure.py | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index ff68a7a024b..992a0d6e30a 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -122,6 +122,8 @@ jobs: with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} + - name: Lower ASLR entropy for TSan + run: sudo sysctl vm.mmap_rnd_bits=28 - name: Build uses: docker://ghcr.io/su2code/su2/build-su2-tsan:261011-1107 with: @@ -324,6 +326,8 @@ jobs: done chmod a+x $BIN_FOLDER/* ls -lahR $BIN_FOLDER + - name: Lower ASLR entropy for TSan + run: sudo sysctl vm.mmap_rnd_bits=28 - name: Run Tests in Container uses: docker://ghcr.io/su2code/su2/test-su2-tsan:261011-1107 env: diff --git a/preconfigure.py b/preconfigure.py index bfba6995c5b..f379baa9f86 100755 --- a/preconfigure.py +++ b/preconfigure.py @@ -73,6 +73,13 @@ def build_ninja(): # Specify C++17 env = os.environ.copy() env["CXXFLAGS"] = env.get("CXXFLAGS", "") + " -std=c++17" + # ninja is a build tool and must not be instrumented by sanitizers + for var in ("CFLAGS", "CXXFLAGS", "LDFLAGS"): + env[var] = " ".join( + f + for f in env.get(var, "").split() + if not f.startswith("-fsanitize") + ) subprocess.run( ["python3", "configure.py", "--bootstrap"], cwd=ninjapath, env=env )