Skip to content

Commit 164a251

Browse files
peffgitster
authored andcommitted
test-lib: add a few comments to LSan log checking
Commit b119a68 (test-lib: ignore leaks in the sanitizer's thread code, 2025-01-01) added code to suppress a false positive in the leak checker. But if you're just reading the code, the obscure grep call is a bit of a head-scratcher. Let's add a brief comment explaining what's going on (and anybody digging further can find this commit or that one for all the details). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b9a9df9 commit 164a251

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

t/test-lib.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,11 @@ test_atexit_handler () {
11721172
check_test_results_san_file_has_entries_ () {
11731173
test -z "$TEST_RESULTS_SAN_FILE" && return 1
11741174

1175+
# Lines marked with DEDUP_TOKEN show unique leaks. We only care that we
1176+
# found at least one.
1177+
#
1178+
# But also suppress any false positives caused by bugs or races in the
1179+
# sanitizer itself.
11751180
grep -s ^DEDUP_TOKEN "$TEST_RESULTS_SAN_FILE".* |
11761181
grep -qv sanitizer::GetThreadStackTopAndBottom
11771182
}

0 commit comments

Comments
 (0)