This is an archive of the discontinued LLVM Phabricator instance.

[Asan] Don't use MetaData for size
Changes PlannedPublic

Authored by vitalybuka on Sep 1 2020, 2:59 AM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

If size > SizeClassMap::kMaxSize we should have enough space in red zone.

This also limits max allocation size to 2^45.

Diff Detail

Event Timeline

vitalybuka created this revision.Sep 1 2020, 2:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 1 2020, 2:59 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka requested review of this revision.Sep 1 2020, 2:59 AM
vitalybuka added a reviewer: Restricted Project.Sep 1 2020, 5:21 AM

This patch changes how the allocator works, so I don't think it qualifies as NFC.

compiler-rt/lib/asan/asan_allocator.cpp
86–89

s/to/of

86–89

Can we document why we're storing the requested size in the redzone instead of in metadata?

125–131

Can we add a function comment that explains what to pass as unused_beg?

546

Can we now move chung_beg into meta[0]?

vitalybuka updated this revision to Diff 289831.Sep 3 2020, 4:20 PM
vitalybuka marked 4 inline comments as done.

comments

This patch changes how the allocator works, so I don't think it qualifies as NFC.

According https://llvm.org/docs/Lexicon.html NFC is for "is a pure refactoring/cleanup". And definition of refactoring includes "without changing external behavior". Almost ANY refactoring involves changing of internal behavior.
My understanding that "pure" here applies to both refactoring and cleanup and does no mean a special kind of refactoring. It just means do not include in that patch bugfixes and or even trivial external behavior changes.
That's how I understand NFC.
Here no external users, even other asan internal components, are going to be affected by thins change. So it's pure refactoring which just moves location of one internal field from one type to another.
E.g. D86917 is a different story as someone we may find a fixed bug, although it's very unlikely.

compiler-rt/lib/asan/asan_allocator.cpp
546

I am going to move it out from meta as well D86931

vitalybuka updated this revision to Diff 290163.Sep 6 2020, 7:30 PM
vitalybuka edited the summary of this revision. (Show Details)

use headers

vitalybuka retitled this revision from [NFC][Asan] Don't use MetaData for size to [Asan] Don't use MetaData for size.Sep 8 2020, 1:10 PM
vitalybuka edited the summary of this revision. (Show Details)
vitalybuka edited the summary of this revision. (Show Details)
vitalybuka planned changes to this revision.Sep 9 2020, 9:49 PM