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 when loading a module from svn #28943

Closed
mewmew opened this Issue Nov 25, 2018 · 13 comments

Comments

Projects
None yet
4 participants
@mewmew
Contributor

mewmew commented Nov 25, 2018

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

$ go version

go version devel +048c9164a0 Sat Nov 24 23:55:07 2018 +0000 linux/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/u/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/u/goget:/home/u/Desktop/go"
GOPROXY=""
GORACE=""
GOROOT="/home/u/go1.12"
GOTMPDIR=""
GOTOOLDIR="/home/u/go1.12/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build042885457=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Clone https://github.com/elz-lang/elz at rev elz-lang/elz@f1b9a0f to outside of GOPATH, and the running go install -v ./... to build the packages of the module.

git clone https://github.com/elz-lang/elz
cd elz
go install -v ./...

What did you expect to see?

Successful compilation.

What did you see instead?

Compile time panic.

$ go install -v ./...
Fetching https://llvm.org/llvm/bindings/go/llvm?go-get=1
Parsing meta tags from https://llvm.org/llvm/bindings/go/llvm?go-get=1 (status code 200)
get "llvm.org/llvm/bindings/go/llvm": found meta tag get.metaImport{Prefix:"llvm.org/llvm", VCS:"svn", RepoRoot:"https://llvm.org/svn/llvm-project/llvm/trunk"} at https://llvm.org/llvm/bindings/go/llvm?go-get=1
get "llvm.org/llvm/bindings/go/llvm": verifying non-authoritative meta tag
Fetching https://llvm.org/llvm?go-get=1
Parsing meta tags from https://llvm.org/llvm?go-get=1 (status code 200)
go: finding llvm.org/llvm/bindings/go/llvm latest
Fetching https://llvm.org/llvm/bindings/go?go-get=1
Parsing meta tags from https://llvm.org/llvm/bindings/go?go-get=1 (status code 200)
Fetching https://llvm.org/llvm/bindings?go-get=1
Parsing meta tags from https://llvm.org/llvm/bindings?go-get=1 (status code 200)
Fetching https://llvm.org/llvm?go-get=1
Parsing meta tags from https://llvm.org/llvm?go-get=1 (status code 200)
get "llvm.org/llvm": found meta tag get.metaImport{Prefix:"llvm.org/llvm", VCS:"svn", RepoRoot:"https://llvm.org/svn/llvm-project/llvm/trunk"} at https://llvm.org/llvm?go-get=1
go: finding llvm.org/llvm latest
go: downloading llvm.org/llvm v0.0.0-20181125165443-000000347525
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5f627b]

goroutine 8 [running]:
cmd/go/internal/modfetch/codehost.(*vcsRepo).ReadZip(0xc00010e280, 0xc00002c856, 0xc, 0x0, 0x0, 0x1f400000, 0x0, 0x0, 0x0, 0x0, ...)
	/home/u/go1.12/src/cmd/go/internal/modfetch/codehost/vcs.go:372 +0x4fb
cmd/go/internal/modfetch.(*codeRepo).Zip(0xc0000e6380, 0xc00002c840, 0x22, 0x9b8ac2, 0x4, 0x0, 0x0, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/coderepo.go:415 +0xfe
cmd/go/internal/modfetch.(*cachingRepo).Zip(0xc0004ee000, 0xc00002c840, 0x22, 0x9b8ac2, 0x4, 0x0, 0x41, 0x140, 0x41)
	/home/u/go1.12/src/cmd/go/internal/modfetch/cache.go:219 +0x60
cmd/go/internal/modfetch.downloadZip(0xc00027f4a1, 0xd, 0xc00002c840, 0x22, 0xc0002d2480, 0x5c, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:111 +0xfa
cmd/go/internal/modfetch.DownloadZip.func1(0xc000324da4, 0x952a00)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:97 +0x3b2
cmd/go/internal/par.(*Cache).Do(0xdf86c0, 0x952a00, 0xc000324d80, 0xc00011d898, 0xc000287770, 0x40f1e3)
	/home/u/go1.12/src/cmd/go/internal/par/work.go:128 +0xd3
cmd/go/internal/modfetch.DownloadZip(0xc00027f4a1, 0xd, 0xc00002c840, 0x22, 0x0, 0xa85e20, 0xc000287770, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:78 +0xd6
cmd/go/internal/modfetch.Download.func1(0xc000324d64, 0x952a00)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:50 +0x192
cmd/go/internal/par.(*Cache).Do(0xdf8680, 0x952a00, 0xc000324d40, 0xc00011da80, 0xc000056bf0, 0xc000056bf0)
	/home/u/go1.12/src/cmd/go/internal/par/work.go:128 +0xd3
cmd/go/internal/modfetch.Download(0xc00027f4a1, 0xd, 0xc00002c840, 0x22, 0x0, 0x0, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:44 +0x1a3
cmd/go/internal/modload.fetch(0xc00027f4a1, 0xd, 0xc00002c840, 0x22, 0x9f9100, 0xc0002c4280, 0x0, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:1068 +0xcf
cmd/go/internal/modload.QueryPackage(0xc00027f4a1, 0x1e, 0x9b9a82, 0x6, 0x9f9100, 0x4217c5, 0xc000056d18, 0x40f1e3, 0x924ea0, 0xc0004a6460, ...)
	/home/u/go1.12/src/cmd/go/internal/modload/query.go:238 +0x2d5
cmd/go/internal/modload.Import(0xc00027f4a1, 0x1e, 0x3, 0x0, 0xffffffffffffffff, 0xc0001fdd60, 0x2, 0x4, 0xc000056f38, 0x5cf59c)
	/home/u/go1.12/src/cmd/go/internal/modload/import.go:136 +0x6df
cmd/go/internal/modload.(*loader).doPkg(0xc0002ae000, 0x934840, 0xc000207cc0)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:617 +0x2f1
cmd/go/internal/modload.(*loader).doPkg-fm(0x934840, 0xc000207cc0)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:506 +0x3e
cmd/go/internal/par.(*Work).runner(0xc0000b0780)
	/home/u/go1.12/src/cmd/go/internal/par/work.go:101 +0x135
created by cmd/go/internal/par.(*Work).Do
	/home/u/go1.12/src/cmd/go/internal/par/work.go:67 +0x9b
@mewmew

This comment has been minimized.

Contributor

mewmew commented Nov 25, 2018

Running go mod tidy also produces a panic.

u@x1 ~/D/l/elz> go mod tidy
go: finding llvm.org/llvm/bindings/go/llvm latest
go: finding llvm.org/llvm latest
go: downloading llvm.org/llvm v0.0.0-20181125165443-000000347525
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5f627b]

goroutine 19 [running]:
cmd/go/internal/modfetch/codehost.(*vcsRepo).ReadZip(0xc0000c0480, 0xc00002cc46, 0xc, 0x0, 0x0, 0x1f400000, 0x0, 0x0, 0x0, 0x0, ...)
	/home/u/go1.12/src/cmd/go/internal/modfetch/codehost/vcs.go:372 +0x4fb
cmd/go/internal/modfetch.(*codeRepo).Zip(0xc0000c0d00, 0xc00002cc30, 0x22, 0x9b8ac2, 0x4, 0x0, 0x0, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/coderepo.go:415 +0xfe
cmd/go/internal/modfetch.(*cachingRepo).Zip(0xc0002ea410, 0xc00002cc30, 0x22, 0x9b8ac2, 0x4, 0x0, 0x41, 0x60, 0x41)
	/home/u/go1.12/src/cmd/go/internal/modfetch/cache.go:219 +0x60
cmd/go/internal/modfetch.downloadZip(0xc0003322c1, 0xd, 0xc00002cc30, 0x22, 0xc0000291a0, 0x5c, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:111 +0xfa
cmd/go/internal/modfetch.DownloadZip.func1(0xc000222684, 0x952a00)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:97 +0x3b2
cmd/go/internal/par.(*Cache).Do(0xdf86c0, 0x952a00, 0xc000222660, 0xc000109898, 0xc00012f530, 0x40f1e3)
	/home/u/go1.12/src/cmd/go/internal/par/work.go:128 +0xd3
cmd/go/internal/modfetch.DownloadZip(0xc0003322c1, 0xd, 0xc00002cc30, 0x22, 0x0, 0xa85e20, 0xc00012f530, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:78 +0xd6
cmd/go/internal/modfetch.Download.func1(0xc000222644, 0x952a00)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:50 +0x192
cmd/go/internal/par.(*Cache).Do(0xdf8680, 0x952a00, 0xc000222620, 0xc000109a80, 0xc0002bcbf0, 0xc0002bcbf0)
	/home/u/go1.12/src/cmd/go/internal/par/work.go:128 +0xd3
cmd/go/internal/modfetch.Download(0xc0003322c1, 0xd, 0xc00002cc30, 0x22, 0x0, 0x0, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:44 +0x1a3
cmd/go/internal/modload.fetch(0xc0003322c1, 0xd, 0xc00002cc30, 0x22, 0x9f9100, 0xc00019f770, 0x0, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:1068 +0xcf
cmd/go/internal/modload.QueryPackage(0xc0003322c1, 0x1e, 0x9b9a82, 0x6, 0x9f9100, 0x4148e5, 0xc0002bcd18, 0x40403a, 0xc0002e2211, 0xc0000f6201, ...)
	/home/u/go1.12/src/cmd/go/internal/modload/query.go:238 +0x2d5
cmd/go/internal/modload.Import(0xc0003322c1, 0x1e, 0x3, 0x0, 0xffffffffffffffff, 0xc0002b68a0, 0x2, 0x4, 0xc0002bcf38, 0x5cf59c)
	/home/u/go1.12/src/cmd/go/internal/modload/import.go:136 +0x6df
cmd/go/internal/modload.(*loader).doPkg(0xc0001ec720, 0x934840, 0xc00034c500)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:617 +0x2f1
cmd/go/internal/modload.(*loader).doPkg-fm(0x934840, 0xc00034c500)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:506 +0x3e
cmd/go/internal/par.(*Work).runner(0xc0000f4280)
	/home/u/go1.12/src/cmd/go/internal/par/work.go:101 +0x135
created by cmd/go/internal/par.(*Work).Do
	/home/u/go1.12/src/cmd/go/internal/par/work.go:67 +0x9b
@agnivade

This comment has been minimized.

Member

agnivade commented Nov 26, 2018

/cc @bcmills

Panics even in 1.11, although with a different error.

go: finding llvm.org/llvm/bindings/go/llvm latest panic: runtime error: slice bounds out of range

goroutine 432 [running]:
cmd/go/internal/modfetch/codehost.RunWithStdin(0x0, 0x0, 0x0, 0x0, 0xc00011b4b0, 0x1, 0x1, 0x0, 0x0, 0x0, ...)
/usr/local/go/src/cmd/go/internal/modfetch/codehost/codehost.go:256 +0x1415
cmd/go/internal/modfetch/codehost.Run(0x0, 0x0, 0xc00011b4b0, 0x1, 0x1, 0x1, 0xa2a840, 0xc000488950, 0x0, 0xc00011b4d8)
/usr/local/go/src/cmd/go/internal/modfetch/codehost/codehost.go:201 +0x68
cmd/go/internal/modfetch/codehost.(*vcsRepo).fetch(0xc0003a0600)
/usr/local/go/src/cmd/go/internal/modfetch/codehost/vcs.go:312 +0x98
cmd/go/internal/modfetch/codehost.(*vcsRepo).fetch-fm()
/usr/local/go/src/cmd/go/internal/modfetch/codehost/vcs.go:297 +0x2a
sync.(*Once).Do(0xc0003a0658, 0xc00011b560)
/usr/local/go/src/sync/once.go:44 +0xb3
cmd/go/internal/modfetch/codehost.(*vcsRepo).Stat(0xc0003a0600, 0x978274, 0x6, 0x4c6a71, 0xc000a64000, 0xc000153100)
/usr/local/go/src/cmd/go/internal/modfetch/codehost/vcs.go:297 +0xfb
cmd/go/internal/modfetch/codehost.(*vcsRepo).Latest(0xc0003a0600, 0x0, 0x0, 0x0)
/usr/local/go/src/cmd/go/internal/modfetch/codehost/vcs.go:324 +0x40
cmd/go/internal/modfetch.(*codeRepo).Latest(0xc0003a0680, 0xc00000e020, 0x9811d9, 0x16)
/usr/local/go/src/cmd/go/internal/modfetch/coderepo.go:163 +0x38
cmd/go/internal/modfetch.(*cachingRepo).Latest.func1(0xc000346d24, 0x8ceee0)
/usr/local/go/src/cmd/go/internal/modfetch/cache.go:158 +0x5a
cmd/go/internal/par.(*Cache).Do(0xc0002ac330, 0x8ceee0, 0xa26380, 0xc00011b780, 0x0, 0xd814d8)
/usr/local/go/src/cmd/go/internal/par/work.go:128 +0xd6
cmd/go/internal/modfetch.(*cachingRepo).Latest(0xc0002ac320, 0x0, 0x0, 0x0)
/usr/local/go/src/cmd/go/internal/modfetch/cache.go:154 +0x70
cmd/go/internal/modload.Query(0xc000108441, 0x1e, 0x978274, 0x6, 0x9b6418, 0x20, 0xc0006cab01, 0x0)
/usr/local/go/src/cmd/go/internal/modload/query.go:173 +0x3a9
cmd/go/internal/modload.QueryPackage(0xc000108441, 0x1e, 0x978274, 0x6, 0x9b6418, 0x4147b5, 0xc0002c0068, 0xc0006cad50, 0x10, 0x40397f, ...)
/usr/local/go/src/cmd/go/internal/modload/query.go:225 +0x202
cmd/go/internal/modload.Import(0xc000108441, 0x1e, 0x3, 0x0, 0xc0006caf00, 0x5cdc8b, 0xc0000fce40, 0x4dba7b0f9da1d7eb, 0xc0006caf40, 0x5cded3)
/usr/local/go/src/cmd/go/internal/modload/import.go:135 +0x6fe
cmd/go/internal/modload.(*loader).doPkg(0xc000298300, 0x8f9540, 0xc0001b20a0)
/usr/local/go/src/cmd/go/internal/modload/load.go:614 +0x2f3
cmd/go/internal/modload.(*loader).doPkg-fm(0x8f9540, 0xc0001b20a0)
/usr/local/go/src/cmd/go/internal/modload/load.go:503 +0x3e
cmd/go/internal/par.(*Work).runner(0xc000102500)
/usr/local/go/src/cmd/go/internal/par/work.go:101 +0x12d
created by cmd/go/internal/par.(*Work).Do
/usr/local/go/src/cmd/go/internal/par/work.go:67 +0x9b

Tentatively marking for 1.12. Feel free to punt.

@agnivade agnivade added this to the Go1.12 milestone Nov 26, 2018

@agnivade agnivade added the NeedsFix label Nov 26, 2018

@bcmills

This comment has been minimized.

Member

bcmills commented Dec 7, 2018

I can't reproduce this at head.

$ go version
go version devel +f604b6ce38 Fri Dec 7 16:31:30 2018 +0000 linux/amd64

$ git clone https://github.com/elz-lang/elz
[…]
$ cd elz
elz$ git checkout f1b9a0f
Note: checking out 'f1b9a0f'.
[…]

elz$ go install ./...
go: finding github.com/pmezard/go-difflib v1.0.0
go: finding github.com/spf13/cobra v0.0.3
go: finding github.com/inconshreveable/mousetrap v1.0.0
go: finding github.com/stretchr/testify v1.2.2
go: finding github.com/mattn/go-isatty v0.0.4
go: finding github.com/dannypsnl/assert v0.0.12
go: finding github.com/antlr/antlr4 v0.0.0-20181121174635-180f1af9689e
go: finding github.com/kr/pty v1.1.3
go: finding github.com/davecgh/go-spew v1.1.1
go: finding github.com/llir/llvm v0.2.1
go: github.com/llir/llvm@v0.2.1: unknown revision v0.2.1
go: finding github.com/mewkiz/pkg v0.0.0-20181119122551-9729f4f4ff2b
go: finding github.com/spf13/pflag v1.0.3
go: finding golang.org/x/sys v0.0.0-20181121002834-0cf1ed9e522b
go: error loading module requirements

Do note the error midway through: go: github.com/llir/llvm@v0.2.1: unknown revision v0.2.1. Perhaps that's related.

@bcmills

This comment has been minimized.

Member

bcmills commented Dec 7, 2018

@mewmew, can you verify whether this still reproduces for you at a more recent devel version? I wonder if this was fixed by the synchronization changes in https://golang.org/cl/146381.

@mewmew

This comment has been minimized.

Contributor

mewmew commented Dec 7, 2018

@bcmills, I still get a nil pointer defer it looks like:

I cloned elz-lang/elz@f1b9a0f to a directory outside of GOPATH and ran go install -v ./... on the following go version:

u@x1 ~/D/f/elz> go version
go version devel +9555769aa5 Fri Dec 7 21:15:13 2018 +0000 linux/amd64
u@x1 ~/D/f/elz> go install -v ./...
Fetching https://llvm.org/llvm/bindings/go/llvm?go-get=1
Parsing meta tags from https://llvm.org/llvm/bindings/go/llvm?go-get=1 (status code 200)
get "llvm.org/llvm/bindings/go/llvm": found meta tag get.metaImport{Prefix:"llvm.org/llvm", VCS:"svn", RepoRoot:"https://llvm.org/svn/llvm-project/llvm/trunk"} at https://llvm.org/llvm/bindings/go/llvm?go-get=1
get "llvm.org/llvm/bindings/go/llvm": verifying non-authoritative meta tag
Fetching https://llvm.org/llvm?go-get=1
Parsing meta tags from https://llvm.org/llvm?go-get=1 (status code 200)
go: finding llvm.org/llvm/bindings/go/llvm latest
Fetching https://llvm.org/llvm/bindings/go?go-get=1
Parsing meta tags from https://llvm.org/llvm/bindings/go?go-get=1 (status code 200)
Fetching https://llvm.org/llvm/bindings?go-get=1
Parsing meta tags from https://llvm.org/llvm/bindings?go-get=1 (status code 200)
Fetching https://llvm.org/llvm?go-get=1
Parsing meta tags from https://llvm.org/llvm?go-get=1 (status code 200)
get "llvm.org/llvm": found meta tag get.metaImport{Prefix:"llvm.org/llvm", VCS:"svn", RepoRoot:"https://llvm.org/svn/llvm-project/llvm/trunk"} at https://llvm.org/llvm?go-get=1
go: finding llvm.org/llvm latest
go: downloading llvm.org/llvm v0.0.0-20181207213537-000000348648
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5fcb7d]

goroutine 1 [running]:
cmd/go/internal/modfetch/codehost.(*vcsRepo).ReadZip(0xc0005762d0, 0xc000379186, 0xc, 0x0, 0x0, 0x1f400000, 0x0, 0x0, 0x0, 0x0, ...)
	/home/u/go1.12/src/cmd/go/internal/modfetch/codehost/vcs.go:428 +0x56d
cmd/go/internal/modfetch.(*codeRepo).Zip(0xc0004d6400, 0xa9d220, 0xc00027c118, 0xc000379170, 0x22, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/coderepo.go:415 +0xe6
cmd/go/internal/modfetch.(*cachingRepo).Zip(0xc0000aa0f0, 0xa9d220, 0xc00027c118, 0xc000379170, 0x22, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/cache.go:255 +0x5c
cmd/go/internal/modfetch.downloadZip(0xc00048e181, 0xd, 0xc000379170, 0x22, 0xc00025a8a0, 0x5c, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:212 +0x2ab
cmd/go/internal/modfetch.DownloadZip.func1(0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:172 +0x2a8
cmd/go/internal/par.(*Cache).Do(0xe1b6c0, 0x965a60, 0xc0004065a0, 0xc0000e67e0, 0xa9de20, 0xdda610)
	/home/u/go1.12/src/cmd/go/internal/par/work.go:128 +0xd3
cmd/go/internal/modfetch.DownloadZip(0xc00048e181, 0xd, 0xc000379170, 0x22, 0xa9d280, 0xc000417290, 0x46, 0xc0000e6968)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:143 +0xd6
cmd/go/internal/modfetch.download(0xc00048e181, 0xd, 0xc000379170, 0x22, 0xc0002271d0, 0x46, 0xa9d280, 0xc000417290)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:67 +0xc0
cmd/go/internal/modfetch.Download.func1(0xc000406584, 0x965a60)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:48 +0xa5
cmd/go/internal/par.(*Cache).Do(0xe1b680, 0x965a60, 0xc000406560, 0xc0000e6ac8, 0x80, 0xc000046e00)
	/home/u/go1.12/src/cmd/go/internal/par/work.go:128 +0xd3
cmd/go/internal/modfetch.Download(0xc00048e181, 0xd, 0xc000379170, 0x22, 0x0, 0x0, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:43 +0x1a3
cmd/go/internal/modload.fetch(0xc00048e181, 0xd, 0xc000379170, 0x22, 0xa0d8d0, 0xc0002f7630, 0x0, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:1069 +0xcf
cmd/go/internal/modload.QueryPackage(0xc00048e181, 0x1e, 0x9cdf0c, 0x6, 0xa0d8d0, 0x80, 0x0, 0x0, 0x0, 0x32, ...)
	/home/u/go1.12/src/cmd/go/internal/modload/query.go:240 +0x28a
cmd/go/internal/modload.Import(0xc00048e181, 0x1e, 0x3, 0x0, 0xffffffffffffffff, 0xc000430e40, 0x2, 0x4, 0xc0000e7150, 0x5d53ac)
	/home/u/go1.12/src/cmd/go/internal/modload/import.go:181 +0xa2e
cmd/go/internal/modload.(*loader).doPkg(0xc000190fc0, 0x947560, 0xc0002750e0)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:618 +0x2ee
cmd/go/internal/modload.(*loader).doPkg-fm(0x947560, 0xc0002750e0)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:507 +0x3e
cmd/go/internal/par.(*Work).runner(0xc0003c2080)
	/home/u/go1.12/src/cmd/go/internal/par/work.go:101 +0x135
cmd/go/internal/par.(*Work).Do(0xc0003c2080, 0xa, 0xc000058c90)
	/home/u/go1.12/src/cmd/go/internal/par/work.go:69 +0xbf
cmd/go/internal/modload.(*loader).load(0xc000190fc0, 0xc0002656b8)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:507 +0x6f4
cmd/go/internal/modload.ImportPaths(0xc0000a8070, 0x1, 0x1, 0x0, 0x40d104, 0xc000211360)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:161 +0x2ed
cmd/go/internal/load.ImportPaths(0xc0000a8070, 0x1, 0x1, 0x0, 0x21, 0xc00009c840)
	/home/u/go1.12/src/cmd/go/internal/load/pkg.go:1884 +0x5f
cmd/go/internal/load.PackagesAndErrors(0xc0000a8070, 0x1, 0x1, 0xc00009c840, 0xc0000e7b08, 0x446ccf)
	/home/u/go1.12/src/cmd/go/internal/load/pkg.go:1835 +0xa3
cmd/go/internal/load.PackagesForBuild(0xc0000a8070, 0x1, 0x1, 0x95db00, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/load/pkg.go:1893 +0x5d
cmd/go/internal/work.runInstall(0xe123c0, 0xc0000a8070, 0x1, 0x1)
	/home/u/go1.12/src/cmd/go/internal/work/build.go:417 +0x44
main.main()
	/home/u/go1.12/src/cmd/go/main.go:219 +0x82d

mewmew added a commit to mewspring/go-issue-28943 that referenced this issue Dec 7, 2018

@mewmew

This comment has been minimized.

Contributor

mewmew commented Dec 7, 2018

I put a minimal reproducible example at https://github.com/mewspring/go-issue-28943

Edit: I also tried to remove $GOPATH/pkg/mod prior to running these commands, but the results were the same.

[u@x1 tmp]$ git clone https://github.com/mewspring/go-issue-28943
Cloning into 'go-issue-28943'...
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 4 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), done.

[u@x1 tmp]$ cd go-issue-28943/

[u@x1 go-issue-28943]$ go version
go version devel +9555769aa5 Fri Dec 7 21:15:13 2018 +0000 linux/amd64

[u@x1 go-issue-28943]$ go install -v
Fetching https://llvm.org/llvm/bindings/go/llvm?go-get=1
Parsing meta tags from https://llvm.org/llvm/bindings/go/llvm?go-get=1 (status code 200)
get "llvm.org/llvm/bindings/go/llvm": found meta tag get.metaImport{Prefix:"llvm.org/llvm", VCS:"svn", RepoRoot:"https://llvm.org/svn/llvm-project/llvm/trunk"} at https://llvm.org/llvm/bindings/go/llvm?go-get=1
get "llvm.org/llvm/bindings/go/llvm": verifying non-authoritative meta tag
Fetching https://llvm.org/llvm?go-get=1
Parsing meta tags from https://llvm.org/llvm?go-get=1 (status code 200)
go: finding llvm.org/llvm/bindings/go/llvm latest
Fetching https://llvm.org/llvm/bindings/go?go-get=1
Parsing meta tags from https://llvm.org/llvm/bindings/go?go-get=1 (status code 200)
Fetching https://llvm.org/llvm/bindings?go-get=1
Parsing meta tags from https://llvm.org/llvm/bindings?go-get=1 (status code 200)
Fetching https://llvm.org/llvm?go-get=1
Parsing meta tags from https://llvm.org/llvm?go-get=1 (status code 200)
get "llvm.org/llvm": found meta tag get.metaImport{Prefix:"llvm.org/llvm", VCS:"svn", RepoRoot:"https://llvm.org/svn/llvm-project/llvm/trunk"} at https://llvm.org/llvm?go-get=1
go: finding llvm.org/llvm latest
go: downloading llvm.org/llvm v0.0.0-20181207214425-000000348649
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5fcb7d]

goroutine 1 [running]:
cmd/go/internal/modfetch/codehost.(*vcsRepo).ReadZip(0xc0002d0000, 0xc0000a0346, 0xc, 0x0, 0x0, 0x1f400000, 0x0, 0x0, 0x0, 0x0, ...)
	/home/u/go1.12/src/cmd/go/internal/modfetch/codehost/vcs.go:428 +0x56d
cmd/go/internal/modfetch.(*codeRepo).Zip(0xc000110800, 0xa9d220, 0xc0001121c0, 0xc0000a0330, 0x22, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/coderepo.go:415 +0xe6
cmd/go/internal/modfetch.(*cachingRepo).Zip(0xc0002c8190, 0xa9d220, 0xc0001121c0, 0xc0000a0330, 0x22, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/cache.go:255 +0x5c
cmd/go/internal/modfetch.downloadZip(0xc0000a6361, 0xd, 0xc0000a0330, 0x22, 0xc0002d8480, 0x5c, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:212 +0x2ab
cmd/go/internal/modfetch.DownloadZip.func1(0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:172 +0x2a8
cmd/go/internal/par.(*Cache).Do(0xe1b6c0, 0x965a60, 0xc0003588e0, 0xc0001267e0, 0xa9de20, 0xdda610)
	/home/u/go1.12/src/cmd/go/internal/par/work.go:128 +0xd3
cmd/go/internal/modfetch.DownloadZip(0xc0000a6361, 0xd, 0xc0000a0330, 0x22, 0xa9d280, 0xc0000eec00, 0x46, 0xc000126968)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:143 +0xd6
cmd/go/internal/modfetch.download(0xc0000a6361, 0xd, 0xc0000a0330, 0x22, 0xc000400050, 0x46, 0xa9d280, 0xc0000eec00)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:67 +0xc0
cmd/go/internal/modfetch.Download.func1(0xc0003588c4, 0x965a60)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:48 +0xa5
cmd/go/internal/par.(*Cache).Do(0xe1b680, 0x965a60, 0xc0003588a0, 0xc000126ac8, 0x40, 0xc000084960)
	/home/u/go1.12/src/cmd/go/internal/par/work.go:128 +0xd3
cmd/go/internal/modfetch.Download(0xc0000a6361, 0xd, 0xc0000a0330, 0x22, 0x0, 0x0, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modfetch/fetch.go:43 +0x1a3
cmd/go/internal/modload.fetch(0xc0000a6361, 0xd, 0xc0000a0330, 0x22, 0xa0d8d0, 0xc0003161e0, 0x0, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:1069 +0xcf
cmd/go/internal/modload.QueryPackage(0xc0000a6361, 0x1e, 0x9cdf0c, 0x6, 0xa0d8d0, 0x40, 0x0, 0x0, 0x414915, 0x8, ...)
	/home/u/go1.12/src/cmd/go/internal/modload/query.go:240 +0x28a
cmd/go/internal/modload.Import(0xc0000a6361, 0x1e, 0x3, 0x0, 0xffffffffffffffff, 0xc0000a80f8, 0x0, 0x1, 0xc000127150, 0x5d53ac)
	/home/u/go1.12/src/cmd/go/internal/modload/import.go:181 +0xa2e
cmd/go/internal/modload.(*loader).doPkg(0xc000256180, 0x947560, 0xc0000ca780)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:618 +0x2ee
cmd/go/internal/modload.(*loader).doPkg-fm(0x947560, 0xc0000ca780)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:507 +0x3e
cmd/go/internal/par.(*Work).runner(0xc0000d4200)
	/home/u/go1.12/src/cmd/go/internal/par/work.go:101 +0x135
cmd/go/internal/par.(*Work).Do(0xc0000d4200, 0xa, 0xc0000907b0)
	/home/u/go1.12/src/cmd/go/internal/par/work.go:69 +0xbf
cmd/go/internal/modload.(*loader).load(0xc000256180, 0xc0002b36b8)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:507 +0x6f4
cmd/go/internal/modload.ImportPaths(0xc000092170, 0x0, 0x0, 0x0, 0x40d104, 0xc0002792e0)
	/home/u/go1.12/src/cmd/go/internal/modload/load.go:161 +0x2ed
cmd/go/internal/load.ImportPaths(0xc000092170, 0x0, 0x0, 0x0, 0x1a, 0xc000279320)
	/home/u/go1.12/src/cmd/go/internal/load/pkg.go:1884 +0x5f
cmd/go/internal/load.PackagesAndErrors(0xc000092170, 0x0, 0x0, 0xc000279320, 0xc000127b08, 0x446ccf)
	/home/u/go1.12/src/cmd/go/internal/load/pkg.go:1835 +0xa3
cmd/go/internal/load.PackagesForBuild(0xc000092170, 0x0, 0x0, 0x95db00, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/load/pkg.go:1893 +0x5d
cmd/go/internal/work.runInstall(0xe123c0, 0xc000092170, 0x0, 0x0)
	/home/u/go1.12/src/cmd/go/internal/work/build.go:417 +0x44
main.main()
	/home/u/go1.12/src/cmd/go/main.go:219 +0x82d
@bcmills

This comment has been minimized.

Member

bcmills commented Dec 7, 2018

Ok, that one reproduces it for me. Thanks!

@bcmills bcmills removed the WaitingForInfo label Dec 7, 2018

@bcmills

This comment has been minimized.

Member

bcmills commented Dec 7, 2018

Found the trouble, I think:

@mewmew

This comment has been minimized.

Contributor

mewmew commented Dec 7, 2018

Perfect!

@bcmills bcmills changed the title from cmd/go: modfetch.(*codeRepo).Zip, invalid memory address or nil pointer dereference to cmd/go/internal/modfetch/codehost: implement zip support for svn Dec 7, 2018

@bcmills bcmills added the help wanted label Dec 7, 2018

@bcmills

This comment has been minimized.

Member

bcmills commented Dec 10, 2018

Ah, the svn support is #26092. We can at least fix the failure message, though.

@bcmills bcmills changed the title from cmd/go/internal/modfetch/codehost: implement zip support for svn to cmd/go: panic when loading a module from svn Dec 10, 2018

@gopherbot

This comment has been minimized.

gopherbot commented Dec 10, 2018

Change https://golang.org/cl/153458 mentions this issue: cmd/go/internal/modfetch/codehost: return VCSError for unimplemented functions and malformed responses

@gopherbot

This comment has been minimized.

gopherbot commented Dec 10, 2018

Change https://golang.org/cl/153459 mentions this issue: cmd/go: fix 'go test' and 'go fmt' with files outside a module

gopherbot pushed a commit that referenced this issue Dec 11, 2018

cmd/go/internal/modfetch/codehost: return VCSError for unimplemented …
…functions and malformed responses

Updates #28943
Updates #26092

Change-Id: I07af2731ef5af046b9f7c7280ccb3976cdf41ca4
Reviewed-on: https://go-review.googlesource.com/c/153458
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>

@gopherbot gopherbot closed this in cee9dfc Dec 11, 2018

@bcmills

This comment has been minimized.

Member

bcmills commented Dec 11, 2018

The panic should be fixed, but note that the code in question still won't build in module mode. (That's #26092, which I've left open.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment