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/go: go get panic: runtime error: slice bounds out of range #14826

Closed
evgnomon opened this issue Mar 15, 2016 · 11 comments
Closed

cmd/go: go get panic: runtime error: slice bounds out of range #14826

evgnomon opened this issue Mar 15, 2016 · 11 comments
Milestone

Comments

@evgnomon
Copy link

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version go1.6 linux/amd64
  2. What operating system and processor architecture are you using (go env)?
    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/hmd/.gvm/pkgsets/go1.6/global:/home/hmd"
    GORACE=""
    GOROOT="/home/hmd/.gvm/gos/go1.6"
    GOTOOLDIR="/home/hmd/.gvm/gos/go1.6/pkg/tool/linux_amd64"
    GO15VENDOREXPERIMENT="1"
    CC="gcc"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
    CXX="g++"
    CGO_ENABLED="1"
  3. What did you do?
    compile nomad 8f3bffe (https://github.com/hashicorp/nomad)

i was expected the code to be compiled, i got this:

panic: runtime error: slice bounds out of range

goroutine 1 [running]:
panic(0x93c000, 0xc82000e090)
        /home/hmd/.gvm/gos/go1.6/src/runtime/panic.go:464 +0x3e6
main.vendoredImportPath(0xc8203cf000, 0xc82034b901, 0x19, 0x0, 0x0)
        /home/hmd/.gvm/gos/go1.6/src/cmd/go/pkg.go:460 +0x67b
main.loadImport(0xc82034b901, 0x19, 0xc82019eeb0, 0x48, 0xc8203cf000, 0xc8205efb90, 0xc8201fa810, 0x1, 0x1, 0x1, ...)
        /home/hmd/.gvm/gos/go1.6/src/cmd/go/pkg.go:336 +0xe52
main.(*Package).load(0xc8203cf000, 0xc8205efb90, 0xc820394a80, 0x0, 0x0, 0x4)
        /home/hmd/.gvm/gos/go1.6/src/cmd/go/pkg.go:947 +0x4397
main.loadImport(0xc8201a8461, 0x18, 0xc8201a41e0, 0x28, 0xc82017dc00, 0xc8205efb90, 0xc8201448c0, 0x2, 0x2, 0x1, ...)
        /home/hmd/.gvm/gos/go1.6/src/cmd/go/pkg.go:377 +0x84e
main.(*Package).load(0xc82017dc00, 0xc8205efb90, 0xc82018d500, 0x0, 0x0, 0xc)
        /home/hmd/.gvm/gos/go1.6/src/cmd/go/pkg.go:947 +0x4397
main.loadImport(0x9df678, 0x1, 0xc820010064, 0x28, 0x0, 0xc8205efb90, 0x0, 0x0, 0x0, 0x0, ...)
        /home/hmd/.gvm/gos/go1.6/src/cmd/go/pkg.go:377 +0x84e
main.loadPackage(0x9df678, 0x1, 0xc8205efb90, 0x0)
        /home/hmd/.gvm/gos/go1.6/src/cmd/go/pkg.go:1633 +0x13d8
main.download.func1(0x9df678, 0x1, 0x0, 0xc81fff32e9)
        /home/hmd/.gvm/gos/go1.6/src/cmd/go/get.go:183 +0x43
main.download(0x9df678, 0x1, 0x0, 0xc8205efb90, 0x0)
        /home/hmd/.gvm/gos/go1.6/src/cmd/go/get.go:188 +0xdc
main.runGet(0xc891a0, 0xc820092070, 0x0, 0x0)
        /home/hmd/.gvm/gos/go1.6/src/cmd/go/get.go:107 +0x1de
main.main()
        /home/hmd/.gvm/gos/go1.6/src/cmd/go/main.go:181 +0x783
@bradfitz
Copy link
Contributor

This looks similar to #12156

@bradfitz bradfitz changed the title go get, panic: runtime error: slice bounds out of range cmd/go: go get panic: runtime error: slice bounds out of range Mar 15, 2016
@bradfitz
Copy link
Contributor

I'm unable to reproduce. I used Go 1.6 and configured my GOPATH the same way with two elements and tried repeatedly, sometimes deleting the $GOPATH pkg and src dirs.

Can you clarify how you can reproduce this? Your repro steps say "compile nomad 8f3bffe" but that doesn't appear to match your stack trace. It appears that you actually are reporting a problem with "go get". I didn't take any care to fetch 8f3bffe specifically. Did you work around this somehow upstream?

@ianlancetaylor ianlancetaylor added this to the Go1.7 milestone Mar 15, 2016
@AudriusButkevicius
Copy link
Contributor

Getting the same issue:

root@audrius:~# go get github.com/anacrolix/utp
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
panic(0x93d400, 0xc82000e0c0)
        /usr/local/go/src/runtime/panic.go:481 +0x3e6
main.vendoredImportPath(0xc820181400, 0xc820338a61, 0x18, 0x0, 0x0)
        /usr/local/go/src/cmd/go/pkg.go:466 +0x713
main.loadImport(0xc820338a61, 0x18, 0xc820400de0, 0x55, 0xc820181400, 0xc820126800, 0xc82026d080, 0x1, 0x1, 0x1, ...)
        /usr/local/go/src/cmd/go/pkg.go:336 +0xe52
main.(*Package).load(0xc820181400, 0xc820126800, 0xc8201a3180, 0x0, 0x0, 0x4)
        /usr/local/go/src/cmd/go/pkg.go:953 +0x4397
main.loadImport(0xc820127201, 0x1e, 0xc820016d80, 0x5e, 0xc820136800, 0xc820126800, 0xc820110e60, 0x3, 0x4, 0x1, ...)
        /usr/local/go/src/cmd/go/pkg.go:377 +0x84e
main.(*Package).load(0xc820136800, 0xc820126800, 0xc82012b180, 0x0, 0x0, 0xc)
        /usr/local/go/src/cmd/go/pkg.go:953 +0x4397
main.loadImport(0x7ffd68c887ca, 0x18, 0xc82000e044, 0x5, 0x0, 0xc820126800, 0x0, 0x0, 0x0, 0x0, ...)
        /usr/local/go/src/cmd/go/pkg.go:377 +0x84e
main.loadPackage(0x7ffd68c887ca, 0x18, 0xc820126800, 0x0)
        /usr/local/go/src/cmd/go/pkg.go:1639 +0x13d8
main.download.func1(0x7ffd68c887ca, 0x18, 0x0, 0xc91e00)
        /usr/local/go/src/cmd/go/get.go:191 +0x43
main.download(0x7ffd68c887ca, 0x18, 0x0, 0xc820126800, 0x0)
        /usr/local/go/src/cmd/go/get.go:196 +0xfe
main.runGet(0xc8a1a0, 0xc82000a230, 0x1, 0x1)
        /usr/local/go/src/cmd/go/get.go:107 +0x1e5
main.main()
        /usr/local/go/src/cmd/go/main.go:181 +0x783
root@audrius:~# go version
go version go1.6.2 linux/amd64
root@audrius:~# ls vendor/
ls: cannot access vendor/: No such file or directory
root@audrius:~# echo $GOPATH
/root/gohome/src/github.com/syncthing/syncthing/Godeps/_workspace/:/root/gohome/
root@audrius:~# ls -lah /root/gohome/src/github.com/syncthing/syncthing/Godeps/_workspace/src/github.com/anacrolix/utp/
total 104K

Starts working when remove the Godeps from path.

@josharian
Copy link
Contributor

I just tried to reproduce this and couldn't. @AudriusButkevicius or @ghasemz, can you still reproduce? If so, are you willing to help debug a bit?

@AudriusButkevicius
Copy link
Contributor

I can't repro it anymore sadly.

@bradfitz
Copy link
Contributor

Not sad for me. Marking fixed. (there were several bug reports looking like this; it was probably a dup)

@SpComb
Copy link

SpComb commented Jun 23, 2016

I ran into a panic with an identical stack trace when attempting to re-get a repo that had a vendor git submodule that failed to clone the first time due to missing SSH keys. I can reliably reproduce it by cleaning out the vendored git submodule and using go get -u to re-clone it:

$ go version
go version go1.6.1 linux/amd64
$ rm -rf src/github.com/qmsk/e2/
$ GOPATH=~/go go get -v -u github.com/qmsk/e2/cmd/tally
github.com/qmsk/e2 (download)
github.com/jessevdk/go-flags (download)
github.com/golang/glog (download)
github.com/qmsk/e2/discovery
github.com/qmsk/e2/vendor/github.com/kidoman/embd
github.com/qmsk/e2/client
github.com/qmsk/e2/vendor/github.com/kidoman/embd/host/generic
github.com/qmsk/e2/vendor/github.com/kidoman/embd/host/rpi
github.com/qmsk/e2/tally
github.com/qmsk/e2/cmd/tally
$ rm -rf src/github.com/qmsk/e2/vendor/github.com/kidoman/embd/
$ GOPATH=~/go go get -v -u github.com/qmsk/e2/cmd/tally
github.com/qmsk/e2 (download)
github.com/jessevdk/go-flags (download)
github.com/kidoman/embd (download)
github.com/golang/glog (download)
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
panic(0x93d000, 0xc820010090)
        /usr/lib/go-1.6/src/runtime/panic.go:464 +0x3e6
main.vendoredImportPath(0xc8203ee800, 0xc820459c21, 0x24, 0x0, 0x0)
        /usr/lib/go-1.6/src/cmd/go/pkg.go:460 +0x67b
main.loadImport(0xc820459c21, 0x24, 0xc820205e00, 0x50, 0xc8203ee800, 0xc8205557e8, 0xc820459d10, 0x1, 0x1, 0x1, ...)
        /usr/lib/go-1.6/src/cmd/go/pkg.go:336 +0xe52
main.(*Package).load(0xc8203ee800, 0xc8205557e8, 0xc820296700, 0x0, 0x0, 0x4)
        /usr/lib/go-1.6/src/cmd/go/pkg.go:947 +0x4397
main.loadImport(0xc82029f0b1, 0x20, 0xc82029eae0, 0x2e, 0xc820336400, 0xc8205557e8, 0xc82029f3b0, 0x1, 0x1, 0x1, ...)
        /usr/lib/go-1.6/src/cmd/go/pkg.go:377 +0x84e
main.(*Package).load(0xc820336400, 0xc8205557e8, 0xc8201eee00, 0x0, 0x0, 0x4)
        /usr/lib/go-1.6/src/cmd/go/pkg.go:947 +0x4397
main.loadImport(0xc8200ca241, 0x18, 0xc820171740, 0x32, 0xc8203efc00, 0xc8205557e8, 0xc8203ea900, 0x1, 0x1, 0x1, ...)
        /usr/lib/go-1.6/src/cmd/go/pkg.go:377 +0x84e
main.(*Package).load(0xc8203efc00, 0xc8205557e8, 0xc82028b880, 0x0, 0x0, 0xc)
        /usr/lib/go-1.6/src/cmd/go/pkg.go:947 +0x4397
main.loadImport(0x7ffda4674811, 0x1c, 0xc82000e0c4, 0x11, 0x0, 0xc8205557e8, 0x0, 0x0, 0x0, 0x0, ...)
        /usr/lib/go-1.6/src/cmd/go/pkg.go:377 +0x84e
main.loadPackage(0x7ffda4674811, 0x1c, 0xc8205557e8, 0x0)
        /usr/lib/go-1.6/src/cmd/go/pkg.go:1633 +0x13d8
main.packagesAndErrors(0xc8201ac430, 0x1, 0x1, 0x0, 0x0, 0x0)
        /usr/lib/go-1.6/src/cmd/go/pkg.go:1678 +0x531
main.packagesForBuild(0xc8201ac400, 0x1, 0x1, 0x0, 0x0, 0x0)
        /usr/lib/go-1.6/src/cmd/go/pkg.go:1694 +0x82
main.runGet(0xc891a0, 0xc8201ac400, 0x1, 0x1)
        /usr/lib/go-1.6/src/cmd/go/get.go:123 +0x322
main.main()
/usr/lib/go-1.6/src/cmd/go/main.go:181 +0x783

https://gist.github.com/SpComb/76430d66ac6488c6943a7f71fddcb2ee#file-00-repro-steps-txt

@bradfitz
Copy link
Contributor

@SpComb, this bug is closed, so don't be surprised if nobody looks at this more. You're better off filing a new bug. Also, the Go 1.6.x tree is frozen. Please clarify in the new bug whether this still happens for you with Go 1.7beta2.

@SpComb
Copy link

SpComb commented Jun 23, 2016

Repro'd against current git master: #16150

Attempt to repro against 1.7 beta failed, due to git submodule clones being broken: #16165

@frank0718
Copy link

copy a project's govendor vendor dir will produce this bug

@davecheney
Copy link
Contributor

@frank0718 this bug is marked closed. Please open a new issue.

@golang golang locked and limited conversation to collaborators Jan 4, 2018
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

9 participants