From 14f04db1b53e21922728767b440a44741c9e292c Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 12 Jul 2016 20:10:28 +0000 Subject: [sanitizers] Allocate 12MB for stack instead of 134MB The thread registry test was failing to allocate 25 threads with stack size 134MB, which is pretty reasonable. Also print the error code in our pthread wrappers in case this happens again. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@275209 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/sanitizer_common/tests/CMakeLists.txt | 2 +- lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/sanitizer_common/tests/CMakeLists.txt b/lib/sanitizer_common/tests/CMakeLists.txt index 1d65dc2cc..0a828dc13 100644 --- a/lib/sanitizer_common/tests/CMakeLists.txt +++ b/lib/sanitizer_common/tests/CMakeLists.txt @@ -82,7 +82,7 @@ endif() # enough for the unittests. Some unittests require more than 2M. # The default stack size for clang is 8M. if(MSVC) - list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON -Wl,/STACK:0x8000000) + list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON -Wl,/STACK:0xC00000) endif() set(SANITIZER_TEST_LINK_LIBS) diff --git a/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h b/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h index 47b0f97de..b7d784c25 100644 --- a/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h +++ b/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h @@ -48,7 +48,9 @@ inline void PTHREAD_CREATE(pthread_t *thread, void *attr, data->start_routine = start_routine; data->arg = arg; *thread = CreateThread(0, 0, PthreadHelperThreadProc, data, 0, 0); - ASSERT_NE(nullptr, *thread) << "Failed to create a thread."; + DWORD err = GetLastError(); + ASSERT_NE(nullptr, *thread) << "Failed to create a thread, got error 0x" + << std::hex << err; } inline void PTHREAD_JOIN(pthread_t thread, void **value_ptr) { -- cgit v1.2.1