diff options
author | Alex Shlyapnikov <alekseys@google.com> | 2018-06-20 17:10:33 +0000 |
---|---|---|
committer | Alex Shlyapnikov <alekseys@google.com> | 2018-06-20 17:10:33 +0000 |
commit | bac6a16525fe4aae2eb66dfd9f34b25ace86e8c9 (patch) | |
tree | 57acc9c1cb14c1645994132f90016f98a03cf093 /lib/sanitizer_common/sanitizer_allocator_local_cache.h | |
parent | ca08a27e22ec3db775a1b993f7116a4626fda01e (diff) |
[Sanitizers] Remove OOM/BadRequest allocator error handling policies.
Summary:
Remove the generic error nadling policies and handle each allocator error
explicitly. Although more verbose, it allows for more comprehensive, precise
and actionable allocator related failure reports.
This finishes up the series of changes of the particular sanitizer
allocators, improves the internal allocator error reporting and removes
now unused policies.
Reviewers: vitalybuka, cryptoad
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D48328
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335147 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_allocator_local_cache.h')
-rw-r--r-- | lib/sanitizer_common/sanitizer_allocator_local_cache.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sanitizer_common/sanitizer_allocator_local_cache.h b/lib/sanitizer_common/sanitizer_allocator_local_cache.h index 5bfe83b9f..1bb8fc27d 100644 --- a/lib/sanitizer_common/sanitizer_allocator_local_cache.h +++ b/lib/sanitizer_common/sanitizer_allocator_local_cache.h @@ -260,8 +260,11 @@ struct SizeClassAllocator32LocalCache { class_id, allocator, (TransferBatch *)c->batch[first_idx_to_drain]); // Failure to allocate a batch while releasing memory is non recoverable. // TODO(alekseys): Figure out how to do it without allocating a new batch. - if (UNLIKELY(!b)) - DieOnFailure::OnOOM(); + if (UNLIKELY(!b)) { + Report("FATAL: Internal error: %s's allocator failed to allocate a " + "transfer batch.\n", SanitizerToolName); + Die(); + } b->SetFromArray(&c->batch[first_idx_to_drain], count); c->count -= count; allocator->DeallocateBatch(&stats_, class_id, b); |