[all-commits] [llvm/llvm-project] 7505cc: tsan: remove tracking of racy addresses

Dmitry Vyukov via All-commits all-commits at lists.llvm.org
Mon Jul 25 01:34:12 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7505cc301f718c3a4015595729609aadcd702890
  Author: Dmitry Vyukov <dvyukov at google.com>
  Date:   2022-07-25 (Mon, 25 Jul 2022)

  Changed paths:
    M compiler-rt/lib/tsan/rtl/tsan_flags.inc
    M compiler-rt/lib/tsan/rtl/tsan_rtl.cpp
    M compiler-rt/lib/tsan/rtl/tsan_rtl.h
    M compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
    M compiler-rt/lib/tsan/tests/unit/tsan_flags_test.cpp
    M compiler-rt/test/tsan/stress.cpp

  Log Message:
  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

More information about the All-commits mailing list