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: panic: runtime error: index out of range on ppc64x when accessing ftab #17854

Closed
laboger opened this issue Nov 8, 2016 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@laboger
Copy link
Contributor

laboger commented Nov 8, 2016

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version devel +76d8e60 Tue Nov 8 19:58:09 2016 +0000 linux/ppc64le

What operating system and processor architecture are you using (go env)?

Ubuntu 16.04 ppc64le

What did you do?

Build and test of Kubernetes binaries on ppc64le

What did you expect to see?

Successful build and test

What did you see instead?

Failure when trying to run hyperkube -h
~/kublatest/kubernetes/_output/local/bin/linux/ppc64le$ ./hyperkube -h
panic: runtime error: index out of range
fatal error: panic on system stack

runtime stack:
panic(0x127cfba0, 0x15dab720)
/home/boger/golang/fix/go/src/runtime/panic.go:420 +0x700

goroutine 1 [copystack, locked to thread]:
math/big.nat.mul(0x0, 0x0, 0x0, 0xc420014300, 0x1, 0x5, 0xc4200144b0, 0x1, 0x5, 0x129c6a20, ...)
/home/boger/golang/fix/go/src/math/big/nat.go:401 +0x18 fp=0xc420096418 sp=0xc420096418
math/big.(*Int).Mul(0xc42000c3c0, 0xc42000c280, 0xc42000c3a0, 0xc4200144e0)
/home/boger/golang/fix/go/src/math/big/int.go:156 +0x78 fp=0xc420096498 sp=0xc420096418
k8s.io/kubernetes/vendor/gopkg.in/inf%2ev0.glob..func1(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/boger/kublatest/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/gopkg.in/inf.v0/dec.go:109 +0x144 fp=0xc420096d28 sp=0xc420096498
k8s.io/kubernetes/vendor/gopkg.in/inf%2ev0.init()
/home/boger/kublatest/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/gopkg.in/inf.v0/dec.go:112 +0x238 fp=0xc420097d48 sp=0xc420096d28
k8s.io/kubernetes/pkg/api/resource.init()
/home/boger/kublatest/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/api/resource/suffix.go:199 +0x68 fp=0xc420097da0 sp=0xc420097d48
k8s.io/kubernetes/pkg/api.init()
/home/boger/kublatest/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/api/zz_generated.deepcopy.go:3780 +0x74 fp=0xc420097ee0 sp=0xc420097da0
k8s.io/kubernetes/pkg/api/install.init()
/home/boger/kublatest/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/api/install/install.go:154 +0x68 fp=0xc420097f18 sp=0xc420097ee0
panic: runtime error: index out of range
fatal error: panic on system stack
panic during panic

runtime stack:
panic(0x127cfba0, 0x15dab720)
/home/boger/golang/fix/go/src/runtime/panic.go:420 +0x700
panic(0x127cfba0, 0x15dab720)
/home/boger/golang/fix/go/src/runtime/panic.go:420 +0x700

The panicindex occurs in runtime/symtab.go in findfunc at this line:

if pc < datap.ftab[idx].entry {

The error occurs because the idx that is computed is beyond the end of the ftab. Working on a fix.

@gopherbot
Copy link

CL https://golang.org/cl/32972 mentions this issue.

@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 16, 2016
@quentinmit quentinmit added this to the Go1.8 milestone Nov 16, 2016
ceseo pushed a commit to powertechpreview/go that referenced this issue Dec 1, 2016
If a program has had its text section split into multiple
sections then the ftab that is built is based on addresses
prior to splitting.  That means all the function addresses
are there and correct because of relocation but the
but the computed idx won't always match up quite right and
in some cases go beyond the end of the table, causing a panic.

To resolve this, determine if the idx is too large and if it is,
set it to the last index in ftab.  Then search backward to find the
matching function address.

Fixes golang#17854

Change-Id: I6940e76a5238727b0a9ac23dc80000996db2579a
Reviewed-on: https://go-review.googlesource.com/32972
Reviewed-by: David Chase <drchase@google.com>
@golang golang locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants