From eb39b0cc5804b5b3db4e232e33f38e922b693e13 Mon Sep 17 00:00:00 2001 From: Senichenkov Date: Sat, 21 Dec 2024 13:59:41 +0300 Subject: [PATCH] Disable false positive ASAN check Disable alloc-dealloc-mismatch check as it's false positive on Ubuntu (see comment in CMakeLists.txt) --- CMakeLists.txt | 16 ++++++++++++++++ address_sanitizer_ignore_list.txt | 4 ++++ 2 files changed, 20 insertions(+) create mode 100644 address_sanitizer_ignore_list.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ed773246..b6049fc63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,22 @@ else() if (ASAN) # Set DEBUG build options specific for build with ASAN set(ASAN_OPTS "-fsanitize=address") + + find_program(APT_FOUND apt-get) + if (APT_FOUND AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + # alloc-dealloc-mismatch generates false positives on boost exceptions + # This applies only to Ubuntu package: + # https://github.com/llvm/llvm-project/issues/59432?ysclid=m4y0iqca2c577414782 + # Disable this check on files listed in address_sanitizer_ignore_list.txt if compiler + # is Clang and apt-get is installed on system: + # FIXME(senichenkov): apt-get is not an ideal check -- maybe it wouldn't be so hard to + # ask apt-get if repository is ubuntu-...? + message("Running on Ubuntu") + message(WARNING "ASAN is broken in Ubuntu package, therefore alloc-dealloc-mismatch") + message(WARNING "check will be supressed. Consider using another distro for full ASAN coverage.") + string(JOIN ";" ASAN_OPTS "-fsanitize-ignorelist=${CMAKE_SOURCE_DIR}/address_sanitizer_ignore_list.txt") + endif() + string(JOIN ";" DEBUG_BUILD_OPTS "${DEBUG_BUILD_OPTS}" "-O1" "-Wno-error" # Use of -Werror is discouraged with sanitizers diff --git a/address_sanitizer_ignore_list.txt b/address_sanitizer_ignore_list.txt new file mode 100644 index 000000000..e14a6175f --- /dev/null +++ b/address_sanitizer_ignore_list.txt @@ -0,0 +1,4 @@ +# Disable alloc_dealloc_mismatch ASAN check +[alloc_dealloc_mismatch] +# in file: +src:typed_column_data.h