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.

llvm-svn: 227421
This commit is contained in:
Jason Molenda 2015-01-29 06:28:36 +00:00
parent 6cf2df29e7
commit 3db7ebc87f
1 changed files with 10 additions and 0 deletions

View File

@ -38,6 +38,16 @@ ThreadLauncher::LaunchThread(llvm::StringRef name, lldb::thread_func_t thread_fu
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;