From a837f494b5a82555313e7424adfaee96910a4673 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 24 Mar 2024 21:40:28 +0800 Subject: [PATCH] cmake: prevent ASAN_OPTIONS from detect_odr_violation turns out we have multiple copies of following symbol defined by rbd executable: ``` AddressSanitizer: odr-violation: global 'ceph::buffer::list::always_empty_bptr' at /home/jenkins-build/build/workspace/ceph-pull-requests/src/common/buffer.cc:1267:34 ``` before addressing it. let's disable this warning. Refs https://tracker.ceph.com/issues/65098 Signed-off-by: Kefu Chai --- cmake/modules/AddCephTest.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake/modules/AddCephTest.cmake b/cmake/modules/AddCephTest.cmake index 45bb26aa615..4593070fe17 100644 --- a/cmake/modules/AddCephTest.cmake +++ b/cmake/modules/AddCephTest.cmake @@ -25,6 +25,15 @@ function(add_ceph_test test_name test_path) PROPERTY ENVIRONMENT UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1) endif() + if(WITH_ASAN) + # AddressSanitizer: odr-violation: global 'ceph::buffer::list::always_empty_bptr' at + # /home/jenkins-build/build/workspace/ceph-pull-requests/src/common/buffer.cc:1267:34 + # see https://tracker.ceph.com/issues/65098 + set_property(TEST ${test_name} + APPEND + PROPERTY ENVIRONMENT + ASAN_OPTIONS=detect_odr_violation=0) + endif() set_property(TEST ${test_name} PROPERTY TIMEOUT ${CEPH_TEST_TIMEOUT}) # Crimson seastar unittest always run with --smp N to start N threads. By default, crimson seastar unittest -- 2.39.5