Uh oh!
There was an error while loading. Please reload this page.
Fix interpreter delegate calls through shuffle thunks - #132141
Conversation
StubLinker-generated wrapper and shuffle stubs are now tracked by the JIT code manager. NonVirtualEntry2MethodDesc can therefore find their code ranges even though they do not map directly to managed method bodies. The assertion path was hit from the interpreter delegate dispatch, passing an address to a shuffle thunk. Recognize these stub block kinds and return null so callers use their existing non-method fallback path. Fixes assertions on the interpreter pipelines ASSERT FAILED Expression: !"NonVirtualEntry2MethodDesc failed" Location: /__w/1/s/src/coreclr/vm/method.cpp:2428 Function: NonVirtualEntry2MethodDesc Process: 90146
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
BrzVlad
commented
Aug 11, 2026
/azp run runtime-interpreter |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
BrzVlad
commented
Aug 11, 2026
/azp run runtime-libraries-interpreter |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Tagging subscribers to this area: @JulieLeeMSFT, @BrzVlad, @janvorli |
There was a problem hiding this comment.
Pull request overview
This PR adjusts NonVirtualEntry2MethodDesc to recognize additional non-method stub code block kinds (wrapper stubs and shuffle thunks) and return NULL so callers can take their existing non-method fallback path instead of hitting the debug assertion when given an entrypoint that doesn’t map to a managed method body.
Changes:
- Cache the
StubCodeBlockKindfor RangeList sections to avoid repeatedGetCodeBlockKind()calls. - After
JitCodeToMethodInfofails, query the stub code block kind and returnNULLforSTUB_CODE_BLOCK_WRAPPER_STUBandSTUB_CODE_BLOCK_SHUFFLE_THUNKto avoid the assertion path.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/coreclr/vm/method.cpp:2427
- Dropping the debug _ASSERTE entirely removes a useful invariant check for genuinely unexpected fallthroughs. Given the current logic, fixup/stub precodes return early, so reaching the end of the function with a RANGE_SECTION_RANGELIST should now only be expected for wrapper stubs and shuffle thunks (which don’t map to a MethodDesc). Consider restoring a debug-only assert that limits the new “allowed” cases to those stub kinds, so other accidental regressions still trip early in debug builds.
return NULL;
BrzVlad
commented
Aug 12, 2026
/ba-g failures unrelated |
StubLinker-generated wrapper and shuffle stubs are now tracked by the JIT code manager. NonVirtualEntry2MethodDesc can therefore find their code ranges even though they do not map directly to managed method bodies. The assertion path was hit from the interpreter delegate dispatch, passing an address to a shuffle thunk.
runtime/src/coreclr/vm/interpexec.cpp
Line 3503 in 643b896
Recognize these stub block kinds and return null so callers use their existing non-method fallback path. Fixes assertions on the interpreter pipelines
Regressed after #131903