File tree Expand file tree Collapse file tree 3 files changed +29
-11
lines changed
openvdb_ax/openvdb_ax/test Expand file tree Collapse file tree 3 files changed +29
-11
lines changed Original file line number Diff line number Diff line change 1+ #################################################################################
2+ ## This file is loaded by the Leak/Address Sanitizer build for the unit tests. ##
3+ ## It can be used to ignore various errors reported by the sanitizer. This is ##
4+ ## especially useful with upstream issues (e.g. boost/tbb). For help defining ##
5+ ## suppression rules, see: ##
6+ ## https://clang.llvm.org/docs/AddressSanitizer.html ##
7+ ## The build is configured with CMAKE_BUILD_TYPE=asan or lsan ##
8+ #################################################################################
9+
10+ ##### Upstream #####
11+
12+ # Leaks from TBB init which occur due to tbb teardown issues
13+ # https://github.com/oneapi-src/oneTBB/issues/206
14+ # Should be fixed in oneTBB. Ignore them for now
15+ leak:tbb::internal::task_stream<3>::initialize*
Original file line number Diff line number Diff line change @@ -221,15 +221,16 @@ endif()
221221target_link_libraries (vdb_test ${OPENVDB_TEST_DEPENDENT_LIBS} )
222222add_test (NAME vdb_unit_test COMMAND $<TARGET_FILE:vdb_test> -v)
223223
224- # For the undefined behaviour sanitizer, add the suppression file and
225- # additional options
226-
224+ # For the sanitizers, add the suppression files and additional options
227225get_filename_component (PATH_TO_PROJECT_ROOT ${CMAKE_CURRENT_LIST_DIR} DIRECTORY )
228226get_filename_component (PATH_TO_PROJECT_ROOT ${PATH_TO_PROJECT_ROOT} DIRECTORY )
229227get_filename_component (PATH_TO_PROJECT_ROOT ${PATH_TO_PROJECT_ROOT} DIRECTORY )
228+ set (LSAN_SUPRESSION_FILE ${PATH_TO_PROJECT_ROOT} /cmake/scripts/lsan.supp)
230229set (UBSAN_SUPRESSION_FILE ${PATH_TO_PROJECT_ROOT} /cmake/scripts/ubsan.supp)
231230
232- set_tests_properties (vdb_unit_test PROPERTIES
233- ENVIRONMENT
234- "$<$<CONFIG:UBSAN>:UBSAN_OPTIONS=halt_on_error=1 report_error_type=1 suppressions=${UBSAN_SUPRESSION_FILE } >" )
231+ set (UBSAN_OPTS "$<$<CONFIG:UBSAN>:UBSAN_OPTIONS=halt_on_error=1 report_error_type=1 suppressions= ${UBSAN_SUPRESSION_FILE} >" )
232+ set (LSAN_OPTS "$<$<CONFIG:LSAN>:LSAN_OPTIONS=suppressions= ${LSAN_SUPRESSION_FILE} >" )
233+ set (ASAN_OPTS "$<$<CONFIG:ASAN>:LSAN_OPTIONS= suppressions=${LSAN_SUPRESSION_FILE } >" )
235234
235+ set_tests_properties (vdb_unit_test PROPERTIES
236+ ENVIRONMENT "$<JOIN:${UBSAN_OPTS} ;${LSAN_OPTS} ;${ASAN_OPTS} , >" )
Original file line number Diff line number Diff line change @@ -133,14 +133,16 @@ endif()
133133
134134add_test (NAME vdb_ax_unit_test COMMAND vdb_ax_test -v WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} /../)
135135
136- # For the undefined behaviour sanitizer, add the suppression file and
137- # additional options
138-
136+ # For the sanitizers, add the suppression files and additional options
139137get_filename_component (PATH_TO_PROJECT_ROOT ${CMAKE_CURRENT_LIST_DIR} DIRECTORY )
140138get_filename_component (PATH_TO_PROJECT_ROOT ${PATH_TO_PROJECT_ROOT} DIRECTORY )
141139get_filename_component (PATH_TO_PROJECT_ROOT ${PATH_TO_PROJECT_ROOT} DIRECTORY )
140+ set (LSAN_SUPRESSION_FILE ${PATH_TO_PROJECT_ROOT} /cmake/scripts/lsan.supp)
142141set (UBSAN_SUPRESSION_FILE ${PATH_TO_PROJECT_ROOT} /cmake/scripts/ubsan.supp)
143142
143+ set (UBSAN_OPTS "$<$<CONFIG:UBSAN>:UBSAN_OPTIONS=halt_on_error=1 report_error_type=1 suppressions=${UBSAN_SUPRESSION_FILE} >" )
144+ set (LSAN_OPTS "$<$<CONFIG:LSAN>:LSAN_OPTIONS=suppressions=${LSAN_SUPRESSION_FILE} >" )
145+ set (ASAN_OPTS "$<$<CONFIG:ASAN>:LSAN_OPTIONS=suppressions=${LSAN_SUPRESSION_FILE} >" )
146+
144147set_tests_properties (vdb_ax_unit_test PROPERTIES
145- ENVIRONMENT
146- "$<$<CONFIG:UBSAN>:UBSAN_OPTIONS=halt_on_error=1 report_error_type=1 suppressions=${UBSAN_SUPRESSION_FILE} >" )
148+ ENVIRONMENT "$<JOIN:${UBSAN_OPTS} ;${LSAN_OPTS} ;${ASAN_OPTS} , >" )
You can’t perform that action at this time.
0 commit comments