Skip to content

Fix async stack walk crash for continuations with null DiagnosticIP#128496

Merged
tommcdon merged 2 commits into
dotnet:mainfrom
tommcdon:dev/tommcdon/fix-async-stackwalk-null-diagnosticip
May 23, 2026
Merged

Fix async stack walk crash for continuations with null DiagnosticIP#128496
tommcdon merged 2 commits into
dotnet:mainfrom
tommcdon:dev/tommcdon/fix-async-stackwalk-null-diagnosticip

Conversation

@tommcdon
Copy link
Copy Markdown
Member

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).

CordbAsyncStackWalk::PopulateFrame() crashes when encountering a
continuation whose ResumeInfo.DiagnosticIP is NULL (e.g. the new
ValueTaskContinuation introduced in dotnet#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>
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Sorry for the break.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts CoreCLR debugger async stack walking so that CordbAsyncStackWalk::PopulateFrame() skips continuations that don’t have a diagnostic instruction pointer, preventing downstream native code lookups from being performed on a null/zero address.

Changes:

  • Add a guard in CordbAsyncStackWalk::PopulateFrame() to detect DiagnosticIP being null/zero and advance to the next continuation instead of attempting to materialize a debug frame.
  • Treat these continuations similarly to existing “DiagnosticHidden” continuations by skipping them during frame population.

Comment thread src/coreclr/debug/di/rsstackwalk.cpp Outdated
@tommcdon tommcdon added this to the 11.0.0 milestone May 22, 2026
@tommcdon tommcdon enabled auto-merge (squash) May 22, 2026 18:37
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants