summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorFrancis Ricci <francisjricci@gmail.com>2017-02-13 22:20:07 +0000
committerFrancis Ricci <francisjricci@gmail.com>2017-02-13 22:20:07 +0000
commit7cda03e6d16ecd585e09eaefbc03b2433670c05d (patch)
treee0a69d9131b0f2dcd562086dfc30ceea72eb0ca7 /clang/lib/Parse/ParseDecl.cpp
parent48dfa1a6ed81f0d0d52b8172f823bbaab27f11ed (diff)
downloadbcm5719-llvm-7cda03e6d16ecd585e09eaefbc03b2433670c05d.tar.gz
bcm5719-llvm-7cda03e6d16ecd585e09eaefbc03b2433670c05d.zip
Use pthreads to manage thread-local storage on darwin for leak sanitizer
Summary: __thread is supported on Darwin, but is implemented dynamically via function calls to __tls_get_addr. This causes two issues when combined with leak sanitizer, due to malloc() interception. - The dynamic loader calls malloc during the process of loading the sanitizer dylib, while swapping a placeholder tlv_boostrap function for __tls_get_addr. This will cause tlv_bootstrap to be called in DisabledInThisThread() via the asan allocator. - The first time __tls_get_addr is called, it allocates memory for the thread-local object, during which it calls malloc(). This call will be intercepted, leading to an infinite loop in the asan allocator, in which the allocator calls DisabledInThisThread, which calls tls_get_addr, which calls into the allocator again. Reviewers: kcc, glider, kubamracek Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29786 llvm-svn: 294994
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud