]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart: load lsan/asan suppressions on WITH_ASAN builds
authorSun Yuechi <sunyuechi@iscas.ac.cn>
Sun, 21 Jun 2026 08:42:54 +0000 (16:42 +0800)
committerSun Yuechi <sunyuechi@iscas.ac.cn>
Mon, 22 Jun 2026 05:41:04 +0000 (13:41 +0800)
AddCephTest.cmake runs unittests with
ASAN_OPTIONS/LSAN_OPTIONS=suppressions=qa/{asan,lsan}.supp, but vstart.sh
does not, so on a WITH_ASAN build `ceph-mon --mkfs` aborts on a still-reachable
leak that those suppressions cover and fails the "ceph API tests" job. Export
the same options when WITH_ASAN=ON.

Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
src/vstart.sh

index 7f5421bffced235c7afc69348c6c3aabde45c806..9e5e6cd3c68ee7eda35616a391ae78659fccaf5f 100755 (executable)
@@ -64,6 +64,14 @@ if [ -e CMakeCache.txt ]; then
     CEPH_ROOT=$(get_cmake_variable ceph_SOURCE_DIR)
     CEPH_BUILD_DIR=`pwd`
     [ -z "$MGR_PYTHON_PATH" ] && MGR_PYTHON_PATH=$CEPH_ROOT/src/pybind/mgr
+
+    # Point the sanitizers at the in-tree suppression files so vstart daemons
+    # ignore the same still-reachable third-party leaks AddCephTest.cmake suppresses for
+    # unittests. Without this `ceph-mon --mkfs` aborts on LeakSanitizer.
+    if [ "$(get_cmake_variable WITH_ASAN)" = "ON" ]; then
+        [ -z "$ASAN_OPTIONS" ] && export ASAN_OPTIONS="suppressions=$CEPH_ROOT/qa/asan.supp,detect_odr_violation=0"
+        [ -z "$LSAN_OPTIONS" ] && export LSAN_OPTIONS="suppressions=$CEPH_ROOT/qa/lsan.supp,print_suppressions=0"
+    fi
 fi
 
 # use CEPH_BUILD_ROOT to vstart from a 'make install'