Skip to content

[cDAC] Fix ARM unwind implementation - #132183

Merged
rcj1 merged 1 commit into
dotnet:mainfrom
rcj1:arm-unwind-audit
Aug 12, 2026
Merged

rcj1 merged 1 commit into
dotnet:mainfrom
rcj1:arm-unwind-audit

Conversation

@rcj1

@rcj1 rcj1 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Found this auditing the unwind code for discrepancies.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 11b73ad8-c726-42c3-bc38-a8360c68b4de
@rcj1 rcj1 self-assigned this Aug 11, 2026
Copilot AI lite review requested due to automatic review settings August 11, 2026 23:28
@rcj1 rcj1 changed the title [cDAC] Fix ARM compact unwind parity [cDAC] Fix ARM unwind parity Aug 11, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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

@rcj1 rcj1 changed the title [cDAC] Fix ARM unwind parity [cDAC] Fix ARM unwind implementation Aug 11, 2026
@rcj1
rcj1 enabled auto-merge (squash) August 11, 2026 23:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes ARM (32-bit) unwind handling in cDAC’s ARMUnwinder so that compact unwind epilog processing restores the caller’s return address correctly, and adds a focused unit test to prevent regressions.

Changes:

  • Adjust ARM compact unwind epilog register-mask handling so Ret==0 is treated as popping PC (and therefore correctly restores the caller context).
  • Fix ComputeScopeSize iteration to avoid reading past the end of the unwind-code stream when searching for end markers.
  • Add a unit test that reproduces the compact-epilog scenario and asserts restored registers/PC/SP and unwind flags.
Show a summary per file
File Description
src/native/managed/cdac/tests/UnitTests/StackWalkTests.cs Adds a regression unit test covering ARM compact unwind epilog restoring caller context.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/ARM/ARMUnwinder.cs Fixes compact epilog LR/PC mask handling for Ret==0 and makes unwind-scope size computation safe at buffer boundaries.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

@rcj1
rcj1 merged commit a910997 into dotnet:main Aug 12, 2026
84 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Aug 13, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants