From 3e6511af413c7a8b3803bc7940e0b6dd46048b74 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Thu, 8 Aug 2024 15:31:15 +0200 Subject: [PATCH] btest: Skip core.script-args under TSAN TSAN may re-execute the executable when the memory layout doesn't fullfill requirements, causing argument confusion when that happens. Closes #3774. --- testing/btest/core/script-args.zeek | 4 ++++ testing/scripts/have-tsan | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100755 testing/scripts/have-tsan diff --git a/testing/btest/core/script-args.zeek b/testing/btest/core/script-args.zeek index b229c87ada..7484bb9441 100644 --- a/testing/btest/core/script-args.zeek +++ b/testing/btest/core/script-args.zeek @@ -2,6 +2,10 @@ # the script differently, leading to complaints that there are no scripts. # @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1" +# TSAN may re-execute the executable when the memory layout doesn't fullfill +# requirements, causing argument confusion when that happens (see #3774). +# @TEST-REQUIRES: ! have-tsan + # @TEST-EXEC: printf '#!' > test.zeek # @TEST-EXEC: printf "$BUILD/src/zeek -b --\n" >> test.zeek # @TEST-EXEC: cat %INPUT >> test.zeek diff --git a/testing/scripts/have-tsan b/testing/scripts/have-tsan new file mode 100755 index 0000000000..8030c8d248 --- /dev/null +++ b/testing/scripts/have-tsan @@ -0,0 +1,7 @@ +#!/bin/sh + +if grep -q "ZEEK_SANITIZERS:STRING=.*thread.*" "${BUILD}"/CMakeCache.txt; then + exit 0 +fi + +exit 1