diff --git a/src/coreclr/pal/src/exception/signal.cpp b/src/coreclr/pal/src/exception/signal.cpp index 3dc0e541f6a8a..6ec3f69854510 100644 --- a/src/coreclr/pal/src/exception/signal.cpp +++ b/src/coreclr/pal/src/exception/signal.cpp @@ -206,7 +206,7 @@ BOOL SEHInitializeSignals(CorUnix::CPalThread *pthrCurrent, DWORD flags) } // Allocate the minimal stack necessary for handling stack overflow - int stackOverflowStackSize = ALIGN_UP(sizeof(SignalHandlerWorkerReturnPoint), 16) + 7 * 4096; + int stackOverflowStackSize = ALIGN_UP(sizeof(SignalHandlerWorkerReturnPoint), 16) + 8 * 4096; // Align the size to virtual page size and add one virtual page as a stack guard stackOverflowStackSize = ALIGN_UP(stackOverflowStackSize, GetVirtualPageSize()) + GetVirtualPageSize(); int flags = MAP_ANONYMOUS | MAP_PRIVATE; diff --git a/src/coreclr/vm/threads.cpp b/src/coreclr/vm/threads.cpp index bf85aa797c46c..e89b6c7d94c1d 100644 --- a/src/coreclr/vm/threads.cpp +++ b/src/coreclr/vm/threads.cpp @@ -2015,10 +2015,13 @@ HANDLE Thread::CreateUtilityThread(Thread::StackSizeBucket stackSizeBucket, LPTH DWORD threadId; HANDLE hThread = CreateThread(NULL, stackSize, start, args, flags, &threadId); - SetThreadName(hThread, pName); + if (hThread != INVALID_HANDLE_VALUE) + { + SetThreadName(hThread, pName); - if (pThreadId) - *pThreadId = threadId; + if (pThreadId) + *pThreadId = threadId; + } return hThread; }