[PATCH] D63736: [GWP-ASan] Guard against recursive allocs. Pack TLS for perf.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 15:33:04 PDT 2019


eugenis added a comment.

In D63736#1556524 <https://reviews.llvm.org/D63736#1556524>, @vlad.tsyrklevich wrote:

> In D63736#1556463 <https://reviews.llvm.org/D63736#1556463>, @hctim wrote:
>
> > In D63736#1556349 <https://reviews.llvm.org/D63736#1556349>, @eugenis wrote:
> >
> > > Do we need similar protection in deallocate?
> >
> >
> > We shouldn't need to. `GPA::deallocate()` may call `malloc()` and `free()`, but can only be called with guarded allocations. Recursion is okay (and desirable, as the unwinder's implementation is okay to be sampled) in `deallocate()`.
>
>
> Don't we hold the Mutex during AllocationMetadata::RecordDeallocation()? Doesn't that mean that the unwinder could cause deadlock during deallocation?


We can not assume that the unwinder is reentrant, so we need to guard all unwinder calls. We can not really fallback to the system allocator in free(), which means that the rest of the deallocation code will have to be reentrant.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63736/new/

https://reviews.llvm.org/D63736





More information about the llvm-commits mailing list