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

Comments

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

@gopherbot

This comment has been minimized.

Copy link
Author

@gopherbot gopherbot commented Oct 28, 2019

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

This comment has been minimized.

Copy link
Member

@dmitshur dmitshur commented Nov 26, 2019

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

@laboger

This comment has been minimized.

Copy link
Contributor

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

@cagedmantis

This comment has been minimized.

Copy link
Contributor

@cagedmantis cagedmantis commented Dec 4, 2019

Approved. Serious issue with no workaround.

@gopherbot

This comment has been minimized.

Copy link
Author

@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
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.