tsan: strip top inlined internal frames
authorDmitry Vyukov <dvyukov@google.com>
Thu, 15 Jul 2021 17:08:35 +0000 (19:08 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Thu, 15 Jul 2021 17:37:44 +0000 (19:37 +0200)
commit7b302fc9b04c7991cdb869b65316e0d72e41042e
tree0af165af95ded664c206dc41a4dfc3fd18c0e789
parenta99d420a937bd7792739767c8bed6d189a444c54
tsan: strip top inlined internal frames

The new GET_CURRENT_PC() can lead to spurious top inlined internal frames.
Here are 2 examples from bots, in both cases the malloc is supposed to be
the top frame (#0):

  WARNING: ThreadSanitizer: signal-unsafe call inside of a signal
    #0 __sanitizer::StackTrace::GetNextInstructionPc(unsigned long)
    #1 malloc

  Location is heap block of size 99 at 0xbe3800003800 allocated by thread T1:
    #0 __sanitizer::StackTrace::GetNextInstructionPc(unsigned long)
    #1 malloc

Let's strip these internal top frames from reports.
With other code changes I also observed some top frames
from __tsan::ScopedInterceptor, proactively remove these as well.

Differential Revision: https://reviews.llvm.org/D106081
compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp