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

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 13:05:09 PDT 2019


hctim created this revision.
hctim added reviewers: vlad.tsyrklevich, morehouse.
Herald added subscribers: llvm-commits, Sanitizers, kubamracek.
Herald added projects: Sanitizers, LLVM.

Add a reentrancy guard for GPA::allocate(). This means that any
recursive allocations will fall back to the supporting allocator. In future
patches, we will introduce stack trace collection support. The unwinder will be
provided by the supporting allocator, and we can't guarantee they don't call
malloc() (e.g. backtrace() on posix may call dlopen(), which may call malloc().

Furthermore, this patch packs the new TLS reentrancy guard into a thread local
struct, so that TLS variables should be hopefully not fall across cache lines.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D63736

Files:
  compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp
  compiler-rt/lib/gwp_asan/guarded_pool_allocator.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63736.206285.patch
Type: text/x-patch
Size: 4249 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190624/d45f35e4/attachment.bin>


More information about the llvm-commits mailing list