Fix x86 DAC stack walk regression from Environment.CallEntryPoint skip#127199
Merged
tommcdon merged 2 commits intodotnet:mainfrom Apr 22, 2026
Merged
Fix x86 DAC stack walk regression from Environment.CallEntryPoint skip#127199tommcdon merged 2 commits intodotnet:mainfrom
tommcdon merged 2 commits intodotnet:mainfrom
Conversation
Don't skip Environment.CallEntryPoint in UnwindStackWalkFrame with continue. On x86, GetFrameWorker unwinds one frame ahead to compute the frame pointer. Skipping this frame produces an incorrect frame pointer for the caller, breaking post-step stack walks (NoCurrentFrameException). The frame is still hidden from debugger UI via kRuntimeEntryPointFrame classification and S_FALSE return in GetFrameWorker. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an x86-specific DAC/DBI stack-walking regression where skipping Environment.CallEntryPoint during unwind caused the x86 “one-frame-ahead” unwind to compute an incorrect caller frame pointer (breaking ICorDebugStackWalk enumeration).
Changes:
- Stop skipping
Environment.CallEntryPointinDacDbiInterfaceImpl::UnwindStackWalkFrameso the x86 extra-unwind lands on the correct frame. - Document why the frame must remain in the internal enumeration and how it remains hidden (classified as
kRuntimeEntryPointFrameand filtered byGetFrameWorkerreturningS_FALSE).
jkotas
reviewed
Apr 21, 2026
This was referenced Apr 21, 2026
Open
noahfalk
approved these changes
Apr 21, 2026
Address jkotas feedback: the same x86 GetFrameWorker one-frame-ahead reasoning applies to exception handling frames. Move all runtime-internal frame hiding to GetStackWalkCurrentFrameInfo + GetFrameWorker(S_FALSE). Also add g_pStackFrameIteratorClass to GetStackWalkCurrentFrameInfo classification, which was previously only handled by the continue skip. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/ba-g failures are unrelated |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 using internal VS testing, any DBI stack walk on x86 where Environment.CallEntryPoint is on the stack would produce wrong frame pointers for the frames below it (like Main). This resulted in ICorDebugStackWalk enumeration on that thread would fail. It only affects x86 because that's the only architecture where GetFrameWorker unwinds one frame ahead to compute the frame pointer. On x64/arm64, the frame pointer is obtained directly without that extra unwind, so the continue skip is harmless there.
The fix is to avoid skipping Environment.CallEntryPoint in UnwindStackWalkFrame. The frame is still hidden from debugger UI via kRuntimeEntryPointFrame classification and S_FALSE return in GetFrameWorker.