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.15 backport] #45302

gopherbot opened this issue Mar 30, 2021 · 3 comments
CherryPickApproved FrozenDueToAge


Copy link

@gopherbot gopherbot commented Mar 30, 2021

@prattmic requested issue #44971 to be considered for backport to the next 1.15 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 label Mar 30, 2021
@gopherbot gopherbot added this to the Go1.15.11 milestone Mar 30, 2021
Copy link

@gopherbot gopherbot commented Mar 30, 2021

Change mentions this issue: [release-branch.go1.15] runtime: non-strict InlTreeIndex lookup in Frames.Next

@dr2chase dr2chase added the CherryPickApproved label Mar 31, 2021
Copy link

@dr2chase dr2chase commented Mar 31, 2021

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

Copy link

@gopherbot gopherbot commented Mar 31, 2021

Closed by merging a07f9d2 to release-branch.go1.15.

@gopherbot gopherbot removed the CherryPickCandidate label Mar 31, 2021
gopherbot pushed a commit that referenced this issue Mar 31, 2021

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

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 #45302

Change-Id: I9eed728470d6f264179a7615bd19845c941db78c
Trust: Michael Pratt <>
Run-TryBot: Michael Pratt <>
TryBot-Result: Go Bot <>
Reviewed-by: Cherry Zhang <>
(cherry picked from commit e4a4161)
@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.
CherryPickApproved FrozenDueToAge
None yet

No branches or pull requests

2 participants