-
Notifications
You must be signed in to change notification settings - Fork 18.1k
crypto/rand: Read argument escapes to heap #66779
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
Comments
I' ve been investigating this once, and the remaining problem was that the
will always cause the buffer passed to |
But i guess we can make the |
Change https://go.dev/cl/578516 mentions this issue: |
Change https://go.dev/cl/602498 mentions this issue: |
Updates golang#66779 Change-Id: Iaa3eda4309bb1e8c28136dd048479e7269f4c189
Change https://go.dev/cl/616696 mentions this issue: |
Updates #66779 Updates #69577 Change-Id: I0dea5a30aab87aaa443e7e6646c1d07aa865ac1c GitHub-Last-Rev: 1cea46d GitHub-Pull-Request: #69719 Reviewed-on: https://go-review.googlesource.com/c/go/+/616696 LUCI-TryBot-Result: Go LUCI <[email protected]> Commit-Queue: Ian Lance Taylor <[email protected]> Reviewed-by: Filippo Valsorda <[email protected]> Reviewed-by: Michael Pratt <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]>
Change https://go.dev/cl/618275 mentions this issue: |
Without optimizations escape analysis can't do as much. Updates #66779 Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-noopt Change-Id: I9ccd1b995c62427ceebd9ce5c98170dbf4a93e8b Reviewed-on: https://go-review.googlesource.com/c/go/+/618275 Reviewed-by: Roland Shoemaker <[email protected]> Auto-Submit: Filippo Valsorda <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
Currently, Read is implemented as
io.ReadFull(Reader, b)
which escape analysis can't track, so b escapes to the heap.This is somewhat annoying, since it causes allocations in paths that could otherwise have none.
It should be possible to rewrite the package so that it doesn't escape on major platforms.
The text was updated successfully, but these errors were encountered: