]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: build seastar with the default allocator under ASan
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 02:57:27 +0000 (10:57 +0800)
With this build configured as RelWithDebInfo, seastar keeps its own
allocator instead of falling back to libc's. Under ASan that allocator
is called (via dlsym) before it is initialized and SIGSEGVs every
seastar/crimson unittest before main(). Define SEASTAR_DEFAULT_ALLOCATOR
under WITH_ASAN to keep seastar on the libc allocator.

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

index a93a38d7501f14e1a5ee3a0d85c97b53e94fe48c..8b0cd023cfcd028c3732652c06aab6670bb346bd 100644 (file)
@@ -510,6 +510,11 @@ if(WITH_CRIMSON)
     "-Wno-attributes"
     "-Wno-pessimizing-move"
     "-Wno-address-of-packed-member")
+  if(WITH_ASAN)
+    # As built here (RelWithDebInfo) seastar keeps its own allocator, which
+    # ASan calls via dlsym before init, crashing every test before main().
+    target_compile_definitions(seastar PUBLIC SEASTAR_DEFAULT_ALLOCATOR)
+  endif()
   add_subdirectory(crimson)
   add_dependencies(crimson-osd erasure_code)
 endif()