]> git.apps.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)
committerMatan Breizman <mbreizma@redhat.com>
Mon, 6 May 2024 12:03:56 +0000 (15:03 +0300)
commit7875a7f3e8ae8b05ff492f1176e2c1419322e79a
treede2d0b456d34a6503b482506c33eede517ddf24f
parentc7c8866701863f4c194372f2126533b026a28a1c
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>
(cherry picked from commit f719449280d93e96cd03923def9719e0d479e4c1)
cmake/modules/FindSanitizers.cmake
cmake/modules/code_tests/Sanitizers_fiber_test.cc [new file with mode: 0644]