Skip to content

cmd/vet: panics #17258

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

Closed
szank opened this issue Sep 28, 2016 · 2 comments
Closed

cmd/vet: panics #17258

szank opened this issue Sep 28, 2016 · 2 comments

Comments

@szank
Copy link

szank commented Sep 28, 2016

Please answer these questions before submitting your issue. Thanks!

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

go version go1.7.1 darwin/amd64

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/mgalkowski/work/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.7.1/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.7.1/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/cs/93b4_xbx4l5gn1wx0f69p3d40000gn/T/go-build080226465=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

What did you do?

i did run go vet ./... in my project base dir. I did get a lot of panics.
I did rerun it with go vet -x ./... and found that vet would panic checking seemingly correct packages. The whole project is building and running correctly

What did you expect to see?

No panics

What did you see instead?

Panics.
Our repo is private, so I can't share the code here, but i did run go vet also in our vendor dir. I did get this :

/usr/local/Cellar/go/1.7.1/libexec/pkg/tool/darwin_amd64/vet vendor/github.com/dvsekhvalnov/jose2go/aes_cbc_hmac.go vendor/github.com/dvsekhvalnov/jose2go/aes_gcm.go vendor/github.com/dvsekhvalnov/jose2go/aes_gcm_kw.go vendor/github.com/dvsekhvalnov/jose2go/aeskw.go vendor/github.com/dvsekhvalnov/jose2go/deflate.go vendor/github.com/dvsekhvalnov/jose2go/direct.go vendor/github.com/dvsekhvalnov/jose2go/ecdh.go vendor/github.com/dvsekhvalnov/jose2go/ecdh_aeskw.go vendor/github.com/dvsekhvalnov/jose2go/ecdsa_using_sha.go vendor/github.com/dvsekhvalnov/jose2go/hmac.go vendor/github.com/dvsekhvalnov/jose2go/hmac_using_sha.go vendor/github.com/dvsekhvalnov/jose2go/jose.go vendor/github.com/dvsekhvalnov/jose2go/pbse2_hmac_aeskw.go vendor/github.com/dvsekhvalnov/jose2go/plaintext.go vendor/github.com/dvsekhvalnov/jose2go/rsa_oaep.go vendor/github.com/dvsekhvalnov/jose2go/rsa_pkcs1v15.go vendor/github.com/dvsekhvalnov/jose2go/rsa_using_sha.go vendor/github.com/dvsekhvalnov/jose2go/rsapss_using_sha.go vendor/github.com/dvsekhvalnov/jose2go/sha.go vendor/github.com/dvsekhvalnov/jose2go/jose_test.go
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(0x2734c0, 0xc420402790)
    /usr/local/Cellar/go/1.7.1/libexec/src/runtime/panic.go:500 +0x1a1
go/types.(*Checker).handleBailout(0xc4200ba1c0, 0xc4203eb8e8)
    /usr/local/Cellar/go/1.7.1/libexec/src/go/types/check.go:213 +0xae
panic(0x2734c0, 0xc420402790)
    /usr/local/Cellar/go/1.7.1/libexec/src/runtime/panic.go:458 +0x243
go/internal/gcimporter.(*importer).declare(0xc420401790, 0x3f5180, 0xc4206ed450)
    /usr/local/Cellar/go/1.7.1/libexec/src/go/internal/gcimporter/bimport.go:175 +0x17c
go/internal/gcimporter.(*importer).obj(0xc420401790, 0xfffffffffffffffb)
    /usr/local/Cellar/go/1.7.1/libexec/src/go/internal/gcimporter/bimport.go:203 +0x4a2
go/internal/gcimporter.BImportData(0xc420016f00, 0xc4206cc000, 0x19389, 0x1fe00, 0xc42021e841, 0x7, 0x0, 0x7, 0x203eb050, 0x8)
    /usr/local/Cellar/go/1.7.1/libexec/src/go/internal/gcimporter/bimport.go:88 +0x390
go/internal/gcimporter.Import(0xc420016f00, 0xc42021e841, 0x7, 0x7fff5fbff5d5, 0x26, 0xc4203a39f0, 0x0, 0x0)
    /usr/local/Cellar/go/1.7.1/libexec/src/go/internal/gcimporter/gcimporter.go:166 +0x551
go/importer.gcimports.ImportFrom(0xc420016f00, 0xc42021e841, 0x7, 0x7fff5fbff5d5, 0x26, 0x0, 0xc4203a3630, 0x0, 0x0)
    /usr/local/Cellar/go/1.7.1/libexec/src/go/importer/importer.go:70 +0x67
go/types.(*Checker).collectObjects(0xc4200ba1c0)
    /usr/local/Cellar/go/1.7.1/libexec/src/go/types/resolver.go:191 +0x826
go/types.(*Checker).checkFiles(0xc4200ba1c0, 0xc4201b9500, 0x14, 0x20, 0x0, 0x0)
    /usr/local/Cellar/go/1.7.1/libexec/src/go/types/check.go:225 +0xaa
go/types.(*Checker).Files(0xc4200ba1c0, 0xc4201b9500, 0x14, 0x20, 0xc42032fc80, 0xc4200cb960)
    /usr/local/Cellar/go/1.7.1/libexec/src/go/types/check.go:218 +0x49
go/types.(*Config).Check(0xc42033e880, 0xc420011758, 0x4, 0xc420013c80, 0xc4201b9500, 0x14, 0x20, 0xc420336500, 0x1001, 0xc4200001a0, ...)
    /usr/local/Cellar/go/1.7.1/libexec/src/go/types/api.go:344 +0x1a3
main.(*Package).check(0xc420073da0, 0xc420013c80, 0xc4201b9500, 0x14, 0x20, 0x0, 0xc4202ff700)
    /usr/local/Cellar/go/1.7.1/libexec/src/cmd/vet/types.go:76 +0x370
main.doPackage(0x2cd704, 0x1, 0xc42000a170, 0x14, 0x15, 0x0, 0x1)
    /usr/local/Cellar/go/1.7.1/libexec/src/cmd/vet/main.go:336 +0x999
main.main()
    /usr/local/Cellar/go/1.7.1/libexec/src/cmd/vet/main.go:244 +0x345
exit status 2

jose2go is vendored at the 2a04a552f4a8adf7d51731877b7a2021bab968bb commit.

This part

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

does vary from package to package. Sometimes it is :

panic: inconsistent import:
    func errors.New(text string) error
previously imported as:
    func errors.New(text string) error
 [recovered]
    panic: inconsistent import:
    func errors.New(text string) error
previously imported as:
    func errors.New(text string) error

or

panic: inconsistent import:
    var time.UTC *time.Location
previously imported as:
    var UTC *time.Location
 [recovered]
    panic: inconsistent import:
    var time.UTC *time.Location
previously imported as:
    var UTC *time.Location

I will try to produce a minimal repro.

@ALTree
Copy link
Member

ALTree commented Sep 28, 2016

Dup of #17072, #16680, #16112 etc... Caused by out-of-date .o files, go install will fix it.

Full story here.

@szank
Copy link
Author

szank commented Sep 28, 2016

Thanks!

@szank szank closed this as completed Sep 28, 2016
@golang golang locked and limited conversation to collaborators Sep 28, 2017
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

3 participants