Skip to content

Commit 9c83589

Browse files
gitsterdscho
authored andcommitted
Merge branch 'jk/lsan-race-ignore-false-positive'
The code to check LSan results has been simplified and made more robust. * jk/lsan-race-ignore-false-positive: test-lib: add a few comments to LSan log checking test-lib: simplify lsan results check test-lib: invert return value of check_test_results_san_file_empty Signed-off-by: Johannes Schindelin <[email protected]>
2 parents f48c92b + 164a251 commit 9c83589

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

t/test-lib-functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ test_expect_success () {
927927
test -n "$test_skip_test_preamble" ||
928928
say >&3 "expecting success of $TEST_NUMBER.$test_count '$1': $test_body"
929929
if test_run_ "$test_body" &&
930-
check_test_results_san_file_empty_
930+
! check_test_results_san_file_has_entries_
931931
then
932932
test_ok_ "$1"
933933
else

t/test-lib.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,20 +1173,20 @@ test_atexit_handler () {
11731173
teardown_malloc_check
11741174
}
11751175

1176-
check_test_results_san_file_empty_ () {
1177-
test -z "$TEST_RESULTS_SAN_FILE" && return 0
1178-
1179-
# stderr piped to /dev/null because the directory may have
1180-
# been "rmdir"'d already.
1181-
! find "$TEST_RESULTS_SAN_DIR" \
1182-
-type f \
1183-
-name "$TEST_RESULTS_SAN_FILE_PFX.*" 2>/dev/null |
1184-
xargs grep ^DEDUP_TOKEN |
1176+
check_test_results_san_file_has_entries_ () {
1177+
test -z "$TEST_RESULTS_SAN_FILE" && return 1
1178+
1179+
# Lines marked with DEDUP_TOKEN show unique leaks. We only care that we
1180+
# found at least one.
1181+
#
1182+
# But also suppress any false positives caused by bugs or races in the
1183+
# sanitizer itself.
1184+
grep -s ^DEDUP_TOKEN "$TEST_RESULTS_SAN_FILE".* |
11851185
grep -qv sanitizer::GetThreadStackTopAndBottom
11861186
}
11871187

11881188
check_test_results_san_file_ () {
1189-
if check_test_results_san_file_empty_
1189+
if ! check_test_results_san_file_has_entries_
11901190
then
11911191
return
11921192
fi &&

0 commit comments

Comments
 (0)