From 0f6284e4709cb2be7a89a50ee41bf9c83831aec5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 12 Aug 2022 11:58:50 -0700 Subject: [PATCH] Fix hang caused by calling Environment.FailFast on multiple threads (#72567) Fixes #72565 Co-authored-by: Jan Kotas --- src/coreclr/vm/eepolicy.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/coreclr/vm/eepolicy.cpp b/src/coreclr/vm/eepolicy.cpp index b908456814407..d9e81754ca2a6 100644 --- a/src/coreclr/vm/eepolicy.cpp +++ b/src/coreclr/vm/eepolicy.cpp @@ -361,6 +361,7 @@ void LogInfoForFatalError(UINT exitCode, LPCWSTR pszMessage, LPCWSTR errorSource } else if (pPreviousThread != nullptr) { + GCX_PREEMP(); // Avoid blocking other threads that may be trying to suspend the runtime while (s_pCrashingThread != FatalErrorLoggingFinished) { ClrSleepEx(50, /*bAlertable*/ FALSE);