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
runtime: function textOff returns incorrect value if multiple text sections are present [1.13 backport] #35211
Comments
Change https://golang.org/cl/203819 mentions this issue: |
@laboger Could you please provide a rationale to backport this fix, as described at https://golang.org/wiki/MinorReleases? |
The applications which require multiple text sections are Openshift and Kubernetes because of the unusually large text sections they generate. When the error occurs, it is difficult to debug and there is no workaround. Also, these applications require a backlevel Go version for their builds, for example Openshift is using Go 1.12 at this time, so I doubt telling them to move up to the latest version is acceptable. The fix is in this case is extremely simple and safe. |
Approved. Serious issue with no workaround. |
Closed by merging 6eee990 to release-branch.go1.13. |
If a compilation has multiple text sections, code in textOff must compare the offset argument against the range for each text section to determine which one it is in. The comparison looks like this: if uintptr(off) >= sectaddr && uintptr(off) <= sectaddr+sectlen If the off value being compared is equal to sectaddr+sectlen then it is not within the range of the text section but after it. The comparison should be just '<'. Fixes #35211 Change-Id: I114633fd734563d38f4e842dd884c6c239f73c95 Reviewed-on: https://go-review.googlesource.com/c/go/+/203817 Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> (cherry picked from commit 0ae9389) Reviewed-on: https://go-review.googlesource.com/c/go/+/203819 Run-TryBot: Carlos Amedee <carlos@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
@laboger requested issue #35207 to be considered for backport to the next 1.13 minor release.
The text was updated successfully, but these errors were encountered: