Merge pull request #55684 from athanatos/sjust/wip-seastar-asan-fibers

crimson: fixes for stack-use-after-return on recent clang and gcc versions

Reviewed-by: Matan Breizman <mbreizma@redhat.com>
Reviewed-by: Kefu Chai <tchaikov@gmail.com>
This commit is contained in:
Samuel Just 2024-02-21 10:17:56 -08:00 committed by GitHub
commit ed736fab6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 2 deletions

View File

@ -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)

View 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);
}

View File

@ -808,8 +808,8 @@ seastar::future<MURef<MOSDMap>> OSDSingletonState::build_incremental_map_msg(
crimson::make_message<MOSDMap>(
monc.get_fsid(),
osdmap->get_encoding_features()),
[this, &first, FNAME, last](unsigned int map_message_max,
auto& m) {
[this, &first, FNAME, last](auto &map_message_max,
auto &m) {
m->cluster_osdmap_trim_lower_bound = superblock.cluster_osdmap_trim_lower_bound;
m->newest_map = superblock.get_newest_map();
auto maybe_handle_mapgap = seastar::now();