Navigation Menu

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: inconsistent import #16027

Closed
OneOfOne opened this issue Jun 10, 2016 · 11 comments
Closed

cmd/vet: inconsistent import #16027

OneOfOne opened this issue Jun 10, 2016 · 11 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@OneOfOne
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version devel +8042bfe 2016-06-10 01:00:09 +0000 linux/amd64
  2. What operating system and processor architecture are you using (go env)?
    Arch Linux 64bit
  3. What did you do?
    go vet ./...
  4. What did you expect to see?
➤ go16 vet ./...                                                                 2016-06-10T04:04:04+02:00
internal/seatgeek/seatgeek.go:170: Println call ends with newline
exit status 1
server/legacy.go:47: possible formatting directive in Println call
server/restore.go:36: possible formatting directive in Println call
exit status 1
  1. What did you see instead?
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


goroutine 1 [running]:
panic(0x660b20, 0xc4201cd020)
    /usr/src/go/src/runtime/panic.go:500 +0x1a1
go/types.(*Checker).handleBailout(0xc4200bc1c0, 0xc4200cf8e8)
    /usr/src/go/src/go/types/check.go:213 +0xae
panic(0x660b20, 0xc4201cd020)
    /usr/src/go/src/runtime/panic.go:458 +0x243
go/internal/gcimporter.(*importer).declare(0xc4200946c0, 0x7da1e0, 0xc42025ef00)
    /usr/src/go/src/go/internal/gcimporter/bimport.go:173 +0x17c
go/internal/gcimporter.(*importer).obj(0xc4200946c0, 0xfffffffffffffffc)
    /usr/src/go/src/go/internal/gcimporter/bimport.go:193 +0x1af
go/internal/gcimporter.BImportData(0xc4200170b0, 0xc420214000, 0x3a22f, 0x3fe00, 0xc4201601b1, 0x4, 0x0, 0x4, 0xc4201b9dd0, 0xc4200cf0c8)
    /usr/src/go/src/go/internal/gcimporter/bimport.go:86 +0x34c
go/internal/gcimporter.Import(0xc4200170b0, 0xc4201601b1, 0x4, 0x7ffc97115262, 0x11, 0xc42019e460, 0x0, 0x0)
    /usr/src/go/src/go/internal/gcimporter/gcimporter.go:166 +0x551
go/importer.gcimports.ImportFrom(0xc4200170b0, 0xc4201601b1, 0x4, 0x7ffc97115262, 0x11, 0x0, 0x1, 0x2, 0x0)
    /usr/src/go/src/go/importer/importer.go:70 +0x67
go/types.(*Checker).collectObjects(0xc4200bc1c0)
    /usr/src/go/src/go/types/resolver.go:191 +0x81d
go/types.(*Checker).checkFiles(0xc4200bc1c0, 0xc420190a80, 0x6, 0x8, 0x0, 0x0)
    /usr/src/go/src/go/types/check.go:225 +0xaa
go/types.(*Checker).Files(0xc4200bc1c0, 0xc420190a80, 0x6, 0x8, 0xc42018f440, 0xc4200cf960)
    /usr/src/go/src/go/types/check.go:218 +0x49
go/types.(*Config).Check(0xc420191b80, 0xc42000f970, 0x8, 0xc420019a00, 0xc420190a80, 0x6, 0x8, 0xc420189950, 0x7f800fd19000, 0x0, ...)
    /usr/src/go/src/go/types/api.go:344 +0x19f
main.(*Package).check(0xc420012a20, 0xc420019a00, 0xc420190a80, 0x6, 0x8, 0x0, 0xc4200a9480)
    /usr/src/go/src/cmd/vet/types.go:76 +0x36c
main.doPackage(0x6b905c, 0x1, 0xc42000a0f0, 0x6, 0x6, 0x0)
    /usr/src/go/src/cmd/vet/main.go:333 +0x992
main.main()
    /usr/src/go/src/cmd/vet/main.go:241 +0x335
exit status 2
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


goroutine 1 [running]:
panic(0x660b20, 0xc4203025f0)
    /usr/src/go/src/runtime/panic.go:500 +0x1a1
go/types.(*Checker).handleBailout(0xc4200a81c0, 0xc4202478d8)
    /usr/src/go/src/go/types/check.go:213 +0xae
panic(0x660b20, 0xc4203025f0)
    /usr/src/go/src/runtime/panic.go:458 +0x243
go/internal/gcimporter.(*importer).declare(0xc420080600, 0x7da1e0, 0xc4203093b0)
    /usr/src/go/src/go/internal/gcimporter/bimport.go:173 +0x17c
go/internal/gcimporter.(*importer).obj(0xc420080600, 0xfffffffffffffffc)
    /usr/src/go/src/go/internal/gcimporter/bimport.go:193 +0x1af
go/internal/gcimporter.BImportData(0xc4200170b0, 0xc4202b8000, 0x3a22f, 0x3fe00, 0xc42014c927, 0x4, 0x0, 0x4, 0xc42026c0f0, 0xc4202470b8)
    /usr/src/go/src/go/internal/gcimporter/bimport.go:86 +0x34c
go/internal/gcimporter.Import(0xc4200170b0, 0xc42014c927, 0x4, 0x7ffff9fc02be, 0xe, 0xc42018e0a0, 0x0, 0x0)
    /usr/src/go/src/go/internal/gcimporter/gcimporter.go:166 +0x551
go/importer.gcimports.ImportFrom(0xc4200170b0, 0xc42014c927, 0x4, 0x7ffff9fc02be, 0xe, 0x0, 0xc420151360, 0x0, 0x0)
    /usr/src/go/src/go/importer/importer.go:70 +0x67
go/types.(*Checker).collectObjects(0xc4200a81c0)
    /usr/src/go/src/go/types/resolver.go:191 +0x81d
go/types.(*Checker).checkFiles(0xc4200a81c0, 0xc420159680, 0x3, 0x4, 0x0, 0x0)
    /usr/src/go/src/go/types/check.go:225 +0xaa
go/types.(*Checker).Files(0xc4200a81c0, 0xc420159680, 0x3, 0x4, 0xc420156fc0, 0xc4200bb960)
    /usr/src/go/src/go/types/check.go:218 +0x49
go/types.(*Config).Check(0xc42015c8c0, 0xc42000f970, 0x5, 0xc42000ba80, 0xc420159680, 0x3, 0x4, 0xc420150d20, 0x7f447be22000, 0x0, ...)
    /usr/src/go/src/go/types/api.go:344 +0x19f
main.(*Package).check(0xc420012900, 0xc42000ba80, 0xc420159680, 0x3, 0x4, 0xc4201596a0, 0x2)
    /usr/src/go/src/cmd/vet/types.go:76 +0x36c
main.doPackage(0x6b905c, 0x1, 0xc42000a350, 0x3, 0x3, 0x0)
    /usr/src/go/src/cmd/vet/main.go:333 +0x992
main.main()
    /usr/src/go/src/cmd/vet/main.go:241 +0x335
exit status 2
internal/seatgeek/seatgeek.go:170: Println call ends with newline
exit status 1
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


goroutine 1 [running]:
panic(0x660b20, 0xc4203200c0)
    /usr/src/go/src/runtime/panic.go:500 +0x1a1
go/types.(*Checker).handleBailout(0xc4200a81c0, 0xc4202558d8)
    /usr/src/go/src/go/types/check.go:213 +0xae
panic(0x660b20, 0xc4203200c0)
    /usr/src/go/src/runtime/panic.go:458 +0x243
go/internal/gcimporter.(*importer).declare(0xc42007e6c0, 0x7da1e0, 0xc42031ec30)
    /usr/src/go/src/go/internal/gcimporter/bimport.go:173 +0x17c
go/internal/gcimporter.(*importer).obj(0xc42007e6c0, 0xfffffffffffffffc)
    /usr/src/go/src/go/internal/gcimporter/bimport.go:193 +0x1af
go/internal/gcimporter.BImportData(0xc4200150b0, 0xc4202d2000, 0x3a22f, 0x3fe00, 0xc420160097, 0x4, 0x0, 0x4, 0xc42027e840, 0xc4202550b8)
    /usr/src/go/src/go/internal/gcimporter/bimport.go:86 +0x34c
go/internal/gcimporter.Import(0xc4200150b0, 0xc420160097, 0x4, 0x7ffca8d7b28d, 0x13, 0xc420193180, 0x0, 0x0)
    /usr/src/go/src/go/internal/gcimporter/gcimporter.go:166 +0x551
go/importer.gcimports.ImportFrom(0xc4200150b0, 0xc420160097, 0x4, 0x7ffca8d7b28d, 0x13, 0x0, 0xc42016a550, 0x0, 0x0)
    /usr/src/go/src/go/importer/importer.go:70 +0x67
go/types.(*Checker).collectObjects(0xc4200a81c0)
    /usr/src/go/src/go/types/resolver.go:191 +0x81d
go/types.(*Checker).checkFiles(0xc4200a81c0, 0xc42015f420, 0x4, 0x4, 0x0, 0x0)
    /usr/src/go/src/go/types/check.go:225 +0xaa
go/types.(*Checker).Files(0xc4200a81c0, 0xc42015f420, 0x4, 0x4, 0xc420166c60, 0xc4200bb960)
    /usr/src/go/src/go/types/check.go:218 +0x49
go/types.(*Config).Check(0xc420168bc0, 0xc42000f970, 0xa, 0xc420017a00, 0xc42015f420, 0x4, 0x4, 0xc42016a000, 0x7f2d3f794000, 0x0, ...)
    /usr/src/go/src/go/types/api.go:344 +0x19f
main.(*Package).check(0xc420012960, 0xc420017a00, 0xc42015f420, 0x4, 0x4, 0x0, 0xc420095600)
    /usr/src/go/src/cmd/vet/types.go:76 +0x36c
main.doPackage(0x6b905c, 0x1, 0xc42000a1a0, 0x4, 0x4, 0x0)
    /usr/src/go/src/cmd/vet/main.go:333 +0x992
main.main()
    /usr/src/go/src/cmd/vet/main.go:241 +0x335
exit status 2
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


goroutine 1 [running]:
panic(0x660b20, 0xc42039b140)
    /usr/src/go/src/runtime/panic.go:500 +0x1a1
go/types.(*Checker).handleBailout(0xc4200bc1c0, 0xc42027d8d8)
    /usr/src/go/src/go/types/check.go:213 +0xae
panic(0x660b20, 0xc42039b140)
    /usr/src/go/src/runtime/panic.go:458 +0x243
go/internal/gcimporter.(*importer).declare(0xc420094840, 0x7da1e0, 0xc42042a230)
    /usr/src/go/src/go/internal/gcimporter/bimport.go:173 +0x17c
go/internal/gcimporter.(*importer).obj(0xc420094840, 0xfffffffffffffffc)
    /usr/src/go/src/go/internal/gcimporter/bimport.go:193 +0x1af
go/internal/gcimporter.BImportData(0xc4200170b0, 0xc4203e2000, 0x3a22f, 0x3fe00, 0xc420160b47, 0x4, 0x0, 0x4, 0x0, 0x0)
    /usr/src/go/src/go/internal/gcimporter/bimport.go:86 +0x34c
go/internal/gcimporter.Import(0xc4200170b0, 0xc420160b47, 0x4, 0x7ffcda31a2aa, 0x13, 0xc420188c80, 0x0, 0x0)
    /usr/src/go/src/go/internal/gcimporter/gcimporter.go:166 +0x551
go/importer.gcimports.ImportFrom(0xc4200170b0, 0xc420160b47, 0x4, 0x7ffcda31a2aa, 0x13, 0x0, 0xc420188b40, 0x0, 0x0)
    /usr/src/go/src/go/importer/importer.go:70 +0x67
