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

x/vgo: incorrect go.mod causes panic #24181

Closed
FrankReh opened this issue Feb 28, 2018 · 2 comments
Closed

x/vgo: incorrect go.mod causes panic #24181

FrankReh opened this issue Feb 28, 2018 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@FrankReh
Copy link

Please answer these questions before submitting your issue. Thanks!

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

$ vgo version
go version go1.10 darwin/amd64 vgo:2018-02-20.1

Does this issue reproduce with the latest release?

Yes.

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

GOARCH="amd64"
GOOS="darwin"

What did you do?

In a new directory, created a malformed go.mod, all it contains is a comment line, ran vgo build.

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

mkdir n
cd n
echo '//' > go.mod
vgo build

What did you expect to see?

Expected to see an error about a malformed go.mod file or message that the module path cannot be determined, as when there is no go.mod, the go.mod is empty, or the go.mod has something other than just a comment line.

What did you see instead?

$ vgo build
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x13721a0]

goroutine 1 [running]:
golang.org/x/vgo/vendor/cmd/go/internal/vgo.InitMod()
/Users/frank/x/go/src/golang.org/x/vgo/vendor/cmd/go/internal/vgo/init.go:143 +0x370
golang.org/x/vgo/vendor/cmd/go/internal/vgo.ImportPaths(0xc4200b6010, 0x0, 0x0, 0xc4201fa390, 0x1, 0x1)
/Users/frank/x/go/src/golang.org/x/vgo/vendor/cmd/go/internal/vgo/load.go:68 +0x38
golang.org/x/vgo/vendor/cmd/go/internal/load.ImportPaths(0xc4200b6010, 0x0, 0x0, 0x1012359, 0x10452cf, 0x43)
/Users/frank/x/go/src/golang.org/x/vgo/vendor/cmd/go/internal/load/pkg.go:1485 +0x4f
golang.org/x/vgo/vendor/cmd/go/internal/load.PackagesAndErrors(0xc4200b6010, 0x0, 0x0, 0xc4201d9aa0, 0x103469b, 0x43)
/Users/frank/x/go/src/golang.org/x/vgo/vendor/cmd/go/internal/load/pkg.go:1457 +0xac
golang.org/x/vgo/vendor/cmd/go/internal/load.PackagesForBuild(0xc4200b6010, 0x0, 0x0, 0x10, 0x10, 0x14b5e80)
/Users/frank/x/go/src/golang.org/x/vgo/vendor/cmd/go/internal/load/pkg.go:1499 +0x5d
golang.org/x/vgo/vendor/cmd/go/internal/work.runBuild(0x17b4780, 0xc4200b6010, 0x0, 0x0)
/Users/frank/x/go/src/golang.org/x/vgo/vendor/cmd/go/internal/work/build.go:301 +0x85
golang.org/x/vgo/vendor/cmd/go.Main()
/Users/frank/x/go/src/golang.org/x/vgo/vendor/cmd/go/main.go:155 +0x82e
main.main()
/Users/frank/x/go/src/golang.org/x/vgo/main.go:37 +0x25

@gopherbot gopherbot added this to the vgo milestone Feb 28, 2018
@rsc rsc added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 30, 2018
@gopherbot
Copy link

Change https://golang.org/cl/106800 mentions this issue: x/vgo: fix incorrect go.mod panic

@oiooj
Copy link
Member

oiooj commented Apr 13, 2018

I'm working on it.

@golang golang locked and limited conversation to collaborators Apr 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants