[compiler-rt] r275209 - [sanitizers] Allocate 12MB for stack instead of 134MB

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 12 13:10:29 PDT 2016


Author: rnk
Date: Tue Jul 12 15:10:28 2016
New Revision: 275209

URL: http://llvm.org/viewvc/llvm-project?rev=275209&view=rev
Log:
[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.

Modified:
    compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
    compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt?rev=275209&r1=275208&r2=275209&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Tue Jul 12 15:10:28 2016
@@ -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)

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h?rev=275209&r1=275208&r2=275209&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h Tue Jul 12 15:10:28 2016
@@ -48,7 +48,9 @@ inline void PTHREAD_CREATE(pthread_t *th
   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) {




More information about the llvm-commits mailing list