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/9.0] Fix HashSet copy constructor handling of instances that have fallen back to the randomized hashcode generator. (#107613) #107685

Merged

Conversation

eiriktsarpalis
Copy link
Member

Backport of #107613 to release/9.0

/cc @eiriktsarpalis

Customer Impact

  • Customer reported
  • Found internally

Fixes a customer reported issue where passing a HashSet<string> that has fallen back to randomized string comparison will result in a corrupted set being created.

Regression

  • Yes
  • No

Likely introduced in .NET 5 via #37180 which brought in non-randomized string comparison.

Testing

Added unit testing validating that the copy constructor works as expected.

Risk

Moderate. While this is a targeted fix, HashSet<T> is a very common core type so any change carries an elevated degree of risk.

Copy link
Contributor

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

@eiriktsarpalis eiriktsarpalis changed the title Fix HashSet copy constructor handling of instances that have fallen back to the randomized hashcode generator. (#107613) [release/9.0] Fix HashSet copy constructor handling of instances that have fallen back to the randomized hashcode generator. (#107613) Sep 11, 2024
@carlossanlop
Copy link
Member

@artl93 did you get a chance to look at this one? It's ask-mode so needs M2 approval.

@artl93 artl93 added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Sep 16, 2024
@carlossanlop carlossanlop merged commit 6932f10 into dotnet:release/9.0 Sep 16, 2024
149 of 153 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Collections Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants