From 3c4999e748a4d56389580c91ae3eb5d12e3bb4b9 Mon Sep 17 00:00:00 2001 From: Tom McDonald Date: Fri, 22 May 2026 10:37:39 -0400 Subject: [PATCH 1/2] Fix async stack walk crash for continuations with null DiagnosticIP CordbAsyncStackWalk::PopulateFrame() crashes when encountering a continuation whose ResumeInfo.DiagnosticIP is NULL (e.g. the new ValueTaskContinuation introduced in #127973). GetNativeCodeInfoForAddr is called with a null address which fails. Fix: In PopulateFrame(), skip continuations with diagnosticIP == NULL the same way DiagnosticHidden frames are skipped (advance to Next). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/coreclr/debug/di/rsstackwalk.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/coreclr/debug/di/rsstackwalk.cpp b/src/coreclr/debug/di/rsstackwalk.cpp index 9e25685c1cf442..4cd5aa69811979 100644 --- a/src/coreclr/debug/di/rsstackwalk.cpp +++ b/src/coreclr/debug/di/rsstackwalk.cpp @@ -915,6 +915,15 @@ HRESULT CordbAsyncStackWalk::PopulateFrame() &nextContinuation, &state)); + // Skip continuations with null DiagnosticIP. These are infrastructure + // continuations (e.g. ValueTaskContinuation) that have no user code + // associated with them and cannot be represented as a debug frame. + if (diagnosticIP == NULL) + { + m_continuationAddress = nextContinuation; + continue; + } + NativeCodeFunctionData codeData; VMPTR_Module pModule; mdMethodDef methodDef; From 4dfff5e8cd1ae0346f482167c84e0868175376d5 Mon Sep 17 00:00:00 2001 From: Tom McDonald Date: Fri, 22 May 2026 17:52:35 -0400 Subject: [PATCH 2/2] Fix PCODE comparison with NULL on ARM32 musl PCODE is unsigned int on ARM32, so comparing to NULL (std::nullptr_t) is invalid. Use 0 instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/coreclr/debug/di/rsstackwalk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/debug/di/rsstackwalk.cpp b/src/coreclr/debug/di/rsstackwalk.cpp index 4cd5aa69811979..13b9f45ea228aa 100644 --- a/src/coreclr/debug/di/rsstackwalk.cpp +++ b/src/coreclr/debug/di/rsstackwalk.cpp @@ -918,7 +918,7 @@ HRESULT CordbAsyncStackWalk::PopulateFrame() // Skip continuations with null DiagnosticIP. These are infrastructure // continuations (e.g. ValueTaskContinuation) that have no user code // associated with them and cannot be represented as a debug frame. - if (diagnosticIP == NULL) + if (diagnosticIP == 0) { m_continuationAddress = nextContinuation; continue;