This is an archive of the discontinued LLVM Phabricator instance.

[Sanitizers] Make common allocator agnostic to failure handling modes.
ClosedPublic

Authored by alekseyshl on Jan 17 2018, 1:21 PM.

Details

Summary

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.

Diff Detail

Event Timeline

alekseyshl created this revision.Jan 17 2018, 1:21 PM
Herald added subscribers: Restricted Project, kubamracek. · View Herald TranscriptJan 17 2018, 1:21 PM
eugenis accepted this revision.Jan 17 2018, 2:21 PM
This revision is now accepted and ready to land.Jan 17 2018, 2:21 PM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.