-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/link: panic: runtime error: slice bounds out of range [::1751306] with length 1048576 [1.15 backport] #43214
Comments
Backport seems reasonable given that this problem exists in Go 1.15 and triggers a panic in the linker. Worth noting that this problem happens primarily with extremely large packages (more than 1048576 relocations), so primarily an issue for things like machine-generated code. |
Change https://golang.org/cl/278673 mentions this issue: |
Thanks for the request and rationale. @thanm Is Go 1.14 okay, or does it need a fix for this problem too? Our backport policy is to either fix the bug in all supported Go versions, or none (if it's not very critical). |
Sorry for the late response -- no need for a 1.14 backport here; the code in question was introduced in 1.15. Thanks. |
Approved as a serious issue with no workaround. |
Closed by merging 58dc445 to release-branch.go1.15. |
…e reader The code in the Go object file reader was casting a pointer to mmaped memory into a large array prior to performing a read of the relocations section: return (*[1<<20]Reloc)(unsafe.Pointer(&r.b[off]))[:n:n] For very large object files, this artificial array isn't large enough (that is, there are more than 1048576 relocs to read), so update the code to use a larger artifical array size. Fixes #43214. Updates #41621. Change-Id: Ic047c8aef4f8a3839f2e7e3594bce652ebd6bd5b Reviewed-on: https://go-review.googlesource.com/c/go/+/278492 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Jeremy Faller <jeremy@golang.org> Trust: Than McIntosh <thanm@google.com> (cherry picked from commit f4e7a6b) Reviewed-on: https://go-review.googlesource.com/c/go/+/278673
@thanm requested issue #41621 to be considered for backport to the next 1.15 minor release.
The text was updated successfully, but these errors were encountered: