-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[release/7.0-staging] Fix Item4
is missing in some ValueTuple
s' IStructuralEquatable.Equals
#91471
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/7.0-staging] Fix Item4
is missing in some ValueTuple
s' 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
M2 approved.
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
ValueTuple
has 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.Equals
with 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
ValueTuple
implementation 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.