fix(net): scope GCC -Wno-tsan to Http.cpp and fix StallServer race

This commit is contained in:
faumaray committed 2026-11-26 22:00:17 +03:00
1 parent 66baae74a0
commit 9920bfdaac
2 files changed
+12 -1

No files matched your search

+10
View File
@@ -9,3 +9,13 @@ void_add_module(Net
OpenSSL::Crypto
Threads::Threads
)
if(VOID_ENABLE_TSAN AND TARGET Void_Net)
# Boost.Asio 1.84's std_fenced_block calls std::atomic_thread_fence, which
# GCC warns is unsupported under -fsanitize=thread (-Werror=tsan). Keep
# hardware fences intact and scope the diagnostic suppression solely to
# Http.cpp so HttpServer.cpp and all other TUs keep full -Werror=tsan.
set_source_files_properties("${CMAKE_CURRENT_LIST_DIR}/Http.cpp"
PROPERTIES COMPILE_OPTIONS "$<$<CXX_COMPILER_ID:GNU>:-Wno-tsan>"
)
endif()
+2 -1
View File
@@ -273,8 +273,9 @@ Void::Testing::Test http_client_timeout_bounds_a_stalled_server()
~StallServer()
{
if (conn >= 0) ::close(conn);
if (fd >= 0) ::shutdown(fd, SHUT_RDWR);
if (worker.joinable()) worker.join();
if (conn >= 0) ::close(conn);
if (fd >= 0) ::close(fd);
}
};