This is an archive of the discontinued LLVM Phabricator instance.

[Sanitizers] 64 bit allocator respects allocator_may_return_null flag
ClosedPublic

Authored by alekseyshl on Jun 22 2017, 3:56 PM.

Details

Summary

Make SizeClassAllocator64 return nullptr when it encounters OOM, which
allows the entire sanitizer's allocator to follow
allocator_may_return_null=1 policy
(LargeMmapAllocator: D34243, SizeClassAllocator64: D34433).

Diff Detail

Repository
rL LLVM

Event Timeline

alekseyshl created this revision.Jun 22 2017, 3:56 PM
eugenis accepted this revision.Jun 23 2017, 2:52 PM
eugenis added inline comments.
lib/sanitizer_common/sanitizer_allocator_primary64.h
454 ↗(On Diff #103655)

Do you want to keep this error message?
I think it was helpful on a couple of occasions.

This revision is now accepted and ready to land.Jun 23 2017, 2:52 PM
alekseyshl added inline comments.Jun 23 2017, 5:55 PM
lib/sanitizer_common/sanitizer_allocator_primary64.h
454 ↗(On Diff #103655)

Well, ok, I'll bring it back. It'll require a flag to show it only once though, otherwise the client which can survive null returned by malloc might be spammed by those messages.

  • Bring the oom message back.
alekseyshl marked 2 inline comments as done.Jun 26 2017, 2:42 PM
This revision was automatically updated to reflect the committed changes.