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: panic while running go mod tidy #27124

Closed
shoenig opened this issue Aug 21, 2018 · 2 comments
Closed

cmd/go: panic while running go mod tidy #27124

shoenig opened this issue Aug 21, 2018 · 2 comments

Comments

@shoenig
Copy link
Contributor

shoenig commented Aug 21, 2018

Please answer these questions before submitting your issue. Thanks!

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

$ go version
go version go1.11rc1 linux/amd64

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

$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/hoenig/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/hoenig/Documents/indeed-go"
GOPROXY=""
GORACE=""
GOROOT="/opt/google/go"
GOTMPDIR=""
GOTOOLDIR="/opt/google/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/hoenig/Documents/indeed-go/src/indeed/gophers/3rdparty/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build507642769=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Ran go mod tidy. It crashed with:

$ go mod tidy
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
cmd/go/internal/modload.(*mvsReqs).required(0xc0002ae1c0, 0xc000284c80, 0x17, 0x0, 0x0, 0xc0001314f8, 0x40f639, 0x8e8b40, 0xc0002aa278, 0xc000131598)
	/usr/local/go/src/cmd/go/internal/modload/load.go:835 +0x1232
cmd/go/internal/modload.(*mvsReqs).Required.func1(0xc000118444, 0x913fe0)
	/usr/local/go/src/cmd/go/internal/modload/load.go:765 +0x83
cmd/go/internal/par.(*Cache).Do(0xc0002ae1d8, 0x913fe0, 0xc000118420, 0xc000131708, 0xc0001318d0, 0xc000131810)
	/usr/local/go/src/cmd/go/internal/par/work.go:128 +0xd6
cmd/go/internal/modload.(*mvsReqs).Required(0xc0002ae1c0, 0xc000284c80, 0x17, 0x0, 0x0, 0xc0002ae1c0, 0x70, 0x68, 0x925c60, 0x0)
	/usr/local/go/src/cmd/go/internal/modload/load.go:764 +0x10f
cmd/go/internal/modcmd.modTidyGoSum.func1(0xc000284c80, 0x17, 0x0, 0x0)
	/usr/local/go/src/cmd/go/internal/modcmd/tidy.go:80 +0x10b
cmd/go/internal/modcmd.modTidyGoSum()
	/usr/local/go/src/cmd/go/internal/modcmd/tidy.go:87 +0x164
cmd/go/internal/modcmd.runTidy(0xd56020, 0xc0000a6080, 0x0, 0x0)
	/usr/local/go/src/cmd/go/internal/modcmd/tidy.go:66 +0x513
main.main()
	/usr/local/go/src/cmd/go/main.go:218 +0x7d4
@hajimehoshi
Copy link
Member

I encountered the same error, I couldn't make a minimized case though.

@agnivade
Copy link
Contributor

Duplicate of #27066. Fixed on tip.

@golang golang locked and limited conversation to collaborators Aug 21, 2019
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

4 participants