summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/asan_rtl.cc
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-06-11 08:13:36 +0000
committerAlexey Samsonov <samsonov@google.com>2013-06-11 08:13:36 +0000
commitc8e736476365254800f741b46c230b11b95b2128 (patch)
tree5c009a00ec1fe0780bae2a103a2b1f402d4b1b10 /compiler-rt/lib/asan/asan_rtl.cc
parent53ff029d6236a03587cc46fe035e8df02ef7708b (diff)
downloadbcm5719-llvm-c8e736476365254800f741b46c230b11b95b2128.tar.gz
bcm5719-llvm-c8e736476365254800f741b46c230b11b95b2128.zip
[Sanitizer] support running external llvm-symbolizer on Mac
llvm-svn: 183730
Diffstat (limited to 'compiler-rt/lib/asan/asan_rtl.cc')
-rw-r--r--compiler-rt/lib/asan/asan_rtl.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc
index d5834aea77d..a1dc838ccad 100644
--- a/compiler-rt/lib/asan/asan_rtl.cc
+++ b/compiler-rt/lib/asan/asan_rtl.cc
@@ -536,6 +536,12 @@ void __asan_init() {
}
InstallSignalHandlers();
+
+ AsanTSDInit(AsanThread::TSDDtor);
+ // Allocator should be initialized before starting external symbolizer, as
+ // fork() on Mac locks the allocator.
+ InitializeAllocator();
+
// Start symbolizer process if necessary.
const char* external_symbolizer = common_flags()->external_symbolizer_path;
if (common_flags()->symbolize && external_symbolizer &&
@@ -551,7 +557,6 @@ void __asan_init() {
InitTlsSize();
// Create main thread.
- AsanTSDInit(AsanThread::TSDDtor);
AsanThread *main_thread = AsanThread::Create(0, 0);
CreateThreadContextArgs create_main_args = { main_thread, 0 };
u32 main_tid = asanThreadRegistry().CreateThread(
@@ -561,8 +566,6 @@ void __asan_init() {
main_thread->ThreadStart(internal_getpid());
force_interface_symbols(); // no-op.
- InitializeAllocator();
-
#if CAN_SANITIZE_LEAKS
__lsan::InitCommonLsan();
if (flags()->detect_leaks) {
OpenPOWER on IntegriCloud