patch 9.1.0816: tests: not clear what tests cause asan failures

Problem:  tests: not clear what tests cause asan failures
Solution: append testname to $ASAN_OPTIONS

Mention what test causes ASAN failures by appending the testname
to log_path in $ASAN_OPTIONS/$UBSAN_OPTIONS. This assumes 'log_path' is
always the last sub-option in $ASAN_OPTIONS.

While at it, also make the CI run with `-O0` instead of `-O1` when ASAN
is enable since this causes line numbers to disappear.

closes: #15927

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2024-10-27 21:15:50 +01:00
parent 912fbaf6e8
commit ce35ee8986
3 changed files with 45 additions and 10 deletions

View File

@ -194,9 +194,9 @@ jobs:
echo "TEST=unittests"
fi
if ${{ contains(matrix.extra, 'asan') }}; then
echo "SANITIZER_CFLAGS=-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer"
echo "ASAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/asan"
echo "UBSAN_OPTIONS=print_stacktrace=1 log_path=${LOG_DIR}/ubsan"
echo "SANITIZER_CFLAGS=-g -O0 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer"
echo "ASAN_OPTIONS=print_stacktrace=1:log_path=${LOG_DIR}/asan"
echo "UBSAN_OPTIONS=print_stacktrace=1:log_path=${LOG_DIR}/ubsan"
echo "LSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/src/testdir/lsan-suppress.txt"
fi
if ${{ contains(matrix.extra, 'vimtags') }}; then
@ -304,6 +304,7 @@ jobs:
if: contains(matrix.extra, 'asan') && !cancelled()
run: |
for f in $(grep -lR '#[[:digit:]]* *0x[[:xdigit:]]*' "${LOG_DIR}"); do
echo "$f"
asan_symbolize -l "$f"
false # in order to fail a job
done