From 94df6059f4d47caa99440b7f3d98be5a3b7d82d2 Mon Sep 17 00:00:00 2001 From: Mike McLaughlin Date: Tue, 3 Dec 2024 14:01:56 -0800 Subject: [PATCH] Fix recursion issue found in 109779 --- src/coreclr/pal/src/thread/process.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/coreclr/pal/src/thread/process.cpp b/src/coreclr/pal/src/thread/process.cpp index 2e22f22b5ae6e1..a2239e8b8281b3 100644 --- a/src/coreclr/pal/src/thread/process.cpp +++ b/src/coreclr/pal/src/thread/process.cpp @@ -2228,8 +2228,11 @@ PROCCreateCrashDump( size_t previousThreadId = InterlockedCompareExchange(&g_crashingThreadId, currentThreadId, 0); if (previousThreadId != 0) { - // Should never reenter or recurse - _ASSERTE(previousThreadId != currentThreadId); + // Return error if reenter this code + if (previousThreadId == currentThreadId) + { + return false; + } // The first thread generates the crash info and any other threads are blocked while (true)