Skip to content

Commit

Permalink
Disable false positive ASAN check
Browse files Browse the repository at this point in the history
Disable alloc-dealloc-mismatch check as it's false positive
on Ubuntu (see comment in CMakeLists.txt)
  • Loading branch information
p-senichenkov committed Dec 21, 2024
1 parent 8d17f04 commit eb39b0c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions address_sanitizer_ignore_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Disable alloc_dealloc_mismatch ASAN check
[alloc_dealloc_mismatch]
# in file:
src:typed_column_data.h

0 comments on commit eb39b0c

Please sign in to comment.