You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cDAC WASM: leaf frame pointer is not funclet-aware when a walk starts inside a funclet #135147
On WASM, the cDAC computes the frame pointer of the starting frame of a stack walk from the root frame base at the seed $sp. When the walk starts with $sp inside an R2R funclet (finally/catch/filter/fault), native GetWasmFramePointerFromStackPointer (src/coreclr/vm/wasm/helpers.cpp) reports the establishing method's frame pointer instead: it unwinds out of the funclet to the parent frame, or to the TERMINATE_R2R_STACK_WALK record that CallFuncletWith[out]Throwable pushes, which stores the establishing frame pointer beside the marker.
#135140 adds WasmUnwinder.TryGetLogicalFramePointer and uses it in WasmContext.Unwind and both R2R seeding paths (the InlinedCallFrame R2R marker and HandleTransitionFrame). The initial context of a walk seeded with a leaf $sp still uses the frame base. Non-funclet leaves are correct.
Consequences of a wrong leaf frame pointer: the ICF frame-match check (StackWalk_1.cs), InterpreterArgumentRelative generic-context reads, and GetContextFramePointer → GetAmbientSP for that frame.
Related:
A leaf funclet that makes no calls has no frame record (frame size 0), so neither native nor the cDAC can walk it. It is only observable at a debugger pause inside it.
Suggested fix: seed the initial context's frame pointer with TryGetLogicalFramePointer, and add a unit test that starts a walk with $sp inside a VM-invoked funclet.
Note
This issue was drafted with assistance from GitHub Copilot.
Activity
dotnet-policy-service commentedon Oct 3, 2026
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Oct 3, 2026
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.
[cDAC][wasm] Continue stack walks from a TransitionFrame into its R2R…