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

cmd/link: panic: runtime error: slice bounds out of range #12736

Closed
akavel opened this issue Sep 24, 2015 · 3 comments
Closed

cmd/link: panic: runtime error: slice bounds out of range #12736

akavel opened this issue Sep 24, 2015 · 3 comments

Comments

@akavel
Copy link
Contributor

akavel commented Sep 24, 2015

Fresh after installing go1.5.1 (after moving go1.4 away):

 $ go build -i ./...
# CENSORED/agent/soap_ws/soap_ws_server
/home/akavel/gopath/pkg/linux_amd64/github.com/dchest/uniuri.a(_go_.6): object is [linux amd64 go1.4 X:precisestack] expected [linux amd64 go1.5.1 ]
/home/akavel/gopath/pkg/linux_amd64/github.com/emicklei/go-restful.a(_go_.6): object is [linux amd64 go1.4 X:precisestack] expected [linux amd64 go1.5.1 ]
/home/akavel/gopath/pkg/linux_amd64/gopkg.in/inconshreveable/log15.v2.a(_go_.6): object is [linux amd64 go1.4 X:precisestack] expected [linux amd64 go1.5.1 ]
CENSORED/overmind/utils.init: call to external function github.com/emicklei/go-restful.init
CENSORED/utils/log.ConsoleHandler: call to external function gopkg.in/inconshreveable/log15%2ev2.TerminalFormat
CENSORED/utils/log.glob.func1: call to external function gopkg.in/inconshreveable/log15%2ev2.New
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
cmd/link/internal/ld.decodetype_ptrdata(0xc823bb4b40, 0x207)
    /usr/local/go/src/cmd/link/internal/ld/decodesym.go:75 +0x8b
cmd/link/internal/ld.(*GCProg).AddSym(0xc82769d6c0, 0xc826311680)
    /usr/local/go/src/cmd/link/internal/ld/data.go:1097 +0x1ec
cmd/link/internal/ld.dodata()
    /usr/local/go/src/cmd/link/internal/ld/data.go:1364 +0x14f0
cmd/link/internal/ld.Ldmain()
    /usr/local/go/src/cmd/link/internal/ld/pobj.go:242 +0x1ebb
cmd/link/internal/amd64.Main()
    /usr/local/go/src/cmd/link/internal/amd64/obj.go:44 +0x19
main.main()
    /usr/local/go/src/cmd/link/main.go:26 +0x189
 $ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/akavel/gopath/src/CENSORED/_vendor:/home/akavel/gopath"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT=""
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
 $ go version
go version go1.5.1 linux/amd64  
@bradfitz
Copy link
Contributor

Your error message is full of Go 1.4 stuff.

Delete that stuff.

@bradfitz
Copy link
Contributor

That is, your goroot pkg directory seems to be full of Go 1.4 build artifacts.

@akavel
Copy link
Contributor Author

akavel commented Sep 24, 2015

My GOROOT seems to be fine, I've unpacked a new go1.5.1 tarball to compare and diff -r shows nothing. On the other hand, my GOPATH had go1.4 .a files, that's true. After deleting them (rm -r /home/akavel/gopath/pkg), the problem disappeared. But I hoped go build -i ./... would give me the same effect as I'd expect from go install ./..., i.e. rebuild all go1.4 artifacts to go1.5, as I believe it's advertised w.r.t. go install (?), only difference being it would not install the executables ("package main"s). Is that not what should happen? I haven't tested go install before deleting the stuff, unfortunately; but I didn't want to pollute my bin dir with unwanted executables.

@golang golang locked and limited conversation to collaborators Sep 24, 2016
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