Skip to content

[cDAC] Test entry-point MethodDesc resolution - #135470

Merged
rcj1 merged 1 commit into
dotnet:mainfrom
pcshrosbree:cdac-entrypoint-resolution-tests
Oct 9, 2026
Merged

rcj1 merged 1 commit into
dotnet:mainfrom
pcshrosbree:cdac-entrypoint-resolution-tests

Conversation

@pcshrosbree

Copy link
Copy Markdown
Contributor

Follow-up to #135450. Every populated vtable slot now resolves through NonVirtualEntry2MethodDesc, but its non-portable paths had no unit coverage. Neither did the temporary-entry-point check in ValidateMethodDescPointer. Before this change, breaking any of the following still passed every test:

  • the jitted-code branch, the precode branch, or the catch;
  • GetMethodDescForSlot;
  • either variant of the validation choice.

Tests added:

  • ExecutionManagerTests: NonVirtualEntry2MethodDesc for
    • jitted code;
    • a FIXUPPRECODE range list;
    • a range-list address that is not a precode (null);
    • an address in no range section (null, and never decoded).
  • MethodDescTests:
    • GetMethodDescForSlot resolving a populated vtable slot;
    • ValidateMethodDescPointer requiring the temporary entry point to resolve back to the MethodDesc, over portable × resolves-to-self.
  • MockDescriptors: AddMethodTableWithVtable.

With these tests, each of 12 single-guard mutations fails, and each fails in one test method:

  • each NonVirtualEntry2MethodDesc branch;
  • the slot path;
  • both validation variants;
  • the validation compare;
  • the ValidateForDataAccess guards.

UnitTests: 3324/3324 pass on linux-x64, osx-arm64 and windows-x64. On osx-arm64 and windows-x64 the mutation that makes NonVirtualEntry2MethodDesc return null for a precode address was also re-run, and its test fails on both.

Note

This PR was prepared with AI assistance (Anthropic Claude, reviewed with OpenAI Codex). The tests and the mutation runs were executed locally.

Follow-up to dotnet#135450. The non-portable paths of
NonVirtualEntry2MethodDesc, which every populated vtable slot now
goes through, and the temporary-entry-point check in
ValidateMethodDescPointer had no unit coverage.

- ExecutionManagerTests: NonVirtualEntry2MethodDesc for jitted code,
  for a FIXUPPRECODE range list, for a range-list address that is not
  a precode (null), and for an address in no range section (null,
  never decoded).
- MethodDescTests: GetMethodDescForSlot resolves a populated vtable
  slot through NonVirtualEntry2MethodDesc, and
  ValidateMethodDescPointer requires the temporary entry point to
  resolve back to the MethodDesc, through the precode when
  PrecodeStubs is advertised and through NonVirtualEntry2MethodDesc
  otherwise.
- MockDescriptors: AddMethodTableWithVtable (one vtable indirection
  and its slots).
@azure-pipelines

Copy link
Copy Markdown
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.

@rcj1

rcj1 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

/ba-g unrelated stress fails

@rcj1
rcj1 merged commit 90b22d9 into dotnet:main Oct 9, 2026
91 of 93 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Diagnostics-cdac community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants