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: panic on inconsistent import #16633

Closed
zg opened this issue Aug 8, 2016 · 3 comments

Comments

Projects
None yet
4 participants
@zg
Copy link

commented Aug 8, 2016

Please answer these questions before submitting your issue. Thanks!

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

go version go1.7rc5 darwin/amd64

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

Operating system: macOS Sierra 10.12 Beta
Processor architecture: amd64

$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/zg/work"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.7rc5/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.7rc5/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/lw/fyqtdrzj047c4rwz6_xz76180000gn/T/go-build086129730=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
  1. What did you do?
    I ran go vet ./... and I got a panic from what appears to be something on the internals of Go.
  2. What did you expect to see?
    Issues with my own code.
  3. What did you see instead?
$ go vet ./...
panic: inconsistent import:
        func strings.HasPrefix(s string, prefix string) bool
previously imported as:
        func strings.HasPrefix(s string, prefix string) bool
 [recovered]
        panic: inconsistent import:
        func strings.HasPrefix(s string, prefix string) bool
previously imported as:
        func strings.HasPrefix(s string, prefix string) bool


goroutine 1 [running]:
panic(0x273480, 0xc420159600)
        /usr/local/Cellar/go/1.7rc5/libexec/src/runtime/panic.go:500 +0x1a1
go/types.(*Checker).handleBailout(0xc4200de1c0, 0xc4207ab8d8)
        /usr/local/Cellar/go/1.7rc5/libexec/src/go/types/check.go:213 +0xae
panic(0x273480, 0xc420159600)
        /usr/local/Cellar/go/1.7rc5/libexec/src/runtime/panic.go:458 +0x243
go/internal/gcimporter.(*importer).declare(0xc4202a0750, 0x3f5180, 0xc4202b3cc0)
        /usr/local/Cellar/go/1.7rc5/libexec/src/go/internal/gcimporter/bimport.go:175 +0x17c
go/internal/gcimporter.(*importer).obj(0xc4202a0750, 0xfffffffffffffffb)
        /usr/local/Cellar/go/1.7rc5/libexec/src/go/internal/gcimporter/bimport.go:203 +0x4a2
go/internal/gcimporter.BImportData(0xc420088cf0, 0xc420390000, 0x1938c, 0x1fe00, 0xc4201aa0e1, 0x7, 0x0, 0x7, 0x0, 0x0)
        /usr/local/Cellar/go/1.7rc5/libexec/src/go/internal/gcimporter/bimport.go:88 +0x390
go/internal/gcimporter.Import(0xc420088cf0, 0xc4201aa0e1, 0x7, 0x7fff5fbff97e, 0x6, 0xc420152730, 0x0, 0x0)
        /usr/local/Cellar/go/1.7rc5/libexec/src/go/internal/gcimporter/gcimporter.go:166 +0x551
go/importer.gcimports.ImportFrom(0xc420088cf0, 0xc4201aa0e1, 0x7, 0x7fff5fbff97e, 0x6, 0x0, 0xc420347cc0, 0x0, 0x0)
        /usr/local/Cellar/go/1.7rc5/libexec/src/go/importer/importer.go:70 +0x67
go/types.(*Checker).collectObjects(0xc4200de1c0)
        /usr/local/Cellar/go/1.7rc5/libexec/src/go/types/resolver.go:191 +0x826
go/types.(*Checker).checkFiles(0xc4200de1c0, 0xc4201bd1c0, 0x3, 0x4, 0x0, 0x0)
        /usr/local/Cellar/go/1.7rc5/libexec/src/go/types/check.go:225 +0xaa
go/types.(*Checker).Files(0xc4200de1c0, 0xc4201bd1c0, 0x3, 0x4, 0xc4201b7470, 0xc4200ef960)
        /usr/local/Cellar/go/1.7rc5/libexec/src/go/types/check.go:218 +0x49
go/types.(*Config).Check(0xc4201bb780, 0xc420087518, 0x6, 0xc4200a73c0, 0xc4201bd1c0, 0x3, 0x4, 0xc4201be050, 0x0, 0xc4200001a0, ...)
        /usr/local/Cellar/go/1.7rc5/libexec/src/go/types/api.go:344 +0x1a3
main.(*Package).check(0xc4200b2840, 0xc4200a73c0, 0xc4201bd1c0, 0x3, 0x4, 0xc4201bd1e0, 0x2)
        /usr/local/Cellar/go/1.7rc5/libexec/src/cmd/vet/types.go:76 +0x370
main.doPackage(0x2cd6a4, 0x1, 0xc42000a250, 0x3, 0x3, 0x0, 0x1)
        /usr/local/Cellar/go/1.7rc5/libexec/src/cmd/vet/main.go:336 +0x999
main.main()
        /usr/local/Cellar/go/1.7rc5/libexec/src/cmd/vet/main.go:244 +0x345
exit status 2

@zg zg changed the title Panic issues with go vet ./... Panic issues with `go vet ./...` Aug 8, 2016

@zg zg changed the title Panic issues with `go vet ./...` Panic issues with go vet ./... Aug 8, 2016

@zg

This comment has been minimized.

Copy link
Author

commented Aug 8, 2016

I wasn't able to reproduce this issue...

@ALTree

This comment has been minimized.

Copy link
Member

commented Aug 8, 2016

If it went away after a go install, this is the same as #16112 and it's not a bug, just a panic caused by out-of-date .o files and the fact that there's a new export format.

@quentinmit quentinmit changed the title Panic issues with go vet ./... cmd/vet: panic on inconsistent import Aug 8, 2016

@quentinmit

This comment has been minimized.

Copy link
Contributor

commented Aug 8, 2016

Sounds like a dupe of #16112. Interesting that here we have the exact same pretty-print of the duplicate symbol, though. Please try starting from a fresh GOPATH, and comment here if you're able to reproduce.

@quentinmit quentinmit closed this Aug 8, 2016

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