This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Calculate Range sets intersection
ClosedPublic

Authored by vitalybuka on May 30 2023, 10:51 PM.

Details

Summary

Will be used to handle Root Regions in LSAN D151781.

Diff Detail

Event Timeline

vitalybuka created this revision.May 30 2023, 10:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2023, 10:51 PM
Herald added a subscriber: Enna1. · View Herald Transcript
vitalybuka requested review of this revision.May 30 2023, 10:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2023, 10:51 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
MaskRay added a subscriber: MaskRay.
MaskRay added inline comments.
compiler-rt/lib/sanitizer_common/sanitizer_common_region.cpp
52 ↗(On Diff #526910)

Perhaps DCHECK_GE

vitalybuka added inline comments.May 31 2023, 12:20 PM
compiler-rt/lib/sanitizer_common/sanitizer_common_region.cpp
52 ↗(On Diff #526910)

lgtm, seems too obvious to be true

vitalybuka added inline comments.May 31 2023, 9:22 PM
compiler-rt/lib/sanitizer_common/sanitizer_common_region.cpp
52 ↗(On Diff #526910)

lgtm, seems too obvious to be true

I tried to say "will do" :)

MaskRay accepted this revision.May 31 2023, 9:34 PM
MaskRay added inline comments.
compiler-rt/lib/sanitizer_common/sanitizer_common_region.cpp
9 ↗(On Diff #527271)

This comment is different from sanitizer_common_region.h. Does this file need a comment when the header has one?

20 ↗(On Diff #527271)

if (a.empty() || b.empty()) can be removed as the generic algorithm can handle the cases.

compiler-rt/lib/sanitizer_common/sanitizer_common_region.h
9 ↗(On Diff #527271)

For now, this comment can state that this file computes the intersection between two arrays of ranges.

20 ↗(On Diff #527271)

Using Region to represent a range is fine in lsan, but the term may be confusing in sanitizer_common.

Range or Interval may be better.

compiler-rt/lib/sanitizer_common/tests/sanitizer_common_region_test.cpp
40 ↗(On Diff #527271)

static?

const Region& => const Region &

std::ostream* => std::ostream *

This revision is now accepted and ready to land.May 31 2023, 9:34 PM

Better to state in the summary that this file is going to be used by lsan.

vitalybuka retitled this revision from [sanitizer] Calculate Region sets intersection to [sanitizer] Calculate Range sets intersection.May 31 2023, 10:08 PM
vitalybuka edited the summary of this revision. (Show Details)
vitalybuka marked 5 inline comments as done.

update

MaskRay accepted this revision.Jun 1 2023, 1:07 PM

Will be used to handle Root Regions in LSAN.

Since you already have the lsan patch, you can attach its Dxxxx number in the commit message :)

Will be used to handle Root Regions in LSAN.

Since you already have the lsan patch, you can attach its Dxxxx number in the commit message :)

Done. Usually I think "stack" is enough to track dependecies.

vitalybuka edited the summary of this revision. (Show Details)Jun 1 2023, 1:10 PM
This revision was automatically updated to reflect the committed changes.

Will be used to handle Root Regions in LSAN.

Since you already have the lsan patch, you can attach its Dxxxx number in the commit message :)

Done. Usually I think "stack" is enough to track dependecies.

Yes, "stack" is enough for people who visit Phabricator. Dxxxx will be helpful for people who just read commit messages:)