From d9e7e06448dd96a8a903ffaf543d8532e9919812 Mon Sep 17 00:00:00 2001 From: Gregg Miskelly Date: Fri, 1 Aug 2025 08:38:03 -0700 Subject: [PATCH] Increase default stack guard on x86 Windows --- src/coreclr/vm/threads.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/coreclr/vm/threads.cpp b/src/coreclr/vm/threads.cpp index c53b00d9cdd5a2..92344beb931331 100644 --- a/src/coreclr/vm/threads.cpp +++ b/src/coreclr/vm/threads.cpp @@ -6129,13 +6129,12 @@ HRESULT Thread::CLRSetThreadStackGuarantee(SetThreadStackGuaranteeScope fScope) // -additionally, we need to provide some region to hosts to allow for lock acquisition in a hosted scenario // EXTRA_PAGES = 3; - INDEBUG(EXTRA_PAGES += 1); #else // HOST_64BIT -#ifdef _DEBUG - uGuardSize += (1 * GetOsPageSize()); // one extra page for debug infrastructure -#endif // _DEBUG + EXTRA_PAGES = 1; #endif // HOST_64BIT + INDEBUG(EXTRA_PAGES += 1); + int ThreadGuardPages = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_ThreadGuardPages, EXTRA_PAGES); uGuardSize += (ThreadGuardPages * GetOsPageSize());