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/vet: Panics with "<some-symbol> already declared" on 1.7/master #15517

Closed
calmh opened this issue May 3, 2016 · 4 comments

Comments

Projects
None yet
6 participants
@calmh
Copy link
Contributor

commented May 3, 2016

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

go version devel +499cd33 Tue May 3 00:49:46 2016 +0000 darwin/amd64

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

darwin/amd64

What did you do?

Running go vet on the code base as part of the build, as usual. Works fine in 1.6. With current master, go vet panics on some parts of the code. Only happens when the package has actually been built.

$ cd $GOPATH/src/github.com/syncthing/syncthing
$ git describe --always
v0.13.0-beta.3-24-g29fa05a
$ go vet ./cmd/stindex     # this is fine
$ go install ./cmd/stindex
$ go vet ./cmd/stindex     # this is no longer fine
panic: Open already declared [recovered]
    panic: Open already declared

goroutine 1 [running]:
panic(0x2416a0, 0xc8201e5510)
    /usr/local/go-exp/src/runtime/panic.go:500 +0x18c
go/types.(*Checker).handleBailout(0xc8200ba1c0, 0xc82047f908)
    /usr/local/go-exp/src/go/types/check.go:213 +0x95
panic(0x2416a0, 0xc8201e5510)
    /usr/local/go-exp/src/runtime/panic.go:458 +0x226
go/internal/gcimporter.(*importer).declare(0xc820090000, 0x3b4e60, 0xc8201989b0)
    /usr/local/go-exp/src/go/internal/gcimporter/bimport.go:165 +0x156
go/internal/gcimporter.(*importer).obj(0xc820090000, 0xfffffffffffffffb)
    /usr/local/go-exp/src/go/internal/gcimporter/bimport.go:193 +0x477
go/internal/gcimporter.BImportData(0xc820015050, 0xc8201fa000, 0xd9120, 0xffe00, 0xc8201572f1, 0x23, 0x0, 0x49, 0x283a40, 0x1)
    /usr/local/go-exp/src/go/internal/gcimporter/bimport.go:83 +0x306
go/internal/gcimporter.Import(0xc820015050, 0xc8201572f1, 0x23, 0x7fff5fbff75c, 0xb, 0xc8201f5d10, 0x0, 0x0)
    /usr/local/go-exp/src/go/internal/gcimporter/gcimporter.go:166 +0x527
go/importer.gcimports.ImportFrom(0xc820015050, 0xc8201572f1, 0x23, 0x7fff5fbff75c, 0xb, 0x0, 0xc8201c5ea0, 0x0, 0x0)
    /usr/local/go-exp/src/go/importer/importer.go:70 +0x5a
go/types.(*Checker).collectObjects(0xc8200ba1c0)
    /usr/local/go-exp/src/go/types/resolver.go:191 +0x7c9
go/types.(*Checker).checkFiles(0xc8200ba1c0, 0xc820173ca0, 0x4, 0x4, 0x0, 0x0)
    /usr/local/go-exp/src/go/types/check.go:225 +0xa0
go/types.(*Checker).Files(0xc8200ba1c0, 0xc820173ca0, 0x4, 0x4, 0xc8201715f0, 0x18)
    /usr/local/go-exp/src/go/types/check.go:218 +0x3f
go/types.(*Config).Check(0xc820175280, 0xc820011898, 0x4, 0xc820013500, 0xc820173ca0, 0x4, 0x4, 0xc82016eff0, 0x18, 0xc820176b60, ...)
    /usr/local/go-exp/src/go/types/api.go:344 +0x184
main.(*Package).check(0xc82006f1a0, 0xc820013500, 0xc820173ca0, 0x4, 0x4, 0x0, 0xc8200a5400)
    /usr/local/go-exp/src/cmd/vet/types.go:76 +0x330
main.doPackage(0x298dbc, 0x1, 0xc82000a1f0, 0x4, 0x4, 0x0)
    /usr/local/go-exp/src/cmd/vet/main.go:333 +0x951
main.main()
    /usr/local/go-exp/src/cmd/vet/main.go:241 +0x317
exit status 2
@0xmohit

This comment has been minimized.

Copy link
Contributor

commented May 3, 2016

Interestingly, the following doesn't panic:

go vet ./cmd/stindex
go install -gcflags="-newexport=0" ./cmd/stindex
go vet ./cmd/stindex
@gopherbot

This comment has been minimized.

Copy link

commented May 11, 2016

CL https://golang.org/cl/23012 mentions this issue.

@dominikh

This comment has been minimized.

Copy link
Member

commented Jul 13, 2016

@griesemer will this be backported to /x/tools/go/gcimporter15 or is one not supposed to use that package anymore?

@griesemer

This comment has been minimized.

Copy link
Contributor

commented Jul 13, 2016

@dominikh This should have been back-ported already (if not, please file an issue and send it to me). /x/tools/go/gcimporter15 will stick around for the time being until go/importer provides some functionality it is currently missing.

tsandall added a commit to tsandall/opa that referenced this issue Aug 16, 2016

Vendoring: Update golang.org/x/tools
The main reason for the update is to pickup a fix for
golang/go#15517 that was backported to gcimporter15.
The issue was occuring while running golint on the project.

@golang golang locked and limited conversation to collaborators Jul 13, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.