This is an archive of the discontinued LLVM Phabricator instance.

tsan: remove tracking of racy addresses
ClosedPublic

Authored by dvyukov on Jul 21 2022, 3:05 AM.

Details

Summary

We used to deduplicate based on the race address to prevent lots
of repeated reports about the same race.

But now we clear the shadow for the racy address in DoReportRace:

// This prevents trapping on this address in future.
for (uptr i = 0; i < kShadowCnt; i++)
  StoreShadow(&shadow_mem[i], i == 0 ? Shadow::kRodata : Shadow::kEmpty);

It should have the same effect of not reporting duplicates
(and actually better because it's automatically reset when the memory is reallocated).

So drop the address deduplication code. Both simpler and faster.

Diff Detail

Event Timeline

dvyukov created this revision.Jul 21 2022, 3:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 3:05 AM
Herald added a subscriber: Enna1. · View Herald Transcript
dvyukov requested review of this revision.Jul 21 2022, 3:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 3:05 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript

On the second thought maybe we better to keep this... need to think more.

On the second thought maybe we better to keep this... need to think more.

Yes, I think this is still a good idea.

melver accepted this revision.Jul 25 2022, 12:20 AM
This revision is now accepted and ready to land.Jul 25 2022, 12:20 AM
This revision was landed with ongoing or failed builds.Jul 25 2022, 1:34 AM
This revision was automatically updated to reflect the committed changes.