From: Kefu Chai Date: Sun, 24 Mar 2024 13:40:28 +0000 (+0800) Subject: cmake: prevent ASAN_OPTIONS from detect_odr_violation X-Git-Tag: testing/wip-batrick-testing-20240411.154038~105^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a837f494b5a82555313e7424adfaee96910a4673;p=ceph-ci.git 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 --- 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