[release/7.0-staging] Fix Item4 is missing in some ValueTuples' IStructuralEquatable.Equals#91471
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-runtime Issue DetailsBackport of #91461 to release/7.0-staging Customer ImpactTestingRiskIMPORTANT: If this backport is for a servicing release, please verify that:
|
|
@jeffhandley @stephentoub today is Code Complete for the October release. This backport does not have the |
jeffhandley
left a comment
There was a problem hiding this comment.
This has my support for servicing into 7.0. It's a latent functional bug that could lead to notable customer impact.
Adding @artl93 for review/approval.
|
From the email conversation, we will wait for this to cook a bit in 8.0, then we will service this to 7.0 and 6.0 in the next servicing release. |
|
So why are you closed this PR? |
Backport of #91461 to release/7.0-staging
/cc @jeffhandley @hamarb123 @skyoxZ
Customer Impact
When
ValueTuplehas 5 or more items, thebool IStructuralEquatable.Equals(object? other, IEqualityComparer comparer)implementation skips overItem4. This leads to instances returning as equal when they are not.This was reported by a customer in #91457 and fixed in .NET 8 with #91461. This latent behavioral bug could be silently affecting customer applications with potential data loss and data corruption issues. The bug only surfaces when explicitly using
IStructuralEquatable.Equalswith a comparer provided. That usage pattern would be most prevalent within framework and library usage where it could be hard for customers to diagnose or work around the issue if encountered.A GitHub code search revealed signal of such usage patterns being used. Here are a couple examples: 1, 2
Testing
The
ValueTupleimplementation was scanned for other errors like this and they were all fixed together. Unit tests were added to ensure each item of the tuple affects equality.Risk
Medium. This is a behavioral correction to a latent bug. It's plausible that data has been persisted based on the incorrect behavior; in such a case, the behavioral correction might surface for customers.