Skip to content

Report failed interface devirtualization lookup - #133767

Merged
jtschuster merged 1 commit into
dotnet:mainfrom
jtschuster:fix-comimport-devirtualization
Sep 14, 2026
Merged

jtschuster merged 1 commit into
dotnet:mainfrom
jtschuster:fix-comimport-devirtualization

Conversation

@jtschuster

Copy link
Copy Markdown
Member

Fixes #133270

When managed devirtualization cannot resolve an interface method to either a class implementation or a default interface implementation, report CORINFO_DEVIRTUALIZATION_FAILED_LOOKUP instead of leaving the detail as CORINFO_DEVIRTUALIZATION_UNKNOWN. This matches the CoreCLR VM JIT interface behavior.

The assignment remains inside the no-class-target path so that an unexpected failure after finding an interface slot continues to report UNKNOWN and trigger the diagnostic assertion.

Validation:

  • ./build.sh clr+libs.pretest -rc checked -lc release
  • ComImportUnimplementedMethod under composite Crossgen2 with a large version bubble (CompositeBuildMode=1, LargeVersionBubble=1)

Note

This pull request description was drafted with GitHub Copilot.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 71dbc277-e17e-46b5-bad8-5b5cb7646411
Copilot AI lite review requested due to automatic review settings September 12, 2026 00:02
@azure-pipelines

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

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/crossgen-contrib
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review issues remain.

Pull request overview

Updates managed interface devirtualization diagnostics to report failed lookups consistently with CoreCLR behavior.

Changes:

  • Reports CORINFO_DEVIRTUALIZATION_FAILED_LOOKUP when no implementation is found.
  • Preserves CORINFO_DEVIRTUALIZATION_UNKNOWN for unexpected post-slot failures.
File summaries
File Description
src/coreclr/tools/Common/Compiler/DevirtualizationManager.cs Adds failed-lookup diagnostic reporting.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

@jtschuster

Copy link
Copy Markdown
Member Author

/ba-g failure is known: #133798

@jtschuster
jtschuster merged commit 4d63e6c into dotnet:main Sep 14, 2026
110 of 112 checks passed
@github-project-automation github-project-automation Bot moved this to Done in AppModel Sep 14, 2026
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 15, 2026
jtschuster added a commit to jtschuster/runtime that referenced this pull request Sep 18, 2026
Fixes dotnet#133270

When managed devirtualization cannot resolve an interface method to
either a class implementation or a default interface implementation,
report `CORINFO_DEVIRTUALIZATION_FAILED_LOOKUP` instead of leaving the
detail as `CORINFO_DEVIRTUALIZATION_UNKNOWN`. This matches the CoreCLR
VM JIT interface behavior.

The assignment remains inside the no-class-target path so that an
unexpected failure after finding an interface slot continues to report
`UNKNOWN` and trigger the diagnostic assertion.

> [!NOTE]
> This pull request description was drafted with GitHub Copilot.
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Assertion failed: info->detail != CORINFO_DEVIRTUALIZATION_DETAIL.CORINFO_DEVIRTUALIZATION_UNKNOWN

3 participants