[Lldb-commits] [lldb] r227421 - If lldb is being built with ASAN instrumentation, have lldb
Jason Molenda
jmolenda at apple.com
Wed Jan 28 22:28:36 PST 2015
Author: jmolenda
Date: Thu Jan 29 00:28:36 2015
New Revision: 227421
URL: http://llvm.org/viewvc/llvm-project?rev=227421&view=rev
Log:
If lldb is being built with ASAN instrumentation, have lldb
create its own threads with 8MB additional maximum stack size.
Extra room is needed for the bookkeeping needed for this
instrumentation.
Modified:
lldb/trunk/source/Host/common/ThreadLauncher.cpp
Modified: lldb/trunk/source/Host/common/ThreadLauncher.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/ThreadLauncher.cpp?rev=227421&r1=227420&r2=227421&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/ThreadLauncher.cpp (original)
+++ lldb/trunk/source/Host/common/ThreadLauncher.cpp Thu Jan 29 00:28:36 2015
@@ -38,6 +38,16 @@ ThreadLauncher::LaunchThread(llvm::Strin
error.SetError(::GetLastError(), eErrorTypeWin32);
#else
+
+ // ASAN instrumentation adds a lot of bookkeeping overhead on stack frames.
+#if __has_feature(address_sanitizer)
+ const size_t eight_megabytes = 8 * 1024 * 1024;
+ if (min_stack_byte_size < eight_megabytes)
+ {
+ min_stack_byte_size += eight_megabytes;
+ }
+#endif
+
pthread_attr_t *thread_attr_ptr = NULL;
pthread_attr_t thread_attr;
bool destroy_attr = false;
More information about the lldb-commits
mailing list