Skip to content
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

Closed
gopherbot opened this issue Oct 28, 2019 · 5 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@laboger requested issue #35207 to be considered for backport to the next 1.13 minor release.

@gopherbot Please backport to go 1.13 and go 1.12.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Oct 28, 2019
@gopherbot gopherbot added this to the Go1.13.4 milestone Oct 28, 2019
@gopherbot
Copy link
Author

Change https://golang.org/cl/203819 mentions this issue: runtime: fix textOff for multiple text sections

@andybons andybons modified the milestones: Go1.13.4, Go1.13.5 Oct 31, 2019
@dmitshur
Copy link
Contributor

@laboger Could you please provide a rationale to backport this fix, as described at https://golang.org/wiki/MinorReleases?

@laboger
Copy link
Contributor

laboger commented Dec 2, 2019

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.

@cagedmantis cagedmantis added the CherryPickApproved Used during the release process for point releases label Dec 4, 2019
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Dec 4, 2019
@cagedmantis
Copy link
Contributor

Approved. Serious issue with no workaround.

@gopherbot
Copy link
Author

Closed by merging 6eee990 to release-branch.go1.13.

gopherbot pushed a commit that referenced this issue Dec 4, 2019
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>
@golang golang locked and limited conversation to collaborators Dec 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

5 participants