nsf / gocode

An autocompletion daemon for the Go programming language
MIT License
5.01k stars 658 forks source link

GoCode vim plugin PANICs #198

Closed weberc2 closed 10 years ago

weberc2 commented 10 years ago

The vim plugin is causing gocode to panic when I try to in this file:

package main

import (
    "github.com/conformal/gotk3/gtk"
)

func main() {
}

If I remove the gtk import, all is well. Why is an import breaking gocode?

And the error:

gocode -s -sock unix -addr localhost:37373
panic: unexpected token: "?"
1(runtime.panic): /usr/local/go/src/pkg/runtime/panic.c:229
2(main.(*gc_parser).error): /home/someone/Projects/src/github.com/nsf/gocode/package.go:260
3(main.(*gc_parser).errorf): /home/someone/Projects/src/github.com/nsf/gocode/package.go:264
4(main.(*gc_parser).parse_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:638
5(main.(*gc_parser).parse_field): /home/someone/Projects/src/github.com/nsf/gocode/package.go:382
6(main.func·016): /home/someone/Projects/src/github.com/nsf/gocode/package.go:528
7(main.(*gc_parser).parse_struct_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:535
8(main.(*gc_parser).parse_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:608
9(main.(*gc_parser).parse_type_decl): /home/someone/Projects/src/github.com/nsf/gocode/package.go:718
10(main.(*gc_parser).parse_decl): /home/someone/Projects/src/github.com/nsf/gocode/package.go:827
11(main.(*gc_parser).parse_export): /home/someone/Projects/src/github.com/nsf/gocode/package.go:854
12(main.(*package_file_cache).process_package_data): /home/someone/Projects/src/github.com/nsf/gocode/package.go:133
13(main.(*package_file_cache).update_cache): /home/someone/Projects/src/github.com/nsf/gocode/package.go:91
14(main.func·002): /home/someone/Projects/src/github.com/nsf/gocode/autocompletecontext.go:325
15(runtime.goexit): /usr/local/go/src/pkg/runtime/proc.c:1223

panic: One of the package cache updaters panicked
1(runtime.panic): /usr/local/go/src/pkg/runtime/panic.c:229
2(main.update_packages): /home/someone/Projects/src/github.com/nsf/gocode/autocompletecontext.go:333
3(main.(*auto_complete_context).update_caches): /home/someone/Projects/src/github.com/nsf/gocode/autocompletecontext.go:165
4(main.(*auto_complete_context).apropos): /home/someone/Projects/src/github.com/nsf/gocode/autocompletecontext.go:246
5(main.server_auto_complete): /home/someone/Projects/src/github.com/nsf/gocode/server.go:128
6(main.(*RPC).RPC_auto_complete): /home/someone/Projects/src/github.com/nsf/gocode/rpc.go:26
7(reflect.Value.call): /usr/local/go/src/pkg/reflect/value.go:474
8(reflect.Value.Call): /usr/local/go/src/pkg/reflect/value.go:345
9(net/rpc.(*service).call): /usr/local/go/src/pkg/net/rpc/server.go:379
10(runtime.goexit): /usr/local/go/src/pkg/runtime/proc.c:1223

panic: unexpected token: "?"
1(runtime.panic): /usr/local/go/src/pkg/runtime/panic.c:229
2(main.(*gc_parser).error): /home/someone/Projects/src/github.com/nsf/gocode/package.go:260
3(main.(*gc_parser).errorf): /home/someone/Projects/src/github.com/nsf/gocode/package.go:264
4(main.(*gc_parser).parse_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:638
5(main.(*gc_parser).parse_field): /home/someone/Projects/src/github.com/nsf/gocode/package.go:382
6(main.func·016): /home/someone/Projects/src/github.com/nsf/gocode/package.go:528
7(main.(*gc_parser).parse_struct_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:535
8(main.(*gc_parser).parse_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:608
9(main.(*gc_parser).parse_type_decl): /home/someone/Projects/src/github.com/nsf/gocode/package.go:718
10(main.(*gc_parser).parse_decl): /home/someone/Projects/src/github.com/nsf/gocode/package.go:827
11(main.(*gc_parser).parse_export): /home/someone/Projects/src/github.com/nsf/gocode/package.go:854
12(main.(*package_file_cache).process_package_data): /home/someone/Projects/src/github.com/nsf/gocode/package.go:133
13(main.(*package_file_cache).update_cache): /home/someone/Projects/src/github.com/nsf/gocode/package.go:91
14(main.func·002): /home/someone/Projects/src/github.com/nsf/gocode/autocompletecontext.go:325
15(runtime.goexit): /usr/local/go/src/pkg/runtime/proc.c:1223

panic: unexpected token: "?"
1(runtime.panic): /usr/local/go/src/pkg/runtime/panic.c:229
2(main.(*gc_parser).error): /home/someone/Projects/src/github.com/nsf/gocode/package.go:260
3(main.(*gc_parser).errorf): /home/someone/Projects/src/github.com/nsf/gocode/package.go:264
4(main.(*gc_parser).parse_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:638
5(main.(*gc_parser).parse_field): /home/someone/Projects/src/github.com/nsf/gocode/package.go:382
6(main.func·016): /home/someone/Projects/src/github.com/nsf/gocode/package.go:528
7(main.(*gc_parser).parse_struct_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:538
8(main.(*gc_parser).parse_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:608
9(main.(*gc_parser).parse_type_decl): /home/someone/Projects/src/github.com/nsf/gocode/package.go:718
10(main.(*gc_parser).parse_decl): /home/someone/Projects/src/github.com/nsf/gocode/package.go:827
11(main.(*gc_parser).parse_export): /home/someone/Projects/src/github.com/nsf/gocode/package.go:854
12(main.(*package_file_cache).process_package_data): /home/someone/Projects/src/github.com/nsf/gocode/package.go:133
13(main.(*package_file_cache).update_cache): /home/someone/Projects/src/github.com/nsf/gocode/package.go:91
14(main.func·002): /home/someone/Projects/src/github.com/nsf/gocode/autocompletecontext.go:325
15(runtime.goexit): /usr/local/go/src/pkg/runtime/proc.c:1223

panic: unexpected token: "?"
1(runtime.panic): /usr/local/go/src/pkg/runtime/panic.c:229
2(main.(*gc_parser).error): /home/someone/Projects/src/github.com/nsf/gocode/package.go:260
3(main.(*gc_parser).errorf): /home/someone/Projects/src/github.com/nsf/gocode/package.go:264
4(main.(*gc_parser).parse_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:638
5(main.(*gc_parser).parse_field): /home/someone/Projects/src/github.com/nsf/gocode/package.go:382
6(main.func·016): /home/someone/Projects/src/github.com/nsf/gocode/package.go:528
7(main.(*gc_parser).parse_struct_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:538
8(main.(*gc_parser).parse_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:608
9(main.(*gc_parser).parse_type_decl): /home/someone/Projects/src/github.com/nsf/gocode/package.go:718
10(main.(*gc_parser).parse_decl): /home/someone/Projects/src/github.com/nsf/gocode/package.go:827
11(main.(*gc_parser).parse_export): /home/someone/Projects/src/github.com/nsf/gocode/package.go:854
12(main.(*package_file_cache).process_package_data): /home/someone/Projects/src/github.com/nsf/gocode/package.go:133
13(main.(*package_file_cache).update_cache): /home/someone/Projects/src/github.com/nsf/gocode/package.go:91
14(main.func·002): /home/someone/Projects/src/github.com/nsf/gocode/autocompletecontext.go:325
15(runtime.goexit): /usr/local/go/src/pkg/runtime/proc.c:1223

panic: unexpected token: "?"
1(runtime.panic): /usr/local/go/src/pkg/runtime/panic.c:229
2(main.(*gc_parser).error): /home/someone/Projects/src/github.com/nsf/gocode/package.go:260
3(main.(*gc_parser).errorf): /home/someone/Projects/src/github.com/nsf/gocode/package.go:264
4(main.(*gc_parser).parse_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:638
5(main.(*gc_parser).parse_field): /home/someone/Projects/src/github.com/nsf/gocode/package.go:382
6(main.func·016): /home/someone/Projects/src/github.com/nsf/gocode/package.go:528
7(main.(*gc_parser).parse_struct_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:538
8(main.(*gc_parser).parse_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:608
9(main.(*gc_parser).parse_type_decl): /home/someone/Projects/src/github.com/nsf/gocode/package.go:718
10(main.(*gc_parser).parse_decl): /home/someone/Projects/src/github.com/nsf/gocode/package.go:827
11(main.(*gc_parser).parse_export): /home/someone/Projects/src/github.com/nsf/gocode/package.go:854
12(main.(*package_file_cache).process_package_data): /home/someone/Projects/src/github.com/nsf/gocode/package.go:133
13(main.(*package_file_cache).update_cache): /home/someone/Projects/src/github.com/nsf/gocode/package.go:91
14(main.func·002): /home/someone/Projects/src/github.com/nsf/gocode/autocompletecontext.go:325
15(runtime.goexit): /usr/local/go/src/pkg/runtime/proc.c:1223

panic: unexpected token: "?"
1(runtime.panic): /usr/local/go/src/pkg/runtime/panic.c:229
2(main.(*gc_parser).error): /home/someone/Projects/src/github.com/nsf/gocode/package.go:260
3(main.(*gc_parser).errorf): /home/someone/Projects/src/github.com/nsf/gocode/package.go:264
4(main.(*gc_parser).parse_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:638
5(main.(*gc_parser).parse_field): /home/someone/Projects/src/github.com/nsf/gocode/package.go:382
6(main.func·016): /home/someone/Projects/src/github.com/nsf/gocode/package.go:528
7(main.(*gc_parser).parse_struct_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:535
8(main.(*gc_parser).parse_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:608
9(main.(*gc_parser).parse_type_decl): /home/someone/Projects/src/github.com/nsf/gocode/package.go:718
10(main.(*gc_parser).parse_decl): /home/someone/Projects/src/github.com/nsf/gocode/package.go:827
11(main.(*gc_parser).parse_export): /home/someone/Projects/src/github.com/nsf/gocode/package.go:854
12(main.(*package_file_cache).process_package_data): /home/someone/Projects/src/github.com/nsf/gocode/package.go:133
13(main.(*package_file_cache).update_cache): /home/someone/Projects/src/github.com/nsf/gocode/package.go:91
14(main.func·002): /home/someone/Projects/src/github.com/nsf/gocode/autocompletecontext.go:325
15(runtime.goexit): /usr/local/go/src/pkg/runtime/proc.c:1223

panic: unexpected token: "?"
1(runtime.panic): /usr/local/go/src/pkg/runtime/panic.c:229
2(main.(*gc_parser).error): /home/someone/Projects/src/github.com/nsf/gocode/package.go:260
3(main.(*gc_parser).errorf): /home/someone/Projects/src/github.com/nsf/gocode/package.go:264
4(main.(*gc_parser).parse_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:638
5(main.(*gc_parser).parse_field): /home/someone/Projects/src/github.com/nsf/gocode/package.go:382
6(main.func·016): /home/someone/Projects/src/github.com/nsf/gocode/package.go:528
7(main.(*gc_parser).parse_struct_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:535
8(main.(*gc_parser).parse_type): /home/someone/Projects/src/github.com/nsf/gocode/package.go:608
9(main.(*gc_parser).parse_type_decl): /home/someone/Projects/src/github.com/nsf/gocode/package.go:718
10(main.(*gc_parser).parse_decl): /home/someone/Projects/src/github.com/nsf/gocode/package.go:827
11(main.(*gc_parser).parse_export): /home/someone/Projects/src/github.com/nsf/gocode/package.go:854
12(main.(*package_file_cache).process_package_data): /home/someone/Projects/src/github.com/nsf/gocode/package.go:133
13(main.(*package_file_cache).update_cache): /home/someone/Projects/src/github.com/nsf/gocode/package.go:91
14(main.func·002): /home/someone/Projects/src/github.com/nsf/gocode/autocompletecontext.go:325
15(runtime.goexit): /usr/local/go/src/pkg/runtime/proc.c:1223
nsf commented 10 years ago

Looks a lot like this issue: https://github.com/nsf/gocode/issues/163 Seems like you're using an old gocode version somehow.

weberc2 commented 10 years ago

I just pulled, update.sh, and rebooted before hand. That should work, right? On Mar 9, 2014 7:07 PM, "nsf" notifications@github.com wrote:

Looks a lot like this issue: #163https://github.com/nsf/gocode/issues/163 Seems like you're using an old gocode version somehow.

Reply to this email directly or view it on GitHubhttps://github.com/nsf/gocode/issues/198#issuecomment-37144811 .

nsf commented 10 years ago

go get -u github.com/nsf/gocode then update.sh then gocode close

then it should work if there are no other gocode binaries in the way

weberc2 commented 10 years ago

Okay, this worked. I'm not sure why gocode close worked and rebooting didn't. I must have made a mistake. Anyway, thanks.