[PATCH] D42198: [Sanitizers] Make common allocator agnostic to failure handling modes.

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 13:23:16 PST 2018


alekseyshl created this revision.
alekseyshl added a reviewer: eugenis.
Herald added subscribers: Sanitizers, kubamracek.

Make common allocator agnostic to failure handling modes and move the
decision up to the particular sanitizer's allocator, where the context
is available (call stack, parameters, return nullptr/crash mode etc.)

It simplifies the common allocator and allows the particular sanitizer's
allocator to generate more specific and detailed error reports (which
will be implemented later).

The behavior is largely the same, except one case, the violation of the
common allocator's check for "size + alignment" overflow is now reportied
as OOM instead of "bad request". It feels like a worthy tradeoff and
"size + alignment" is huge in this case anyway (thus, can be interpreted
as not enough memory to satisfy the request). There's also a Report()
statement added there.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D42198

Files:
  lib/asan/asan_allocator.cc
  lib/hwasan/hwasan_allocator.cc
  lib/lsan/lsan_allocator.cc
  lib/msan/msan_allocator.cc
  lib/sanitizer_common/sanitizer_allocator.cc
  lib/sanitizer_common/sanitizer_allocator_combined.h
  lib/sanitizer_common/sanitizer_allocator_internal.h
  lib/sanitizer_common/sanitizer_allocator_secondary.h
  lib/sanitizer_common/tests/sanitizer_allocator_test.cc
  lib/tsan/rtl/tsan_mman.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42198.130264.patch
Type: text/x-patch
Size: 17689 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180117/b85cd8b2/attachment-0001.bin>


More information about the llvm-commits mailing list