[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.

llvm-svn: 275209
This commit is contained in:
Reid Kleckner
2016-07-12 20:10:28 +00:00
parent 0080269342
commit cd03f6f4f6
2 changed files with 4 additions and 2 deletions

View File

@@ -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)

View File

@@ -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) {