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] MethodDesc validation rejects every MethodDesc: PrecodeStubs lookup needs PrecodeMachineDescriptor (absent with portable entry points) #135035
On WebAssembly targets, IRuntimeTypeSystem.GetMethodDescHandle(ptr) throws ArgumentException: Invalid method desc pointer for valid MethodDescs. In practice that means no MethodDesc can be named on WASM, including every MethodDesc that IStackWalk.GetMethodDescPtr / IExecutionManager.GetMethodDesc returns.
Root cause
MethodValidation.ValidateMethodDescPointer checks the temporary entry point:
PrecodeStubs_1.GetMethodDescFromStubAddress needs the PrecodeMachineDescriptor data type, which the descriptor compiles out under FEATURE_PORTABLE_ENTRYPOINTS:
The lookup throws InvalidOperationException: Field not found in any layout (names=[PrecodeMachineDescriptor]). The blanket catch (System.Exception) in ValidateMethodDescPointer swallows that and returns false, so every MethodDesc that has a temporary entry point is rejected.
I confirmed this by instrumenting each return false / catch in a local build. Every frame MethodDesc on a live browser target failed with exactly this exception at the temporary-entry-point check.
Expected
With portable entry points, the temporary entry point is a PortableEntryPoint whose MethodDesc field is the owner, matching the native FEATURE_PORTABLE_ENTRYPOINTS path. IExecutionManager already reads Data.PortableEntryPoint for GetDiagnosticCodeStartFromEntryPoint (#134827). Validation should take the same path when portable entry points are in use, instead of going through precode stubs.
A secondary concern: the blanket catch converts a reader/descriptor mismatch into "invalid pointer", which hid the root cause here.
At any CDP pause, walk a thread with IStackWalk, then call RuntimeTypeSystem.GetMethodDescHandle(GetMethodDescPtr(frame)) on any frameless frame. It throws Invalid method desc pointer.
Notes
As a workaround, Blazor-Playground/nesm overrides PrecodeStubsc1 on WASM targets. The override resolves GetMethodDescFromStubAddress via PortableEntryPoint.MethodDesc. With it, R2R and interpreted frames on a live target resolve to names that match an independent static ReadyToRun (MethodDefEntryPoints) name oracle.
Found while validating a live IStackWalk consumer in Blazor-Playground/nesm; related to #130988 / #134827.
Activity
dotnet-policy-service commentedon Oct 1, 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 1, 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] Fix stack walks and MethodDesc naming on WebAssembly (#1…