go/types.(*Checker).collectObjects(0xc4200bc1c0)
    /usr/src/go/src/go/types/resolver.go:191 +0x81d
go/types.(*Checker).checkFiles(0xc4200bc1c0, 0xc420184ba0, 0x3, 0x4, 0x0, 0x0)
    /usr/src/go/src/go/types/check.go:225 +0xaa
go/types.(*Checker).Files(0xc4200bc1c0, 0xc420184ba0, 0x3, 0x4, 0xc420180c90, 0xc4200cf960)
    /usr/src/go/src/go/types/check.go:218 +0x49
go/types.(*Config).Check(0xc420186580, 0xc42000f970, 0xa, 0xc42000ba80, 0xc420184ba0, 0x3, 0x4, 0xc420188190, 0x7f1e3d0ab000, 0x0, ...)
    /usr/src/go/src/go/types/api.go:344 +0x19f
main.(*Package).check(0xc420012e40, 0xc42000ba80, 0xc420184ba0, 0x3, 0x4, 0xc420184bc0, 0x2)
    /usr/src/go/src/cmd/vet/types.go:76 +0x36c
main.doPackage(0x6b905c, 0x1, 0xc42000a350, 0x3, 0x3, 0x0)
    /usr/src/go/src/cmd/vet/main.go:333 +0x992
main.main()
    /usr/src/go/src/cmd/vet/main.go:241 +0x335
exit status 2
server/legacy.go:47: possible formatting directive in Println call
server/restore.go:36: possible formatting directive in Println call
exit status 1
@OneOfOne
Copy link
Contributor Author

Note that go too vet . works as intended.

@adg
Copy link
Contributor

adg commented Jun 10, 2016

@OneOfOne can you share the package source code that triggers the panic?

@robpike
Copy link
Contributor

robpike commented Jun 10, 2016

More specifically, can you please reduce this to a simple, non-proprietary example that isolates the problem?

@OneOfOne
Copy link
Contributor Author

I'll try, but I'm not even sure which file is causing it, mainly because we don't have anything with those imports.

@OneOfOne
Copy link
Contributor Author

I tried to isolate it as much as possible but I can't make a reproducible case.

I hunted down the internal packages causing it (2 of them) but there's nothing weird in them, go 1.6's vet works as expected, golint doesn't say anything weird.

I'll look more into it after work today.

@griesemer
Copy link
Contributor

@OneOfOne This may be due to installed packages compiled by different versions of the compiler - we had this bug in the past and I've fixed it (at least the instance we've seen so far). Can you reproduce it? If so, can you try to re-compile everything with the latest compiler (1.7 beta) and see if you can still reproduce it? Thanks.

@griesemer griesemer added this to the Go1.7 milestone Jun 10, 2016
@griesemer griesemer added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 10, 2016
@OneOfOne
Copy link
Contributor Author

@griesemer I coulda swore I nuked /pkg/ before I tested but I was wrong, it works now, I'll close this.

@lestrrat
Copy link

I just got bit by this. Just like the OP, I have no clue why this is or where, but it definitely happens in my workspace, when I was working on peco/peco@c74a783

I'm using go version devel +3c6b668 Thu Jun 2 00:22:03 2016 +0000 darwin/amd64, and yes, I probably have lots of outdated installed packages.

go tool vet .
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


