aboutsummaryrefslogtreecommitdiffstats
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-01-02 13:37:07 -0800
committerJunio C Hamano <gitster@pobox.com>2025-01-02 13:37:08 -0800
commiteffbef2bebed87b1ce46d449862fb5121dba9d34 (patch)
treed2fce862eff41924570281641c2585cdcb238267 /t/test-lib.sh
parentd062ccf4c3af1e5153ed5064d4d05b05e0fdd4d5 (diff)
parentb119a687d411864433aed92017c144d311b53a4c (diff)
downloadgit-effbef2bebed87b1ce46d449862fb5121dba9d34.tar.gz
Merge branch 'jk/lsan-race-ignore-false-positive'
CI jobs that run threaded programs under LSan has been giving false positives from time to time, which has been worked around. This is an alternative to the jk/lsan-race-with-barrier topic with much smaller change to the production code. * jk/lsan-race-ignore-false-positive: test-lib: ignore leaks in the sanitizer's thread code test-lib: check leak logs for presence of DEDUP_TOKEN test-lib: simplify leak-log checking test-lib: rely on logs to detect leaks Revert barrier-based LSan threading race workaround
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh23
1 files changed, 10 insertions, 13 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 96f2dfb69d..d1f62adbf8 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -80,6 +80,7 @@ prepend_var ASAN_OPTIONS : detect_leaks=0
export ASAN_OPTIONS
prepend_var LSAN_OPTIONS : $GIT_SAN_OPTIONS
+prepend_var LSAN_OPTIONS : exitcode=0
prepend_var LSAN_OPTIONS : fast_unwind_on_malloc=0
export LSAN_OPTIONS
@@ -339,17 +340,6 @@ case "$TRASH_DIRECTORY" in
*) TRASH_DIRECTORY="$TEST_OUTPUT_DIRECTORY/$TRASH_DIRECTORY" ;;
esac
-# Utility functions using $TEST_RESULTS_* variables
-nr_san_dir_leaks_ () {
- # stderr piped to /dev/null because the directory may have
- # been "rmdir"'d already.
- find "$TEST_RESULTS_SAN_DIR" \
- -type f \
- -name "$TEST_RESULTS_SAN_FILE_PFX.*" 2>/dev/null |
- xargs grep -lv "Unable to get registers from thread" |
- wc -l
-}
-
# If --stress was passed, run this test repeatedly in several parallel loops.
if test "$GIT_TEST_STRESS_STARTED" = "done"
then
@@ -1180,8 +1170,15 @@ test_atexit_handler () {
}
check_test_results_san_file_empty_ () {
- test -z "$TEST_RESULTS_SAN_FILE" ||
- test "$(nr_san_dir_leaks_)" = 0
+ test -z "$TEST_RESULTS_SAN_FILE" && return 0
+
+ # stderr piped to /dev/null because the directory may have
+ # been "rmdir"'d already.
+ ! find "$TEST_RESULTS_SAN_DIR" \
+ -type f \
+ -name "$TEST_RESULTS_SAN_FILE_PFX.*" 2>/dev/null |
+ xargs grep ^DEDUP_TOKEN |
+ grep -qv sanitizer::GetThreadStackTopAndBottom
}
check_test_results_san_file_ () {