diff options
Diffstat (limited to 'chromium/components/gwp_asan')
3 files changed, 16 insertions, 4 deletions
diff --git a/chromium/components/gwp_asan/client/guarded_page_allocator.cc b/chromium/components/gwp_asan/client/guarded_page_allocator.cc index 7031854ba98..0d56d4cc3ff 100644 --- a/chromium/components/gwp_asan/client/guarded_page_allocator.cc +++ b/chromium/components/gwp_asan/client/guarded_page_allocator.cc @@ -10,6 +10,7 @@ #include "base/bits.h" #include "base/debug/stack_trace.h" +#include "base/logging.h" #include "base/no_destructor.h" #include "base/process/process_metrics.h" #include "base/rand_util.h" diff --git a/chromium/components/gwp_asan/client/sampling_malloc_shims_unittest.cc b/chromium/components/gwp_asan/client/sampling_malloc_shims_unittest.cc index d7b6660d13c..3cb6efb7744 100644 --- a/chromium/components/gwp_asan/client/sampling_malloc_shims_unittest.cc +++ b/chromium/components/gwp_asan/client/sampling_malloc_shims_unittest.cc @@ -167,7 +167,13 @@ MULTIPROCESS_TEST_MAIN_WITH_SETUP( return kFailure; } -TEST_F(SamplingMallocShimsTest, BasicFunctionality) { +// Flaky on Mac: https://crbug.com/1087372 +#if defined(OS_MACOSX) +#define MAYBE_BasicFunctionality DISABLED_BasicFunctionality +#else +#define MAYBE_BasicFunctionality BasicFunctionality +#endif +TEST_F(SamplingMallocShimsTest, MAYBE_BasicFunctionality) { runTest("BasicFunctionality"); } diff --git a/chromium/components/gwp_asan/client/sampling_partitionalloc_shims_unittest.cc b/chromium/components/gwp_asan/client/sampling_partitionalloc_shims_unittest.cc index 54a6752b87d..79ca840dbe3 100644 --- a/chromium/components/gwp_asan/client/sampling_partitionalloc_shims_unittest.cc +++ b/chromium/components/gwp_asan/client/sampling_partitionalloc_shims_unittest.cc @@ -50,10 +50,15 @@ constexpr size_t kLoopIterations = kSamplingFrequency * 4; constexpr int kSuccess = 0; constexpr int kFailure = 1; +static void HandleOOM(size_t unused_size) { + LOG(FATAL) << "Out of memory."; +} + class SamplingPartitionAllocShimsTest : public base::MultiProcessTest { public: static void multiprocessTestSetup() { crash_reporter::InitializeCrashKeys(); + base::PartitionAllocGlobalInit(HandleOOM); InstallPartitionAllocHooks( AllocatorState::kMaxMetadata, AllocatorState::kMaxMetadata, AllocatorState::kMaxSlots, kSamplingFrequency, base::DoNothing()); @@ -72,7 +77,7 @@ class SamplingPartitionAllocShimsTest : public base::MultiProcessTest { MULTIPROCESS_TEST_MAIN_WITH_SETUP( BasicFunctionality, SamplingPartitionAllocShimsTest::multiprocessTestSetup) { - base::PartitionAllocatorGeneric allocator; + base::PartitionAllocator allocator; allocator.init(); for (size_t i = 0; i < kLoopIterations; i++) { void* ptr = allocator.root()->Alloc(1, kFakeType); @@ -92,7 +97,7 @@ TEST_F(SamplingPartitionAllocShimsTest, BasicFunctionality) { MULTIPROCESS_TEST_MAIN_WITH_SETUP( Realloc, SamplingPartitionAllocShimsTest::multiprocessTestSetup) { - base::PartitionAllocatorGeneric allocator; + base::PartitionAllocator allocator; allocator.init(); void* alloc = GetPartitionAllocGpaForTesting().Allocate(base::GetPageSize()); @@ -121,7 +126,7 @@ TEST_F(SamplingPartitionAllocShimsTest, Realloc) { MULTIPROCESS_TEST_MAIN_WITH_SETUP( DifferentTypesDontOverlap, SamplingPartitionAllocShimsTest::multiprocessTestSetup) { - base::PartitionAllocatorGeneric allocator; + base::PartitionAllocator allocator; allocator.init(); std::set<void*> type1, type2; |