Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class HomeObjectConan(ConanFile):
name = "homeobject"
version = "5.0.0"
version = "5.0.1"

homepage = "https://github.com/eBay/HomeObject"
description = "Blob Store built on HomeStore"
Expand Down
6 changes: 5 additions & 1 deletion src/lib/homestore_backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ add_test(NAME HomestoreTestScrubber COMMAND homestore_test_scrubber -csv error -
--override_config nuraft_mesg_config.mesg_factory_config.data_request_deadline_secs:10)

# All tests share disk, port, and shared-memory resources, so run them serially to avoid parallel conflicts.
# LSAN_OPTIONS=leak_check_at_exit=0: HSHomeObject::shutdown() now runs the leak check itself, right after
# iomanager.stop() returns (all worker threads already joined), to avoid racing LSan's own at-exit scan
# against that same teardown (see hs_homeobject.cpp:shutdown()). This disables the redundant, racy automatic scan.
set_tests_properties(
HomestoreTestBlob
HomestoreTestMisc
Expand All @@ -200,7 +203,8 @@ set_tests_properties(
HomestoreTestGC
HomestoreTestGC_ShardRaceTests
HomestoreTestScrubber
PROPERTIES RUN_SERIAL TRUE)
PROPERTIES RUN_SERIAL TRUE
ENVIRONMENT "LSAN_OPTIONS=leak_check_at_exit=0")



Expand Down
23 changes: 23 additions & 0 deletions src/lib/homestore_backend/hs_homeobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
#include <iomgr/drive.hpp>
#include <sisl/version.hpp>

#if defined(__SANITIZE_ADDRESS__)
#define HO_HAS_LSAN 1
#elif defined(__has_feature)
#if __has_feature(address_sanitizer)
#define HO_HAS_LSAN 1
#endif
#endif

#if defined(HO_HAS_LSAN)
#include <sanitizer/lsan_interface.h>
#endif

#include <homeobject/homeobject.hpp>
#include "hs_homeobject.hpp"
#include "heap_chunk_selector.h"
Expand Down Expand Up @@ -557,6 +569,17 @@ void HSHomeObject::shutdown() {
gc_mgr_.reset();
scrub_mgr_.reset();
iomanager.stop();

// Run LSan's leak check here, now that iomanager.stop() has fully joined every worker thread, instead of
// relying on its automatic at-exit scan: that scan runs concurrently with the same thread teardown and can
// lose a race in the sanitizer runtime's own pipe-based memory-accessibility probe (IsAccessibleMemoryRange),
// aborting the process with a "CHECK failed ... write_errno" crash. Doing it here, synchronously after
// iomanager.stop() returns, avoids that race while still catching real leaks.
// LSAN_OPTIONS=leak_check_at_exit=0 (set for these ctest targets) disables the redundant automatic scan.
#if defined(HO_HAS_LSAN)
__lsan_do_leak_check();
#endif

LOGI("complete shutting down HomeStore");
}

Expand Down
Loading