goroutine 1 [running]:
panic(0x25f720, 0xc420334850)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/runtime/panic.go:500 +0x1a1
go/types.(*Checker).handleBailout(0xc4200b61c0, 0xc4203e7580)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/go/types/check.go:213 +0xae
panic(0x25f720, 0xc420334850)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/runtime/panic.go:458 +0x243
go/internal/gcimporter.(*importer).declare(0xc42047a180, 0x3da1c0, 0xc42032fe50)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/go/internal/gcimporter/bimport.go:173 +0x17c
go/internal/gcimporter.(*importer).obj(0xc42047a180, 0xfffffffffffffffc)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/go/internal/gcimporter/bimport.go:193 +0x1af
go/internal/gcimporter.BImportData(0xc420014f00, 0xc420482000, 0x3a232, 0x3fe00, 0xc4201ec817, 0x4, 0x0, 0x4, 0x0, 0x0)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/go/internal/gcimporter/bimport.go:86 +0x34c
go/internal/gcimporter.Import(0xc420014f00, 0xc4201ec817, 0x4, 0x2b769c, 0x1, 0xc4203a1c70, 0x0, 0x0)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/go/internal/gcimporter/gcimporter.go:166 +0x551
go/importer.gcimports.ImportFrom(0xc420014f00, 0xc4201ec817, 0x4, 0x2b769c, 0x1, 0x0, 0xc420436aa0, 0x0, 0x0)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/go/importer/importer.go:70 +0x67
go/types.(*Checker).collectObjects(0xc4200b61c0)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/go/types/resolver.go:191 +0x81d
go/types.(*Checker).checkFiles(0xc4200b61c0, 0xc420326d00, 0x1d, 0x20, 0x0, 0x0)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/go/types/check.go:225 +0xaa
go/types.(*Checker).Files(0xc4200b61c0, 0xc420326d00, 0x1d, 0x20, 0xc4203aa990, 0xc4200c9608)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/go/types/check.go:218 +0x49
go/types.(*Config).Check(0xc4203acc80, 0xc420161e70, 0x4, 0xc42016b700, 0xc420326d00, 0x1d, 0x20, 0xc4203a0cd0, 0x460000, 0x0, ...)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/go/types/api.go:344 +0x19f
main.(*Package).check(0xc420203500, 0xc42016b700, 0xc420326d00, 0x1d, 0x20, 0x0, 0xc4203b2000)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/cmd/vet/types.go:76 +0x36c
main.doPackage(0x7fff5fbff695, 0x1, 0xc42000d080, 0x1d, 0x2c, 0x0)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/cmd/vet/main.go:333 +0x992
main.doPackageDir(0x7fff5fbff695, 0x1)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/cmd/vet/main.go:281 +0x5fd
main.visit(0x7fff5fbff695, 0x1, 0x3d9280, 0xc4201595f0, 0x0, 0x0, 0x0, 0x0)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/cmd/vet/main.go:367 +0xf3
path/filepath.walk(0x7fff5fbff695, 0x1, 0x3d9280, 0xc4201595f0, 0x2de5a0, 0x0, 0xc420159520)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/path/filepath/path.go:349 +0x81
path/filepath.Walk(0x7fff5fbff695, 0x1, 0x2de5a0, 0xc, 0xc420159520)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/path/filepath/path.go:396 +0xd5
main.walkDir(0x7fff5fbff695, 0x1)
    /Users/daisuke/.gvm/gos/go1.7beta1/src/cmd/vet/main.go:382 +0x41
main.main()
    /Users/daisuke/.gvm/gos/go1.7beta1/src/cmd/vet/main.go:237 +0x2c4

@griesemer
Copy link
Contributor

@lestrrat As you say yourself, you appear to have outdated packages. Make sure they are compiled with the latest compiler and see if the problem persists. If it does, please open a new issue with detailed instructions how to recreate the issue. Thanks.

@lestrrat
Copy link

lestrrat commented Jun 16, 2016

okay, that works for me. thanks.

I will check it out later when I get to work. If it's being caused by outdated installed packages and deleting them causes this issue to go away, it's working as intended, yes?

(Update: yep, nuking my $GOPATH/pkg did the trick)

@griesemer
Copy link
Contributor

@lestrrat Yes. A prior version used to have a bug in the new exporter/importer (the compiler's phases which write and read a package's exported interface). That bug has been fixed a while back, but it you have installed packages that were built using the buggy version, you run into this problem).

@mikioh mikioh changed the title go/vet: inconsistent import cmd/vet: inconsistent import Jun 17, 2016
@golang golang locked and limited conversation to collaborators Jun 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants