diff options
| author | Alex Shlyapnikov <alekseys@google.com> | 2018-03-28 18:22:40 +0000 |
|---|---|---|
| committer | Alex Shlyapnikov <alekseys@google.com> | 2018-03-28 18:22:40 +0000 |
| commit | 10f50a44c1fa25463b0cb819f424abfbca336c9e (patch) | |
| tree | c1513755b95befd6ad96adb89ecc0e57e32d3bca /compiler-rt/lib/sanitizer_common/sanitizer_allocator.h | |
| parent | b873748e151272bfe5cd3eebcf8965bb200397aa (diff) | |
| download | bcm5719-llvm-10f50a44c1fa25463b0cb819f424abfbca336c9e.tar.gz bcm5719-llvm-10f50a44c1fa25463b0cb819f424abfbca336c9e.zip | |
[ASan] Report proper ASan error on allocator failures instead of CHECK(0)-ing
Summary:
Currently many allocator specific errors (OOM, for example) are reported as
a text message and CHECK(0) termination, not stack, no details, not too
helpful nor informative. To improve the situation, ASan detailed errors were
defined and reported under the appropriate conditions.
Issue: https://github.com/google/sanitizers/issues/887
Reviewers: eugenis
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D44404
llvm-svn: 328722
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_allocator.h')
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_allocator.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h index 38368361de6..8c6bb3968d2 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h @@ -43,9 +43,12 @@ struct DieOnFailure { static void NORETURN *OnOOM(); }; +void PrintHintAllocatorCannotReturnNull(const char *options_name); + // Returns true if allocator detected OOM condition. Can be used to avoid memory // hungry operations. Set when AllocatorReturnNullOrDieOnOOM() is called. bool IsAllocatorOutOfMemory(); +void SetAllocatorOutOfMemory(); // Allocators call these callbacks on mmap/munmap. struct NoOpMapUnmapCallback { |

