Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Dec 19, 2023
1 parent e8b7829 commit b1f22ce
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code_sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
SANITIZER: ${{ matrix.SANITIZER }}
TEST_USE_ROCKSDB: ${{ matrix.BACKEND == 'rocksdb' && '1' || '0' }}
DEADLINE_SCALE_FACTOR: ${{ matrix.BACKEND == 'rocksdb' && '2' || '1' }}
ASAN_OPTIONS: log_exe_name=1:log_path=sanitizer_report
ASAN_OPTIONS: log_exe_name=1:log_path=sanitizer_report:suppressions=../asan_suppressions
TSAN_OPTIONS: log_exe_name=1:log_path=sanitizer_report:suppressions=../tsan_suppressions
UBSAN_OPTIONS: log_exe_name=1:log_path=sanitizer_report:print_stacktrace=1
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Expand Down
18 changes: 16 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,18 @@ else()
message(STATUS "Using ASAN+UBSAN")
add_compile_options(-fsanitize=address,undefined)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(
"-fsanitize-ignorelist=${PROJECT_SOURCE_DIR}/sanitize_ignorelist")
endif()
add_definitions(-DED25519_NO_INLINE_ASM)
add_definitions(-DROCKSDB_UBSAN_RUN)
elseif(${USING_TSAN})
message(STATUS "Using TSAN")
add_compile_options(-fsanitize=thread)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(
"-fsanitize-blacklist=${PROJECT_SOURCE_DIR}/tsan_clang_blacklist")
"-fsanitize-ignorelist=${PROJECT_SOURCE_DIR}/sanitize_ignorelist")
endif()
add_definitions(-DED25519_NO_INLINE_ASM)
endif()
Expand Down Expand Up @@ -326,14 +330,24 @@ else()
if(${USING_ASAN_INT})
set(PLATFORM_LINK_FLAGS
"${PLATFORM_LINK_FLAGS} -fsanitize=address,undefined,integer")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(PLATFORM_LINK_FLAGS
"${PLATFORM_LINK_FLAGS} -fsanitize-ignorelist=${PROJECT_SOURCE_DIR}/sanitize_ignorelist"
)
endif()
elseif(${USING_ASAN})
set(PLATFORM_LINK_FLAGS
"${PLATFORM_LINK_FLAGS} -fsanitize=address,undefined")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(PLATFORM_LINK_FLAGS
"${PLATFORM_LINK_FLAGS} -fsanitize-ignorelist=${PROJECT_SOURCE_DIR}/sanitize_ignorelist"
)
endif()
elseif(${USING_TSAN})
set(PLATFORM_LINK_FLAGS "${PLATFORM_LINK_FLAGS} -fsanitize=thread")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(PLATFORM_LINK_FLAGS
"${PLATFORM_LINK_FLAGS} -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/tsan_clang_blacklist"
"${PLATFORM_LINK_FLAGS} -fsanitize-ignorelist=${PROJECT_SOURCE_DIR}/sanitize_ignorelist"
)
endif()
endif()
Expand Down
Empty file added asan_suppressions
Empty file.
2 changes: 2 additions & 0 deletions sanitize_ignorelist
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src:*crypto/ed25519*
src:*crypto/blake2*
5 changes: 4 additions & 1 deletion tsan_clang_blacklist
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
src:*mdb.c
src:*midl.c
src:*midl.c

src:*crypto/ed25519*
src:*crypto/blake2*

0 comments on commit b1f22ce

Please sign in to comment.