tsan: remove tracking of racy addresses
authorDmitry Vyukov <dvyukov@google.com>
Thu, 21 Jul 2022 09:52:17 +0000 (11:52 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Mon, 25 Jul 2022 08:33:26 +0000 (10:33 +0200)
commit7505cc301f718c3a4015595729609aadcd702890
tree209c54d0ff0cf03ebdfab5b9ed87a06f0235e024
parentacd80a29ae7dcffabcb41e8579ebf4f371f0ddd7
tsan: remove tracking of racy addresses

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.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D130240
compiler-rt/lib/tsan/rtl/tsan_flags.inc
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp
compiler-rt/lib/tsan/rtl/tsan_rtl.h
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
compiler-rt/lib/tsan/tests/unit/tsan_flags_test.cpp
compiler-rt/test/tsan/stress.cpp