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

mwhudson opened this issue Apr 18, 2016 · 3 comments


None yet
3 participants
Copy link

commented Apr 18, 2016

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 is best.

$ git checkout
$ cd benchjuju
$ GOPATH=$(pwd) go test

  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, 0xc82029f0e0, 0x16, 0xf, 0xc82012e700)
    /opt/opensource/benchjuju/src/ +0xc4 fp=0xc82003bcb8 sp=0xc82003bbe0, 0xc82029f0e0, 0xc820012a00, 0xc8202bc2a0)
    /opt/opensource/benchjuju/src/ +0x4a7 fp=0xc82003be18 sp=0xc82003bcb8, 0xc82029f0e0, 0xc820012a00, 0x0)
    /opt/opensource/benchjuju/src/ +0x35 fp=0xc82003be40 sp=0xc82003be18, 0x0)
    /opt/opensource/benchjuju/src/ +0x8e fp=0xc82003beb0 sp=0xc82003be40
    /opt/opensource/benchjuju/src/ +0x428 fp=0xc82003bf70 sp=0xc82003beb0
    /opt/opensource/benchjuju/src/ +0x21 fp=0xc82003bf80 sp=0xc82003bf70
testing.tRunner(0xc82028e240, 0x970850)
    /opt/opensource/go/src/testing/testing.go:547 +0x7a fp=0xc82003bfa0 sp=0xc82003bf80
    /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
    /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() +0xb4

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

goroutine 5 [syscall]:
    /opt/opensource/go/src/runtime/sigqueue.go:116 +0x15e
    /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    0.031s

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


This comment has been minimized.

Copy link
Contributor Author

commented Apr 18, 2016

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


This comment has been minimized.

Copy link

commented Apr 18, 2016

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([:])
-       pkgPathName := name{(*byte)(resolveTypeOff(unsafe.Pointer(n), nameOff))}
+       pkgPathName := name{(*byte)(resolveTypeOff(unsafe.Pointer(n.bytes), nameOff))}

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


This comment has been minimized.

Copy link

commented Apr 18, 2016

CL mentions this issue.

@gopherbot gopherbot closed this in 2e2df78 Apr 18, 2016

@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.
You can’t perform that action at this time.