Skip to content

Conversation

@eiriktsarpalis
Copy link
Member

@eiriktsarpalis eiriktsarpalis commented Sep 11, 2024

Backport of #107613 to release/8.0-staging

/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.

@eiriktsarpalis eiriktsarpalis added this to the 8.0.x milestone Sep 11, 2024
@eiriktsarpalis eiriktsarpalis self-assigned this Sep 11, 2024
@dotnet-policy-service
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/8.0-staging] Fix HashSet copy constructor handling of instances that have fallen back to the randomized hashcode generator. (#107613) Sep 11, 2024
@eiriktsarpalis eiriktsarpalis added the Servicing-consider Issue for next servicing release review label Sep 11, 2024
@leecow leecow modified the milestones: 8.0.x, 8.0.10 Sep 12, 2024
@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Sep 12, 2024
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
Copy link
Member

Choose a reason for hiding this comment

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

BOM?

@carlossanlop carlossanlop merged commit 43381f9 into dotnet:release/8.0-staging Sep 19, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 20, 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