From 758349e09e88b0e7258a65affbef396144872590 Mon Sep 17 00:00:00 2001 From: Sergey Bronnikov Date: Wed, 14 Aug 2024 14:51:10 +0300 Subject: [PATCH] tarantool: work around LeakSanitizer internal errors (#12321) With enabled LeakSanitizer on AArch64 ICU build fails due to false positive warnings from Leak Sanitizer (part of config.log): ``` configure:3209: checking whether we are cross compiling configure:3217: clang -o conftest -O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link -lpthread conftest.c >&5 configure:3221: $? = 0 configure:3228: ./conftest ==666==LeakSanitizer has encountered a fatal error. ==666==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1 ==666==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc) configure:3232: $? = 1 configure:3239: error: in `/src/tarantool/build/icu': configure:3241: error: cannot run C compiled programs. ``` The patch disable LeakSanitizer on AArch64 and increase verbosity. Related to google/oss-fuzz#11798 Related to google/sanitizers#723 --- projects/tarantool/build.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/projects/tarantool/build.sh b/projects/tarantool/build.sh index fad5acc47b83..cd38bc61323a 100755 --- a/projects/tarantool/build.sh +++ b/projects/tarantool/build.sh @@ -54,6 +54,14 @@ case $SANITIZER in *) SANITIZERS_ARGS="" ;; esac +export LSAN_OPTIONS="verbosity=1:log_threads=1" + +# Workaround for a LeakSanitizer crashes, +# see https://github.com/google/oss-fuzz/issues/11798. +if [ "$ARCHITECTURE" = "aarch64" ]; then + export ASAN_OPTIONS=detect_leaks=0 +fi + : ${LD:="${CXX}"} : ${LDFLAGS:="${CXXFLAGS}"} # to make sure we link with sanitizer runtime