Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/8.0] Fix analysis of interface methods on generic types #93748

Merged
merged 3 commits into from
Oct 20, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 19, 2023

Backport of #93540 to release/8.0

/cc @agocke @MichalStrehovsky

Customer Impact

This is not a regression.

This is an internal error in the AOT compiler when hitting a particular combination of interfaces on generic types. It was originally found in the main branch of dotnet/runtime when trying to upgrade various versions, but it has subsequently been revealed as being easy to hit in customer workloads as well. It's possible, but very complicated, to workaround this issue. It's also a complex internal error so it's difficult to determine that this bug is the source of the problem.

Testing

Unit tests, fixing the dotnet/runtime integration tests in main.

Risk

Low. Only affects Native AOT. We're reusing the same algorithm for interface analysis that we're using in another part of the compiler.

Fixes an issue observed in #92881. The dependency analysis within the compiler was incorrectly considering `Equals(object x, object y)` to be the implementation of `IEqualityComparer<T>.Equals(T, T)`. When we generate the interface dispatch table, we'd use the correct algorithm (that looks at uninstantiated types) and fail the compilation. The fix is to use the same algorithm during dependency analysis.

Looks like this has been broken ever since interface support was added to CoreRT: dotnet/corert#626.
@ghost
Copy link

ghost commented Oct 19, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #93540 to release/8.0

/cc @agocke @MichalStrehovsky

Customer Impact

Testing

Risk

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

  • If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.

Author: github-actions[bot]
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@carlossanlop
Copy link
Member

When ready, please send an email to Tactics requesting approval. Friendly reminder that we need this merged before 4pm tomorrow Friday 20th to ensure it goes into GA.

Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

approved. we will take for consideration in 8.0.x

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Oct 19, 2023
@jeffschwMSFT jeffschwMSFT added this to the 8.0.0 milestone Oct 19, 2023
@agocke agocke added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 20, 2023
@carlossanlop carlossanlop merged commit 2e19d10 into release/8.0 Oct 20, 2023
107 of 119 checks passed
@carlossanlop carlossanlop deleted the backport/pr-93540-to-release/8.0 branch October 20, 2023 20:22
@ghost ghost locked as resolved and limited conversation to collaborators Nov 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-NativeAOT-coreclr Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants