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

gopherbot opened this issue Oct 28, 2019 · 5 comments


Copy link

@gopherbot gopherbot commented Oct 28, 2019

@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.

Copy link

@gopherbot gopherbot commented Oct 28, 2019

Change mentions this issue: runtime: fix textOff for multiple text sections

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

@dmitshur dmitshur commented Nov 26, 2019

@laboger Could you please provide a rationale to backport this fix, as described at

Copy link

@laboger 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.

Copy link

@cagedmantis cagedmantis commented Dec 4, 2019

Approved. Serious issue with no workaround.

Copy link

@gopherbot gopherbot commented Dec 4, 2019

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

@gopherbot gopherbot closed this Dec 4, 2019
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
Run-TryBot: Lynn Boger <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Ian Lance Taylor <>
Reviewed-by: Cherry Zhang <>
(cherry picked from commit 0ae9389)
Run-TryBot: Carlos Amedee <>
Reviewed-by: Keith Randall <>
@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.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants