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: "invalid pc-encoded table" throw caused by bad cgo traceback [1.16 backport] #45303

Closed
gopherbot opened this issue Mar 30, 2021 · 3 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@prattmic requested issue #44971 to be considered for backport to the next 1.16 minor release.

@gopherbot please open backport for 1.16 and 1.15. The only workaround is to change the C traceback engine, which isn't usually feasible.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Mar 30, 2021
@gopherbot gopherbot added this to the Go1.16.3 milestone Mar 30, 2021
@gopherbot
Copy link
Author

Change https://golang.org/cl/305889 mentions this issue: [release-branch.go1.16] runtime: non-strict InlTreeIndex lookup in Frames.Next

@dr2chase dr2chase added the CherryPickApproved Used during the release process for point releases label Mar 31, 2021
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Mar 31, 2021
@dr2chase
Copy link
Contributor

Sometimes, people using cgo get useless stack traces, and there is no workaround; approving for next dot release.

@gopherbot
Copy link
Author

Closed by merging 887c0d8 to release-branch.go1.16.

gopherbot pushed a commit that referenced this issue Mar 31, 2021
…ames.Next

When using cgo, some of the frames can be provided by cgoTraceback, a
cgo-provided function to generate C tracebacks. Unlike Go tracebacks,
cgoTraceback has no particular guarantees that it produces valid
tracebacks.

If one of the (invalid) frames happens to put the PC in the alignment
region at the end of a function (filled with int 3's on amd64), then
Frames.Next will find a valid funcInfo for the PC, but pcdatavalue will
panic because PCDATA doesn't cover this PC.

Tolerate this case by doing a non-strict PCDATA lookup. We'll still show
a bogus frame, but at least avoid throwing.

For #44971
Fixes #45303

Change-Id: I9eed728470d6f264179a7615bd19845c941db78c
Reviewed-on: https://go-review.googlesource.com/c/go/+/301369
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
(cherry picked from commit e4a4161)
Reviewed-on: https://go-review.googlesource.com/c/go/+/305889
@golang golang locked and limited conversation to collaborators Mar 31, 2022
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

2 participants