gocode
gocode copied to clipboard
Panics with unknown export format version -1
panic: unknown export format version -1 ("i\x00\xe9\x03\xc6\x06\x18$GOROOT\\src\\fmt\\print.go\x00\x05Write\x01b\x01n\x03err\x05Width\x03wid\x02ok\tPrecision\x04prec\x04Flag\x01c\x06Format\x01f\x05State\x06String\bGoString\x01w\x06Writer\x02io\x06format\x01a\aesc:0x1\aesc:0x9\x17$GOROOT\\src\\fmt\\scan.go\bReadRune\x01r\x04size")
1(runtime.call32): C:/Go191/src/runtime/asm_amd64.s:509
2(runtime.gopanic): C:/Go191/src/runtime/panic.go:491
3(main.(*gc_bin_parser).parse_export): C:/Go/bin/src/github.com/nsf/gocode/package_bin.go:126
4(main.(*package_file_cache).process_package_data): C:/Go/bin/src/github.com/nsf/gocode/package.go:132
5(main.(*package_file_cache).update_cache): C:/Go/bin/src/github.com/nsf/gocode/package.go:92
6(main.update_packages.func1): C:/Go/bin/src/github.com/nsf/gocode/autocompletecontext.go:455
7(runtime.goexit): C:/Go191/src/runtime/asm_amd64.s:2337
Not sure what needs clearing/removing.
I'm getting this as well after switching to Go 1.11beta1. Switching back to Go 1.10 seems like has no effect. Maybe it's a coincidence, I don't know. I'm on latest MacOS X.
Also, I was using GOOS=js GOARCH=wasm for the build when I start getting those crashes, if it's related.
Any suggestions on how to debug this issue?
Another detail, that may be relevant: my Go 1.11 installation is a binary installation (I didn;t compile it myself).
Package files seems to have totally different encoding that crashes gocode
. I can't find docs or commits that explain the diff, though.
Here is an output of pkg files for fmt
for Go 1.10 and Go 1.11.
head -c 300 /usr/local/go1.10/pkg/darwin_amd64/fmt.a | less | pbcopy
!<arch>
__.PKGDEF 0 0 0 644 1384 `
go object darwin amd64 go1.10 X:framepointer
build id "KHuqXkHLVgkW_Ou5euoy/tdMow2Eq6Ax6uwLF86Xb"
----
build id "KHuqXkHLVgkW_Ou5euoy/tdMow2Eq6Ax6uwLF86Xb"
$$B
version 5
fmt
L
|SGOROOTsrcprint.go State Write"b
head -c 300 /usr/local/go1.11beta1/pkg/darwin_amd64/fmt.a | less | pbcopy
!<arch>
__.PKGDEF 0 0 0 644 1568 `
go object darwin amd64 go1.11beta1 X:framepointer
build id "NzYrUFEPyrRrj_uyqpl5/n8zsFBLs-yT__ncV8geh"
----
$$B
i È∆$GOROOT/src/fmt/print.go WritebnerrWidthwidok PrecisionprecFlagcFormatfStateStringGoStringwWri
There is no version info and that's causing a crash.
Okay, I found it, it's called indexed export format
and has been introduced recently: https://groups.google.com/forum/#!msg/golang-codereviews/6vqMfk1krNU/lzoJtkbuCQAJ
Some more info: https://groups.google.com/forum/#!topic/golang-dev/Lj_B-O6OMv8
Yeah I ran my own go 1.10+dev when I started seeing this.
So the proper solution would be to implement a parser for the indexed export format. I started to work on this, but it might take longer than by people who already worked with it. It actually requires a lot of copying and adapting from internal
packages of Go codebase.
Is it correct that until gcode understands the new format, it is broken for Go >= 1.11?
I've opened an issue over at https://github.com/mdempsky/gocode/issues/43
Hm, turns out my test case was wrong, it works for me with Go 1.11beta2 and mdempksy's fork at https://github.com/mdempsky/gocode
I do not understand why this issue is closed... I am keep getting panic with go 1.11
It's not closed
oh, yes... sorry
Same issue here, even with go-langserver
. Not working with go 1.11.
I'm having the same issue after upgrading to go 1.11
Hi! Is there a workaround for this issue. I am seeing the same with go version go1.11 darwin/amd64
Gocode is no longer maintained, you can try a fork, such as: https://github.com/mdempsky/gocode
The fork at https://github.com/mdempsky/gocode fixes this issue.