[lsan] Reduce StopTheWorld access to StackDepot
authorVitaly Buka <vitalybuka@google.com>
Wed, 8 Dec 2021 05:40:20 +0000 (21:40 -0800)
committerVitaly Buka <vitalybuka@google.com>
Thu, 9 Dec 2021 19:43:30 +0000 (11:43 -0800)
commitf72e50946c713c1e2444abd4a2e3f455ebb1045e
tree56bd153be810cf9beb9857f1837d7e0f8980ea8a
parent0b20c96fd65d44ddb3be70b2ac1f51058a105bc5
[lsan] Reduce StopTheWorld access to StackDepot

StackDepot locks some stuff. As is there is small probability to
deadlock if we stop thread which locked the Depot.

We need either Lock/Unlock StackDepot for StopTheWorld, or don't
interact with StackDepot from there.

This patch does not run LeakReport under StopTheWorld. LeakReport
contains most of StackDepot access.

As a bonus this patch will help to resolve kMaxLeaksConsidered FIXME.

Depends on D114498.

Reviewed By: morehouse, kstoimenov

Differential Revision: https://reviews.llvm.org/D115284
compiler-rt/lib/lsan/lsan_common.cpp
compiler-rt/lib/lsan/lsan_common.h