From 260b790412354a74e598b8e4eb773ff3c389d4ba 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 9504e6995c5506..01f67342cc1a54 100644 --- a/src/coreclr/pal/src/thread/process.cpp +++ b/src/coreclr/pal/src/thread/process.cpp @@ -2444,8 +2444,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)