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

go/internal/gcimporter: index out of range panic importing runtime #16879

Closed
josharian opened this issue Aug 25, 2016 · 4 comments
Closed

go/internal/gcimporter: index out of range panic importing runtime #16879

josharian opened this issue Aug 25, 2016 · 4 comments
Milestone

Comments

@josharian
Copy link
Contributor

Using commit e71e1fe:

$ ./make.bash
$ GOOS=linux GOARCH=arm go tool vet -asmdecl ./runtime

Result (after a bunch of vet complaints):

panic: runtime error: index out of range [recovered]
    panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x282500, 0xc42000e160)
    /Users/josh/go/tip/src/runtime/panic.go:500 +0x1a0
go/types.(*Checker).handleBailout(0xc4200da2a0, 0xc42231b578)
    /Users/josh/go/tip/src/go/types/check.go:213 +0xae
panic(0x282500, 0xc42000e160)
    /Users/josh/go/tip/src/runtime/panic.go:458 +0x241
go/internal/gcimporter.(*importer).pkg(0xc42199c480, 0x1)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:134 +0x83
go/internal/gcimporter.(*importer).fieldName(0xc42199c480, 0xc422a89d10, 0x3e59c0, 0x3f88e0, 0xc422318590)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:505 +0xc4
go/internal/gcimporter.(*importer).field(0xc42199c480, 0xc422a89d10, 0x0)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:454 +0x5e
go/internal/gcimporter.(*importer).fieldList(0xc42199c480, 0xc422a89d10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:445 +0xed
go/internal/gcimporter.(*importer).typ(0xc42199c480, 0xc422a89d10, 0xc422e92e10, 0x0)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:358 +0xf83
go/internal/gcimporter.(*importer).typ(0xc42199c480, 0x0, 0xc422318c10, 0x2019db)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:297 +0x24e
go/internal/gcimporter.(*importer).typ(0xc42199c480, 0x0, 0xc42199c480, 0x46f000)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:367 +0x1e91
go/internal/gcimporter.(*importer).param(0xc42199c480, 0x0, 0x1, 0xc420d820d0)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:531 +0x49
go/internal/gcimporter.(*importer).paramList(0xc42199c480, 0x0, 0x0)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:525 +0xb2
go/internal/gcimporter.(*importer).typ(0xc42199c480, 0xc422a89d10, 0x480, 0xc4223192f0)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:315 +0x36b
go/internal/gcimporter.(*importer).typ(0xc42199c480, 0xc422a89d10, 0xc422a89d10, 0xc422a86a60)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:367 +0x1e91
go/internal/gcimporter.(*importer).field(0xc42199c480, 0xc422a89d10, 0x0)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:455 +0x9a
go/internal/gcimporter.(*importer).fieldList(0xc42199c480, 0xc422a89d10, 0x201900, 0x0, 0x0, 0x0, 0x0, 0x0)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:445 +0xed
go/internal/gcimporter.(*importer).typ(0xc42199c480, 0xc422a89d10, 0xc422e92bd0, 0x0)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:358 +0xf83
go/internal/gcimporter.(*importer).typ(0xc42199c480, 0xc422a89d10, 0x3, 0xc422e92930)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:297 +0x24e
go/internal/gcimporter.(*importer).typ(0xc42199c480, 0xc422a89d10, 0x0, 0x0)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:340 +0xd73
go/internal/gcimporter.(*importer).typ(0xc42199c480, 0xc422a89d10, 0xc422a89d10, 0xc422a86a30)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:367 +0x1e91
go/internal/gcimporter.(*importer).field(0xc42199c480, 0xc422a89d10, 0x0)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:455 +0x9a
go/internal/gcimporter.(*importer).fieldList(0xc42199c480, 0xc422a89d10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:445 +0xed
go/internal/gcimporter.(*importer).typ(0xc42199c480, 0xc422a89d10, 0xc422e92b40, 0x0)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:358 +0xf83
go/internal/gcimporter.(*importer).typ(0xc42199c480, 0x0, 0x20d4aa, 0xc42199c480)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:297 +0x24e
go/internal/gcimporter.(*importer).obj(0xc42199c480, 0xfffffffffffffffd)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:197 +0x753
go/internal/gcimporter.BImportData(0xc420086d20, 0xc422c90000, 0x180f20, 0x1ffe00, 0xc420f5e411, 0x7, 0x0, 0x7, 0x8, 0x0)
    /Users/josh/go/tip/src/go/internal/gcimporter/bimport.go:96 +0x359
go/internal/gcimporter.Import(0xc420086d20, 0xc420f5e411, 0x7, 0xc4213050a0, 0x7, 0x0, 0x0, 0x0)
    /Users/josh/go/tip/src/go/internal/gcimporter/gcimporter.go:126 +0x559
go/importer.gcimports.ImportFrom(0xc420086d20, 0xc420f5e411, 0x7, 0xc4213050a0, 0x7, 0x0, 0x1, 0x2, 0x0)
    /Users/josh/go/tip/src/go/importer/importer.go:70 +0x67
go/types.(*Checker).collectObjects(0xc4200da2a0)
    /Users/josh/go/tip/src/go/types/resolver.go:196 +0x825
go/types.(*Checker).checkFiles(0xc4200da2a0, 0xc4229a0400, 0x24, 0x40, 0x0, 0x0)
    /Users/josh/go/tip/src/go/types/check.go:225 +0xaa
go/types.(*Checker).Files(0xc4200da2a0, 0xc4229a0400, 0x24, 0x40, 0xc4229e23f0, 0xc42231b5f0)
    /Users/josh/go/tip/src/go/types/check.go:218 +0x49
go/types.(*Config).Check(0xc420f7c7c0, 0xc4212a45d0, 0xc, 0xc421037bc0, 0xc4229a0400, 0x24, 0x40, 0xc4229e60a0, 0x401, 0xc4200001a0, ...)
    /Users/josh/go/tip/src/go/types/api.go:344 +0x1a3
main.(*Package).check(0xc4227d9f80, 0xc421037bc0, 0xc4229a0400, 0x24, 0x40, 0x0, 0xc422997500)
    /Users/josh/go/tip/src/cmd/vet/types.go:76 +0x36e
main.doPackage(0x7fff5fbff9c6, 0x9, 0xc42031cc00, 0x24, 0x40, 0xc42042d0e0, 0xc42042d0e0)
    /Users/josh/go/tip/src/cmd/vet/main.go:336 +0x996
main.doPackageDir(0x7fff5fbff9c6, 0x9)
    /Users/josh/go/tip/src/cmd/vet/main.go:289 +0x6cd
main.visit(0x7fff5fbff9c6, 0x9, 0x3e8440, 0xc4200896c0, 0x0, 0x0, 0x0, 0x0)
    /Users/josh/go/tip/src/cmd/vet/main.go:371 +0xf3
path/filepath.walk(0x7fff5fbff9c6, 0x9, 0x3e8440, 0xc4200896c0, 0x2eec68, 0x0, 0xc4200895f0)
    /Users/josh/go/tip/src/path/filepath/path.go:351 +0x81
path/filepath.Walk(0x7fff5fbff9c6, 0x9, 0x2eec68, 0xc, 0xc4200895f0)
    /Users/josh/go/tip/src/path/filepath/path.go:398 +0xd5
main.walkDir(0x7fff5fbff9c6, 0x9)
    /Users/josh/go/tip/src/cmd/vet/main.go:386 +0x41
main.main()
    /Users/josh/go/tip/src/cmd/vet/main.go:240 +0x2cb

@griesemer @mdempsky

@josharian josharian added this to the Go1.8 milestone Aug 25, 2016
@griesemer griesemer self-assigned this Aug 25, 2016
@griesemer
Copy link
Contributor

@josharian You probably have package files that were built with a prior version of the compiler.

That said, I think I need to be more cautious with internal format changes even during development. I will refine the internal version numbering so I can evolve the format w/o constantly breaking importers.

I think if you rebuild everything, the issue should go away. If it doesn't please update this issue. Thanks.

@josharian
Copy link
Contributor Author

I ran make.bash; that should rebuild everything, no? If not, what should I run?

@josharian
Copy link
Contributor Author

Oh never mind. I ran make.bash, but I needed to also run GOOS=linux GOARCH=arm go install std.

Can we make gcimporter detect old versions, request a re-install, and then bail? This problem comes up over and over again on the issue tracker, and even trips up old hands like me. :) I'll file a separate issue for that. Closing this one as user error.

@griesemer
Copy link
Contributor

Yes, I added version handling in the export data just recently, but I didn't bump the number because I assumed that people working off tip rebuild everything when they update. It's also a bit more complicated than just bumping the number because we have x/tools/gcimporter15 which is used to handle legacy installed packages but must also handle newer ones. Looking into it.

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