From 2b638869b2986386733fbb29ed95c57f84c4f931 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 1 Jul 2026 13:01:05 +0800 Subject: [PATCH] crimson: keep seastar's sanitizers in lockstep with WITH_ASAN Seastar_SANITIZE defaults to "DEFAULT", which turns on ASan and UBSan for Debug and Sanitize builds regardless of ceph's WITH_ASAN. A Debug build with WITH_ASAN=OFF then instruments seastar while ceph links tcmalloc, and the seastar tests crash before main() because ASan calls the allocator via dlsym before it is initialized. Force Seastar_SANITIZE to follow WITH_ASAN, next to the other forced Seastar_* cache variables, so seastar is sanitized only when ceph is. This keeps the fix on the ceph side instead of carrying a seastar fork patch. Signed-off-by: Kefu Chai --- src/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6674ccdd38c..4eb283d4959 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -475,6 +475,11 @@ if(WITH_CRIMSON) set(Seastar_API_LEVEL "6" CACHE STRING "" FORCE) set(Seastar_IO_URING ${HAVE_LIBURING} CACHE BOOL "" FORCE) set(Seastar_DEPRECATED_OSTREAM_FORMATTERS OFF CACHE BOOL "" FORCE) + if(WITH_ASAN) + set(Seastar_SANITIZE "ON" CACHE STRING "" FORCE) + else() + set(Seastar_SANITIZE "OFF" CACHE STRING "" FORCE) + endif() if(Seastar_DPDK) find_package(dpdk QUIET) if(NOT DPDK_FOUND) -- 2.47.3