This is an archive of the discontinued LLVM Phabricator instance.

[lsan] Share platform allocator settings between ASan and LSan
ClosedPublic

Authored by mcgrathr on Aug 13 2020, 1:42 PM.

Details

Summary

This moves the platform-specific parameter logic from asan into
sanitizer_common so lsan can reuse it.

Diff Detail

Event Timeline

mcgrathr created this revision.Aug 13 2020, 1:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 13 2020, 1:42 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
mcgrathr requested review of this revision.Aug 13 2020, 1:42 PM
eugenis added inline comments.Aug 13 2020, 2:19 PM
compiler-rt/lib/lsan/lsan_allocator.h
65–66

I suspect this is not going to work on aarch64 with 39-bit address space.
Could you copy the chunk from ASan with the dynamic allocator base?

mcgrathr updated this revision to Diff 285768.Aug 14 2020, 3:01 PM

Refactor to share code directly with asan.

mcgrathr added inline comments.Aug 14 2020, 3:02 PM
compiler-rt/lib/lsan/lsan_allocator.h
65–66

I refactored to just cleanly share these settings between lsan and asan allocator setups directly via sanitizer_common/sanitizer_allocator.h. Now all of the platform-specific logic from asan should be unchanged and lsan should be changed to match asan on all platforms.

mcgrathr retitled this revision from [lsan] Follow SANITIZER_CAN_USE_ALLOCATOR64 for LSan allocator to [lsan] Share platform allocator settings between ASan and LSan.Aug 14 2020, 5:36 PM
mcgrathr edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Aug 17 2020, 12:24 PM
This revision was landed with ongoing or failed builds.Sep 16 2020, 1:31 PM
This revision was automatically updated to reflect the committed changes.