]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cmake/.../FindSanitizers: add check for Sanitizers_FIBER_SUPPPORT
authorSamuel Just <sjust@redhat.com>
Tue, 20 Feb 2024 23:56:26 +0000 (23:56 +0000)
committerSamuel Just <sjust@redhat.com>
Wed, 21 Feb 2024 00:20:23 +0000 (16:20 -0800)
commitf719449280d93e96cd03923def9719e0d479e4c1
tree8d9c4bf006e3911fe52249ddcd195e073b70fee5
parente160811c5fec46717a117ac02b6b29609f067233
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>
cmake/modules/FindSanitizers.cmake
cmake/modules/code_tests/Sanitizers_fiber_test.cc [new file with mode: 0644]