This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by alekseyshl on Jun 12 2018, 11:30 AM.

Details

Summary

Following up on and complementing 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.

Diff Detail

Event Timeline

alekseyshl created this revision.Jun 12 2018, 11:30 AM
vitalybuka accepted this revision.Jun 18 2018, 11:10 AM
vitalybuka added inline comments.
lib/tsan/tests/unit/tsan_mman_test.cc
205

Why do you remove all these tests?

This revision is now accepted and ready to land.Jun 18 2018, 11:10 AM
alekseyshl added inline comments.Jun 18 2018, 11:17 AM
lib/tsan/tests/unit/tsan_mman_test.cc
205

Death tests are covered by tests in sanitizer_common now, there's no point in duplicating them and DEATH tests here are a nuisance, check the comment above, next to "#if !SANITIZER_DEBUG".

memalign is not covered by common tests yet, but will be some time soon and then the last death test will be removed from here.

This revision was automatically updated to reflect the committed changes.
test/sanitizer_common/TestCases/allocator_returns_null.cc