From cd035416c17f65a05bc28dc289e020b66f002925 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Thu, 15 May 2025 10:36:17 -0300 Subject: [PATCH] Fix generation of minidump (#115562) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR addresses a minidump generation issue by wrapping IL version method calls with a try-catch block to ensure that an exception in GetIL doesn’t prevent dumping a full callstack. Wraps GetIL and related ILCodeVersion calls in an exception block Uses EX_CATCH_RETHROW_ONLY_COR_E_OPERATIONCANCELLED to selectively rethrow only specific exceptions --- src/coreclr/vm/method.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/coreclr/vm/method.cpp b/src/coreclr/vm/method.cpp index 29910d6cb4c1c3..94020af900d7f0 100644 --- a/src/coreclr/vm/method.cpp +++ b/src/coreclr/vm/method.cpp @@ -3789,10 +3789,14 @@ MethodDesc::EnumMemoryRegions(CLRDataEnumMemoryFlags flags) ILCodeVersion ilVersion = pCodeVersionManager->GetActiveILCodeVersion(dac_cast(this)); if (!ilVersion.IsNull()) { - ilVersion.GetActiveNativeCodeVersion(dac_cast(this)); - ilVersion.GetVersionId(); - ilVersion.GetRejitState(); - ilVersion.GetIL(); + EX_TRY + { + ilVersion.GetActiveNativeCodeVersion(dac_cast(this)); + ilVersion.GetVersionId(); + ilVersion.GetRejitState(); + ilVersion.GetIL(); + } + EX_CATCH_RETHROW_ONLY_COR_E_OPERATIONCANCELLED } #endif