From 26f6c18ea52b2ff35524f18d096951f68b4c4c7a Mon Sep 17 00:00:00 2001 From: mdh1418 Date: Tue, 28 Jul 2026 12:51:59 -0400 Subject: [PATCH 1/2] Avoid resolving IL offsets for framed crash frames Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4e8cbca3-06b0-4e48-9159-71608830cb0d --- src/coreclr/vm/crashreportstackwalker.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/coreclr/vm/crashreportstackwalker.cpp b/src/coreclr/vm/crashreportstackwalker.cpp index 0332a782d8d2fd..f9030958959f8a 100644 --- a/src/coreclr/vm/crashreportstackwalker.cpp +++ b/src/coreclr/vm/crashreportstackwalker.cpp @@ -260,7 +260,8 @@ FrameCallbackAdapter( Module* pModule = pMD->GetModule(); - uint32_t nativeOffset = (pCF->HasFaulted() || !pCF->IsFrameless()) ? 0 : pCF->GetRelOffset(); + bool hasManagedNativeCode = !pCF->HasFaulted() && pCF->IsFrameless(); + uint32_t nativeOffset = hasManagedNativeCode ? pCF->GetRelOffset() : 0; uint32_t ilOffset = 0; PCODE ip = (PCODE)0; TADDR stackPointer = (TADDR)0; @@ -276,7 +277,7 @@ FrameCallbackAdapter( return SWA_CONTINUE; } - if (g_pDebugInterface != nullptr && pMD != nullptr) + if (g_pDebugInterface != nullptr && hasManagedNativeCode) { DWORD resolvedILOffset = 0; BOOL haveILOffset = FALSE; From 2b24f2c4f984275ca03556978fc4b2750548b310 Mon Sep 17 00:00:00 2001 From: mdh1418 Date: Tue, 28 Jul 2026 13:33:23 -0400 Subject: [PATCH 2/2] Address feedback --- src/coreclr/vm/crashreportstackwalker.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coreclr/vm/crashreportstackwalker.cpp b/src/coreclr/vm/crashreportstackwalker.cpp index f9030958959f8a..2975c115007fb0 100644 --- a/src/coreclr/vm/crashreportstackwalker.cpp +++ b/src/coreclr/vm/crashreportstackwalker.cpp @@ -260,8 +260,8 @@ FrameCallbackAdapter( Module* pModule = pMD->GetModule(); - bool hasManagedNativeCode = !pCF->HasFaulted() && pCF->IsFrameless(); - uint32_t nativeOffset = hasManagedNativeCode ? pCF->GetRelOffset() : 0; + bool canResolveOffsets = !pCF->HasFaulted() && pCF->IsFrameless(); + uint32_t nativeOffset = canResolveOffsets ? pCF->GetRelOffset() : 0; uint32_t ilOffset = 0; PCODE ip = (PCODE)0; TADDR stackPointer = (TADDR)0; @@ -277,7 +277,7 @@ FrameCallbackAdapter( return SWA_CONTINUE; } - if (g_pDebugInterface != nullptr && hasManagedNativeCode) + if (g_pDebugInterface != nullptr && canResolveOffsets) { DWORD resolvedILOffset = 0; BOOL haveILOffset = FALSE;