Repository navigation
[cDAC] Fix ARM unwind implementation - #132183
Merged
Merged
Conversation
Co-authored-by: Copilot <[email protected]> Copilot-Session: 11b73ad8-c726-42c3-bc38-a8360c68b4de
|
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. |
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
rcj1
enabled auto-merge (squash)
August 11, 2026 23:32
Contributor
There was a problem hiding this comment.
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==0is treated as poppingPC(and therefore correctly restores the caller context). - Fix
ComputeScopeSizeiteration 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
hoyosjs
reviewed
Aug 11, 2026
hoyosjs
approved these changes
Aug 11, 2026
max-charlamb
approved these changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found this auditing the unwind code for discrepancies.