mirror of
https://github.com/ceph/ceph
synced 2026-08-01 22:45:39 +00:00
cmake/.../FindSanitizers: add check for Sanitizers_FIBER_SUPPPORT
With newer clang and gcc versions (observed on clang-17.0.6 as well as gcc 12/13), asan is throwing stack-use-after-return during OSD startup related to usage of seastar::async, which relies on swapcontext internally. seastar/src/core/thread.cc supports asan's hooks, but only if SEASTAR_HAVE_ASAN_FIBER_SUPPORT is set. seastar's CMakeList.txt sets it based on Sanitizers_FIBER_SUPPORT, which probably should be set by the module at src/seastar/cmake/FindSanitizers.cmake, but that module doesn't seem to be actually invoked anywhere. Ceph's version of that module (cmake/modules/FindSanitizers.cmake) does not set Sanitizers_FIBER_SUPPORT. This commit adds that check as well as the related code snippet. Fixes: https://tracker.ceph.com/issues/64512 Signed-off-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
parent
e160811c5f
commit
f719449280
@ -57,6 +57,9 @@ string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${Sanitizers_COMPILE_OPTIONS}")
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${Sanitizers_COMPILE_OPTIONS})
|
||||
check_cxx_source_compiles("int main() {}"
|
||||
Sanitizers_ARE_SUPPORTED)
|
||||
|
||||
file (READ ${CMAKE_CURRENT_LIST_DIR}/code_tests/Sanitizers_fiber_test.cc _sanitizers_fiber_test_code)
|
||||
check_cxx_source_compiles ("${_sanitizers_fiber_test_code}" Sanitizers_FIBER_SUPPORT)
|
||||
cmake_pop_check_state()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
11
cmake/modules/code_tests/Sanitizers_fiber_test.cc
Normal file
11
cmake/modules/code_tests/Sanitizers_fiber_test.cc
Normal file
@ -0,0 +1,11 @@
|
||||
#include <cstddef>
|
||||
|
||||
extern "C" {
|
||||
void __sanitizer_start_switch_fiber(void**, const void*, size_t);
|
||||
void __sanitizer_finish_switch_fiber(void*, const void**, size_t*);
|
||||
}
|
||||
|
||||
int main() {
|
||||
__sanitizer_start_switch_fiber(nullptr, nullptr, 0);
|
||||
__sanitizer_finish_switch_fiber(nullptr, nullptr, nullptr);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user