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: "fatal error: runtime: type offset base pointer out of range" on juju tests #15343

Closed
mwhudson opened this issue Apr 18, 2016 · 3 comments
Milestone

Comments

@mwhudson
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

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

go version devel +6ec481b Mon Apr 18 02:30:46 2016 +0000 linux/amd64

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

Ubuntu 16.04

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.
    A link on play.golang.org is best.

$ git checkout https://github.com/davecheney/benchjuju.git
$ cd benchjuju
$ GOPATH=$(pwd) go test github.com/juju/juju/agent/tools

  1. What did you expect to see?

The test pass, or fail because mongo isn't installed or something like that.

  1. What did you see instead?
runtime: typeOff 0x1a410 base 0xc8200d1240 not in ranges:
    types 0x816000 etypes 0x99af50
fatal error: runtime: type offset base pointer out of range

goroutine 34 [running]:
runtime.throw(0x93a54d, 0x2e)
    /opt/opensource/go/src/runtime/panic.go:566 +0x8b fp=0xc82003b9b0 sp=0xc82003b998
runtime.(*_type).typeOff(0xc8200d1240, 0x1a410, 0x8f7280)
    /opt/opensource/go/src/runtime/type.go:199 +0x227 fp=0xc82003ba08 sp=0xc82003b9b0
reflect.resolveTypeOff(0xc8200d1240, 0x1a410, 0x4)
    /opt/opensource/go/src/runtime/runtime1.go:493 +0x29 fp=0xc82003ba28 sp=0xc82003ba08
reflect.(*name).pkgPath(0xc8200d1240, 0x82a163, 0x9)
    /opt/opensource/go/src/reflect/type.go:483 +0xda fp=0xc82003ba68 sp=0xc82003ba28
reflect.(*rtype).Method(0x8f3ee0, 0xf, 0x82a163, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /opt/opensource/go/src/reflect/type.go:759 +0x834 fp=0xc82003bbe0 sp=0xc82003ba68
gopkg.in/check%2ev1.newMethod(0x8f3ee0, 0xc82029f0e0, 0x16, 0xf, 0xc82012e700)
    /opt/opensource/benchjuju/src/gopkg.in/check.v1/check.go:56 +0xc4 fp=0xc82003bcb8 sp=0xc82003bbe0
gopkg.in/check%2ev1.newSuiteRunner(0x8f3ee0, 0xc82029f0e0, 0xc820012a00, 0xc8202bc2a0)
    /opt/opensource/benchjuju/src/gopkg.in/check.v1/check.go:581 +0x4a7 fp=0xc82003be18 sp=0xc82003bcb8
gopkg.in/check%2ev1.Run(0x8f3ee0, 0xc82029f0e0, 0xc820012a00, 0x0)
    /opt/opensource/benchjuju/src/gopkg.in/check.v1/run.go:91 +0x35 fp=0xc82003be40 sp=0xc82003be18
gopkg.in/check%2ev1.RunAll(0xc820012a00, 0x0)
    /opt/opensource/benchjuju/src/gopkg.in/check.v1/run.go:84 +0x8e fp=0xc82003beb0 sp=0xc82003be40
gopkg.in/check%2ev1.TestingT(0xc82028e240)
    /opt/opensource/benchjuju/src/gopkg.in/check.v1/run.go:72 +0x428 fp=0xc82003bf70 sp=0xc82003beb0
github.com/juju/juju/agent/tools_test.Test(0xc82028e240)
    /opt/opensource/benchjuju/src/github.com/juju/juju/agent/tools/package_test.go:13 +0x21 fp=0xc82003bf80 sp=0xc82003bf70
testing.tRunner(0xc82028e240, 0x970850)
    /opt/opensource/go/src/testing/testing.go:547 +0x7a fp=0xc82003bfa0 sp=0xc82003bf80
runtime.goexit()
    /opt/opensource/go/src/runtime/asm_amd64.s:2013 +0x1 fp=0xc82003bfa8 sp=0xc82003bfa0
created by testing.(*T).Run
    /opt/opensource/go/src/testing/testing.go:583 +0x2d9

goroutine 1 [chan receive]:
testing.(*T).Run(0xc82028e180, 0x90ca54, 0x4, 0x970850, 0x1bcd0f7d)
    /opt/opensource/go/src/testing/testing.go:584 +0x303
testing.RunTests.func1(0xc82028e180)
    /opt/opensource/go/src/testing/testing.go:730 +0x5d
testing.tRunner(0xc82028e180, 0xc8206ebdc8)
    /opt/opensource/go/src/testing/testing.go:547 +0x7a
testing.RunTests(0x970ce0, 0xb98a50, 0x1, 0x1, 0x912e70)
    /opt/opensource/go/src/testing/testing.go:736 +0x2c3
testing.(*M).Run(0xc8206ebe88, 0xc820012900)
    /opt/opensource/go/src/testing/testing.go:680 +0x78
main.main()
    github.com/juju/juju/agent/tools/_test/_testmain.go:56 +0xb4

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /opt/opensource/go/src/runtime/asm_amd64.s:2013 +0x1

goroutine 5 [syscall]:
os/signal.signal_recv(0x0)
    /opt/opensource/go/src/runtime/sigqueue.go:116 +0x15e
os/signal.loop()
    /opt/opensource/go/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
    /opt/opensource/go/src/os/signal/signal_unix.go:28 +0x37
FAIL    github.com/juju/juju/agent/tools    0.031s

0xc8200d1240 sure looks like a heap pointer to me. Paging @crawshaw

@mwhudson
Copy link
Contributor Author

Oh yes, I should say that this seems to happen for many but by no means all juju tests. No idea what the distinguishing characteristic is yet.

@crawshaw crawshaw self-assigned this Apr 18, 2016
@crawshaw
Copy link
Member

Fix is easy enough from that stack trace, thanks. The hard part is extracting a test case into reflect/all_test.go.

--- a/src/reflect/type.go
+++ b/src/reflect/type.go
@@ -480,7 +480,7 @@ func (n *name) pkgPath() string {
        }
        var nameOff int32
        copy((*[4]byte)(unsafe.Pointer(&nameOff))[:], (*[4]byte)(unsafe.Pointer(n.data(off)))[:])
-       pkgPathName := name{(*byte)(resolveTypeOff(unsafe.Pointer(n), nameOff))}
+       pkgPathName := name{(*byte)(resolveTypeOff(unsafe.Pointer(n.bytes), nameOff))}
        return pkgPathName.name()
 }

@crawshaw crawshaw added this to the Go1.7 milestone Apr 18, 2016
@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators Apr 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants