Skip to content

Commit 5873c0d

Browse files
rlyerlymeta-codesync[bot]
authored andcommitted
Enable ASAN poisoning in internal tests
Summary: I didn't want ASAN poisoning to be enabled by default (to avoid breaking existing ASAN tiers), so it's opt in. However we want to opt all our tests into ASAN poisoning to catch regressions. Define a new BUCK rule called `cachelib_cpp_unittest` that defines a PP macro. That macro will enable ASAN poisoning for those tests. Also automatically set the oncall field for tests. This diff changes *all* cpp_unittest rules in Cachelib to use the new rule. Reviewed By: AlnisM Differential Revision: D104668331 fbshipit-source-id: 79de1d7fc3da36a489910d89d0c346a36cb617bd
1 parent 0fde82e commit 5873c0d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

cachelib/allocator/CacheAllocatorConfig.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,9 +749,13 @@ class CacheAllocatorConfig {
749749

750750
#if FOLLY_SANITIZE_ADDRESS
751751
// If true, slab memory is ASAN-poisoned on free and unpoisoned on allocation.
752-
// Disabled by default to avoid overhead in ASAN builds. Enable for testing
753-
// or when actively debugging memory issues.
752+
#ifdef CACHELIB_TEST_BUILD
753+
// Enabled by default in test builds
754+
bool enableSlabAsanPoisoning{true};
755+
#else
756+
// Disabled by default in production ASAN builds to avoid overhead.
754757
bool enableSlabAsanPoisoning{false};
758+
#endif
755759
#endif
756760

757761
friend CacheT;

0 commit comments

Comments
 (0)