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: panic on build with vendored depenencies #16566
Comments
Tested it also with go 1.6.3 on the same platform: Same error: panic: runtime error: slice bounds out of range goroutine 1 [running]: |
Since this isn't a regression in 1.7, I'm afraid it will have to wait for 1.8 at this point. |
Any hints how i could try to collect more information to help narrowing down the problem? |
make a copy of your GOPATH as newgopath, set GOPATH=/path/to/newgopath,
and try removing stuff in newgopath and see if go build still panics, until
you
come up with a small enough gopath that still triggers the problem.
And then you can remove Go source files (while keep the package and import
intact for each package) to make the reproduction case even simpler.
|
Possibly related: #14826 |
@minux Did that: It works if the gopath is entirely empty and i just use the vendored dependencies. I will try to build it up from there until i can trigger the problem (will take some time, my working GOPATH ofc isn't small). |
I encountered this today, maybe I can throw in some helpful information.
Additional info:
|
Possible dupe of #16167 which has a better repro? |
CL https://golang.org/cl/31665 mentions this issue. |
Please answer these questions before submitting your issue. Thanks!
1. What version of Go are you using (
go version
)?go version go1.7rc3 darwin/amd64
2. What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/seufert/Dev/GOCODE"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.7rc3/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.7rc3/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/m5/04gz8l2941vgv9_8ggx_s8_80000gn/T/go-build763588522=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
3. What did you do?
Build my program (a main package, only one file in the directory) from Vim using vim-go.
I wasn't able to reproduce the problem in a simpler sample that i can easily share.
4. What did you expect to see?
That it will build, because if i do it from the shell directly by "go build" it will build successfully.
5. What did you see instead?
panic: runtime error: slice bounds out of range
goroutine 1 [running]:
panic(0x3df380, 0xc420014110)
/usr/local/Cellar/go/1.7rc3/libexec/src/runtime/panic.go:500 +0x1a1
main.vendoredImportPath(0xc4201b2900, 0xc4201a71a1, 0x28, 0x3, 0x0)
/usr/local/Cellar/go/1.7rc3/libexec/src/cmd/go/pkg.go:463 +0x668
main.loadImport(0xc4201a71a1, 0x28, 0xc420179490, 0x66, 0xc4201b2900, 0xc4201ed9e0, 0xc4200b3ea0, 0x4, 0x4, 0x1, ...)
/usr/local/Cellar/go/1.7rc3/libexec/src/cmd/go/pkg.go:333 +0x9ea
main.(_Package).load(0xc4201b2900, 0xc4201ed9e0, 0xc4201b4700, 0x0, 0x0, 0x4)
/usr/local/Cellar/go/1.7rc3/libexec/src/cmd/go/pkg.go:940 +0x12aa
main.loadImport(0xc420188f91, 0x23, 0xc42001b500, 0x50, 0xc420194000, 0xc4201ed9e0, 0xc420189410, 0x1, 0x1, 0x1, ...)
/usr/local/Cellar/go/1.7rc3/libexec/src/cmd/go/pkg.go:374 +0x470
main.(_Package).load(0xc420194000, 0xc4201ed9e0, 0xc420173500, 0x0, 0x0, 0xc)
/usr/local/Cellar/go/1.7rc3/libexec/src/cmd/go/pkg.go:940 +0x12aa
main.loadImport(0x4466a5, 0x1, 0xc42001a004, 0x50, 0x0, 0xc4201ed9e0, 0x0, 0x0, 0x0, 0x0, ...)
/usr/local/Cellar/go/1.7rc3/libexec/src/cmd/go/pkg.go:374 +0x470
main.loadPackage(0x4466a5, 0x1, 0xc4201ed9e0, 0x0)
/usr/local/Cellar/go/1.7rc3/libexec/src/cmd/go/pkg.go:1658 +0x28f
main.packagesAndErrors(0xc420184cc0, 0x2, 0x2, 0xc42015fec0, 0x20, 0x3f16a0)
/usr/local/Cellar/go/1.7rc3/libexec/src/cmd/go/pkg.go:1703 +0x327
main.packagesForBuild(0xc42000c320, 0x2, 0x2, 0x4910b0, 0xc42000c180, 0x0)
/usr/local/Cellar/go/1.7rc3/libexec/src/cmd/go/pkg.go:1719 +0x75
main.runBuild(0x627520, 0xc42000c320, 0x2, 0x2)
/usr/local/Cellar/go/1.7rc3/libexec/src/cmd/go/build.go:440 +0xcc
main.main()
/usr/local/Cellar/go/1.7rc3/libexec/src/cmd/go/main.go:181 +0x624
If it's an error regarding vim-go or not, that it does not build: It cannot be correct, that the compiler just panics without any useful hint what went wrong.
The text was updated successfully, but these errors were encountered: