Fix sanitizers suppressions

The -fsanitize-ignorelist (-fsanitize-blacklist is the alias for it)
accepts not the suppressions but special case list, that accept only
`fun` and `src`, so convert tsan_suppressions.txt into a proper
tsan_ignorelist.txt with a proper syntax, otherwise suppressions simply
does not work [1].

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/61526/958659584957ff419a9305d9c7edee5703fedbdc/integration_tests__tsan__[6_6].html

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2024-03-24 16:19:06 +01:00
parent ede245e478
commit 90e1f7d8ec
4 changed files with 20 additions and 7 deletions

View File

@ -30,7 +30,7 @@ if (SANITIZE)
elseif (SANITIZE STREQUAL "thread")
set (TSAN_FLAGS "-fsanitize=thread")
if (COMPILER_CLANG)
set (TSAN_FLAGS "${TSAN_FLAGS} -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/tests/tsan_suppressions.txt")
set (TSAN_FLAGS "${TSAN_FLAGS} -fsanitize-ignorelist=${PROJECT_SOURCE_DIR}/tests/tsan_ignorelist.txt")
endif()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SAN_FLAGS} ${TSAN_FLAGS}")
@ -48,7 +48,7 @@ if (SANITIZE)
set(UBSAN_FLAGS "${UBSAN_FLAGS} -fno-sanitize=unsigned-integer-overflow")
endif()
if (COMPILER_CLANG)
set (UBSAN_FLAGS "${UBSAN_FLAGS} -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/tests/ubsan_suppressions.txt")
set (UBSAN_FLAGS "${UBSAN_FLAGS} -fsanitize-ignorelist=${PROJECT_SOURCE_DIR}/tests/ubsan_ignorelist.txt")
endif()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SAN_FLAGS} ${UBSAN_FLAGS}")

10
tests/tsan_ignorelist.txt Normal file
View File

@ -0,0 +1,10 @@
# Note, this file is ignorelist file [1] not suppressions [2].
#
# [1]: https://clang.llvm.org/docs/SanitizerSpecialCaseList.html
# [2]: https://github.com/google/sanitizers/wiki/ThreadSanitizerSuppressions
#
# https://github.com/ClickHouse/ClickHouse/issues/55629
fun:rd_kafka_broker_set_nodename
# https://github.com/ClickHouse/ClickHouse/issues/60443
fun:rd_kafka_stats_emit_all

View File

@ -1,4 +0,0 @@
# https://github.com/ClickHouse/ClickHouse/issues/55629
race:rd_kafka_broker_set_nodename
# https://github.com/ClickHouse/ClickHouse/issues/60443
race:rd_kafka_stats_emit_all

View File

@ -1,4 +1,11 @@
# https://github.com/llvm-mirror/compiler-rt/blob/master/lib/ubsan/ubsan_checks.inc
# Note, this file is ignorelist file [1] not suppressions [2].
#
# [1]: https://clang.llvm.org/docs/SanitizerSpecialCaseList.html
# [2]: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#runtime-suppressions
#
# See also [3] for all UBSan checks.
#
# [3]: https://github.com/llvm-mirror/compiler-rt/blob/master/lib/ubsan/ubsan_checks.inc
# Some value is outside the range of representable values of type 'long' on user-provided data inside boost::geometry - ignore.
src:*/Functions/pointInPolygon.cpp