Skip to content

[release/8.0-staging] Fix problem in ReadyToRun_TypeGenericInfoMap::HasConstraints (Recovery PR)#105835

Merged
ivdiazsa merged 1 commit intodotnet:release/8.0-stagingfrom
ivdiazsa:pr-96358-backport-recovery
Aug 6, 2024
Merged

[release/8.0-staging] Fix problem in ReadyToRun_TypeGenericInfoMap::HasConstraints (Recovery PR)#105835
ivdiazsa merged 1 commit intodotnet:release/8.0-stagingfrom
ivdiazsa:pr-96358-backport-recovery

Conversation

@ivdiazsa
Copy link
Contributor

@ivdiazsa ivdiazsa commented Aug 1, 2024

(Recovery of PR #105728 that was accidentally shut down)

Customer Impact

  • Customer reported
  • Found internally

Backport of PR #96358 to release/8.0. This bug came to light as reported by a customer in issue #96225. Since it reproduces on .NET 8 but was gone by .NET 9 preview 1, some further bisecting was done to figure out the fix.

The problem was that the code in the VM that is supposed to check for whether a generic type had (a) constraining clause(s), actually checked for whether said type was either covariant or contravariant. This completely different and therefore erroneous behavior broke some scenarios with generics and made them crash, like the one hindering our customer in this case.

Regression

  • Yes
  • No

This is a regression as the same scenario works properly in .NET 7 and .NET 6 versions. For context, it was accidentally introduced in this PR: #85743

Testing

This was validated using the customer's failing repro scenarios.

Risk

This PR poses little to no risk to the product. Since it's a small and simple one, we decided it would be a convenient and easy backport. The failure is well understood and has a well defined scope.

@ghost ghost added the area-VM-coreclr label Aug 1, 2024
@ivdiazsa ivdiazsa added the Servicing-approved Approved for servicing release label Aug 1, 2024
@ivdiazsa ivdiazsa added this to the 8.0.x milestone Aug 1, 2024
@ivdiazsa ivdiazsa linked an issue Aug 1, 2024 that may be closed by this pull request
@lambdageek
Copy link
Member

This was already approved by tactics in #105728

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.

lgtm. we have approval from tactics

@jeffschwMSFT jeffschwMSFT modified the milestones: 8.0.x, 8.0.9 Aug 1, 2024
@ivdiazsa ivdiazsa merged commit 18920d6 into dotnet:release/8.0-staging Aug 6, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 7, 2024
@rbhanda rbhanda modified the milestones: 8.0.9, 8.0.10 Oct 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-VM-coreclr Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET 8 ReadyToRun regression bug: TypeLoadException

4 participants