-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Decide what to do about Base.memhash value #59151
Copy link
Copy link
Closed
Labels
correctness bug ⚠Bugs that are likely to lead to incorrect results in user code without throwingBugs that are likely to lead to incorrect results in user code without throwinghashingminor changeMarginal behavior change acceptable for a minor releaseMarginal behavior change acceptable for a minor releasestrings"Strings!""Strings!"
Description
Activity
Metadata
Metadata
Assignees
Labels
correctness bug ⚠Bugs that are likely to lead to incorrect results in user code without throwingBugs that are likely to lead to incorrect results in user code without throwinghashingminor changeMarginal behavior change acceptable for a minor releaseMarginal behavior change acceptable for a minor releasestrings"Strings!""Strings!"
In reviewing some code patterns, I noticed that most uses in the ecosystem of Base.memhash are unsound (are reimplementing the same function in Base in order to drop the mandatory GC roots), but a few previously used to be okay. Now all of them are unsound since the implementation changed in #57509 in a major breaking way for most of the users. We should consider whether we want to fix this constant (which used to be defined to be the definition of AbstractString hashing) or delete it entirely (so that all users are sound, by virtue of throwing an exception, and can switch to the new hashing API) or define Base.hash on AbstractString so that users can delete their unsound implementations and fallback to a correct one (given that Base already defines == on AbstractString, not defining hash was already incorrect)