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 <k.chai@proxmox.com>
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)