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

Panics with unknown export format version -1 #521

Open
AudriusButkevicius opened this issue Jun 10, 2018 · 16 comments
Open

Panics with unknown export format version -1 #521

AudriusButkevicius opened this issue Jun 10, 2018 · 16 comments

Comments

@AudriusButkevicius
Copy link

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.

@divan
Copy link

divan commented Jun 28, 2018

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?

@divan
Copy link

divan commented Jun 28, 2018

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�
|SGOROOT�src��print.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��Write�b�n�err�Width�wid�ok	Precision�prec�Flag�c�Format�f�State�String�GoString�w�Wri

There is no version info and that's causing a crash.

@divan
Copy link

divan commented Jun 28, 2018

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

@AudriusButkevicius
Copy link
Author

Yeah I ran my own go 1.10+dev when I started seeing this.

@divan
Copy link

divan commented Jun 28, 2018

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.

@fd0
Copy link

fd0 commented Jul 21, 2018

Is it correct that until gcode understands the new format, it is broken for Go >= 1.11?

@fd0
Copy link

fd0 commented Jul 21, 2018

I've opened an issue over at mdempsky#43

@fd0
Copy link

fd0 commented Jul 21, 2018

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

@lukatendai
Copy link

I do not understand why this issue is closed... I am keep getting panic with go 1.11

@AudriusButkevicius
Copy link
Author

It's not closed

@lukatendai
Copy link

oh, yes... sorry

@seagle0128
Copy link

Same issue here, even with go-langserver. Not working with go 1.11.

@Xammie
Copy link

Xammie commented Aug 29, 2018

I'm having the same issue after upgrading to go 1.11

@rarchana2001asu
Copy link

Hi! Is there a workaround for this issue. I am seeing the same with go version go1.11 darwin/amd64

@nsf
Copy link
Owner

nsf commented Aug 31, 2018

Gocode is no longer maintained, you can try a fork, such as: https://github.com/mdempsky/gocode

@cnbuff410
Copy link

The fork at https://github.com/mdempsky/gocode fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants