[PATCH] D48087: [TSan] Report proper error on allocator failures instead of CHECK(0)-ing

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 12 11:30:35 PDT 2018


alekseyshl created this revision.
alekseyshl added a reviewer: dvyukov.
Herald added subscribers: Sanitizers, delcypher, kubamracek, srhines.

Following up on and complementing https://reviews.llvm.org/D44404 and other sanitizer allocators.

Currently many allocator specific errors (OOM, for example) are reported as
a text message and CHECK(0) termination, no stack, no details, not too
helpful nor informative. To improve the situation, detailed and structured
common errors were defined and reported under the appropriate conditions.

Common tests were generalized a bit to cover a slightly different TSan
stack reporting format, extended to verify errno value and returned
pointer value check is now explicit to facilitate debugging.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D48087

Files:
  lib/tsan/rtl/tsan_mman.cc
  lib/tsan/rtl/tsan_new_delete.cc
  lib/tsan/rtl/tsan_rtl.h
  lib/tsan/rtl/tsan_stack_trace.cc
  lib/tsan/rtl/tsan_stack_trace.h
  lib/tsan/tests/unit/tsan_mman_test.cc
  test/sanitizer_common/TestCases/Linux/aligned_alloc-alignment.cc
  test/sanitizer_common/TestCases/Linux/pvalloc-overflow.cc
  test/sanitizer_common/TestCases/Posix/posix_memalign-alignment.cc
  test/sanitizer_common/TestCases/allocator_returns_null.cc
  test/tsan/allocator_returns_null.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48087.150985.patch
Type: text/x-patch
Size: 23995 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180612/9034bf9d/attachment.bin>


More information about the llvm-commits mailing list