-
Notifications
You must be signed in to change notification settings - Fork 18k
hash/maphash: don't discard data on random seed init #37328
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
Conversation
Hash initializes seed on the first usage of seed or state with initSeed. initSeed uses SetSeed which discards accumulated data. This causes hash to return different sums for the same data in the first use and after reset. This CL fixes this issue by separating the seed set from data discard. Fixes golang#37315
This PR (HEAD: 1d8b10d) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/220259 to see it. Tip: You can toggle comments from me using the |
Message from Keith Randall: Patch Set 1: Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/220259. |
Message from Dmitri Shuralyov: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/220259. |
This PR (HEAD: 48b2f96) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/220259 to see it. Tip: You can toggle comments from me using the |
Message from Vladimir Evgrafov: Patch Set 2: (1 comment) Thanks! Please don’t reply on this GitHub thread. Visit golang.org/cl/220259. |
Message from Emmanuel Odeke: Patch Set 2: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/220259. |
Message from Gobot Gobot: Patch Set 2: TryBots beginning. Status page: https://farmer.golang.org/try?commit=fe1a2b77 Please don’t reply on this GitHub thread. Visit golang.org/cl/220259. |
Message from Gobot Gobot: Patch Set 2: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/220259. |
Message from Dmitri Shuralyov: Patch Set 2: Thank you for sending this fix Vladimir. It has a +2 review from the package owner (Keith). If it's ready from your side, I can submit it for you now. Please let us know. Please don’t reply on this GitHub thread. Visit golang.org/cl/220259. |
Message from Vladimir Evgrafov: Patch Set 2:
Please don’t reply on this GitHub thread. Visit golang.org/cl/220259. |
Message from Dmitri Shuralyov: Patch Set 2:
Great, submitting.
Yes. The bug it is fixing is in the Go 1.14 milestone. I'll cherry-pick this CL onto release-branch.go1.14 up next. Please don’t reply on this GitHub thread. Visit golang.org/cl/220259. |
Hash initializes seed on the first usage of seed or state with initSeed. initSeed uses SetSeed which discards accumulated data. This causes hash to return different sums for the same data in the first use and after reset. This CL fixes this issue by separating the seed set from data discard. Fixes #37315 Change-Id: Ic7020702c2ce822eb700af462e37efab12f72054 GitHub-Last-Rev: 48b2f96 GitHub-Pull-Request: #37328 Reviewed-on: https://go-review.googlesource.com/c/go/+/220259 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Closing because this PR has been merged via CL 220617 as commit 638df87.
|
…ed init Hash initializes seed on the first usage of seed or state with initSeed. initSeed uses SetSeed which discards accumulated data. This causes hash to return different sums for the same data in the first use and after reset. This CL fixes this issue by separating the seed set from data discard. Updates #37315 Change-Id: Ic7020702c2ce822eb700af462e37efab12f72054 GitHub-Last-Rev: 48b2f96 GitHub-Pull-Request: #37328 Reviewed-on: https://go-review.googlesource.com/c/go/+/220259 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> (cherry picked from commit 638df87) Reviewed-on: https://go-review.googlesource.com/c/go/+/220617 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Hash initializes seed on the first usage of seed or state with initSeed.
initSeed uses SetSeed which discards accumulated data.
This causes hash to return different sums for the same data in the first use
and after reset.
This CL fixes this issue by separating the seed set from data discard.
Fixes #37315