gocode icon indicating copy to clipboard operation
gocode copied to clipboard

PANIC!!!

Open quchunguang opened this issue 7 years ago • 7 comments

I using sublime text and atom writing go code. Both of them get "PANIC PANIC" message any time i press '.' ! I removed them clearly and reinstall the newest version of gocode and sublime-text / atom with its packages but still not work.

OS: Lubuntu 16.04

go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/qcg/share/g"
GORACE=""
GOROOT="/home/qcg/share/go"
GOTOOLDIR="/home/qcg/share/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build054086172=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

quchunguang avatar Oct 23 '16 11:10 quchunguang

Then look for other gocode binaries, it shouldn't panic really. Try running gocode in a separate terminal via: gocode close (to stop existing process) and gocode -s -debug. Paste here what it prints out on request.

nsf avatar Oct 23 '16 15:10 nsf

I'm seeing this as well when building gocode wiht Go 1.8rc3

panic: Can't find the package clause
1(runtime.panic): /Users/samuel/go/src/pkg/runtime/panic.c:248
2(main.(*package_file_cache).process_package_data): /Users/samuel/Dropbox/Code/go/src/github.com/nsf/gocode/package.go:108
3(main.(*package_file_cache).update_cache): /Users/samuel/Dropbox/Code/go/src/github.com/nsf/gocode/package.go:91
4(main.func·002): /Users/samuel/Dropbox/Code/go/src/github.com/nsf/gocode/autocompletecontext.go:325
5(runtime.goexit): /Users/samuel/go/src/pkg/runtime/proc.c:1396

panic: Can't find the package clause
1(runtime.panic): /Users/samuel/go/src/pkg/runtime/panic.c:248
2(main.(*package_file_cache).process_package_data): /Users/samuel/Dropbox/Code/go/src/github.com/nsf/gocode/package.go:108
3(main.(*package_file_cache).update_cache): /Users/samuel/Dropbox/Code/go/src/github.com/nsf/gocode/package.go:91
4(main.func·002): /Users/samuel/Dropbox/Code/go/src/github.com/nsf/gocode/autocompletecontext.go:325
5(runtime.goexit): /Users/samuel/go/src/pkg/runtime/proc.c:1396

panic: One of the package cache updaters panicked
1(runtime.panic): /Users/samuel/go/src/pkg/runtime/panic.c:248
2(main.update_packages): /Users/samuel/Dropbox/Code/go/src/github.com/nsf/gocode/autocompletecontext.go:333
3(main.(*auto_complete_context).update_caches): /Users/samuel/Dropbox/Code/go/src/github.com/nsf/gocode/autocompletecontext.go:165
4(main.(*auto_complete_context).apropos): /Users/samuel/Dropbox/Code/go/src/github.com/nsf/gocode/autocompletecontext.go:246
5(main.server_auto_complete): /Users/samuel/Dropbox/Code/go/src/github.com/nsf/gocode/server.go:128
6(main.(*RPC).RPC_auto_complete): /Users/samuel/Dropbox/Code/go/src/github.com/nsf/gocode/rpc.go:26
7(runtime.call64): /Users/samuel/go/src/pkg/runtime/asm_amd64.s:340
8(reflect.Value.call): /Users/samuel/go/src/pkg/reflect/value.go:474
9(reflect.Value.Call): /Users/samuel/go/src/pkg/reflect/value.go:345
10(net/rpc.(*service).call): /Users/samuel/go/src/pkg/net/rpc/server.go:381
11(runtime.goexit): /Users/samuel/go/src/pkg/runtime/proc.c:1396

samuel avatar Feb 03 '17 19:02 samuel

n/m, sorry for the noise. I had an older gocode binary in my path built with an older version of Go. The mismatch of versions I think was causing the panic I was seeing.

samuel avatar Feb 03 '17 19:02 samuel

I have this problem before, and i solved it by gocode on debug mode, i found there a invalid .a(compiled package) file in pkg/, gocode parse this file failed, so i delete this file and reinstall my project, gocode works fine. hope this will helpful.

ender-wan avatar Apr 17 '17 06:04 ender-wan

I had the same issue after upgrade to 1.8. Also solved by debug mode. Also because of some previously built file in pkg.

yookoala avatar Jun 05 '17 10:06 yookoala

With go1.11rc1:

panic: unknown export format version -1 ("i\x00\xa1\x1d\x80>\x18$GOROOT/src/flag/flag.go\x00\x06String\x03Set\x05Value\x03Get\rErrorHandling\x05Usage\x04name\x06parsed\x06actual\x04Flag\x06formal\x04args\rerrorHandling\x06output\x06Writer\x02io\x06Output\x01f\aFlagSet\x04Name\tSetOutput\bVisitAll\x02fn\x05Visit\x06Lookup\x05value\rPrintDefaults\fdefaultUsage\x05NFlag\x03Arg\x01i\x04NArg\x04Args\aBoolVar\x01p\x05usage\x04Bool\x06IntVar\x03Int\bInt64Var\x05Int64\aUintVar\x04Uint\tUint64Var\x06Uint64\tStringVar")

dim13 avatar Aug 14 '18 12:08 dim13

Getting the below error

panic: unknown export format version 1 1(runtime.gopanic): D:/Mohan/Softwares/Installed/Go/src/runtime/panic.go:969 2(main.(*gc_ibin_parser).parse_export): D:/GoPath/src/github.com/nsf/gocode/package_ibin.go:143 3(main.(*package_file_cache).process_package_data): D:/GoPath/src/github.com/nsf/gocode/package.go:138 4(main.(*package_file_cache).update_cache): D:/GoPath/src/github.com/nsf/gocode/package.go:92 5(main.update_packages.func1): D:/GoPath/src/github.com/nsf/gocode/autocompletecontext.go:455 6(runtime.goexit): D:/Mohan/Softwares/Installed/Go/src/runtime/asm_amd64.s:1373

panic: One of the package cache updaters panicked 1(runtime.gopanic): D:/Mohan/Softwares/Installed/Go/src/runtime/panic.go:969 2(main.update_packages): D:/GoPath/src/github.com/nsf/gocode/autocompletecontext.go:463 3(main.(*auto_complete_context).update_caches): D:/GoPath/src/github.com/nsf/gocode/autocompletecontext.go:178 4(main.(*auto_complete_context).apropos): D:/GoPath/src/github.com/nsf/gocode/autocompletecontext.go:360 5(main.server_auto_complete): D:/GoPath/src/github.com/nsf/gocode/server.go:202 6(main.(*RPC).RPC_auto_complete): D:/GoPath/src/github.com/nsf/gocode/rpc.go:26 7(reflect.Value.call): D:/Mohan/Softwares/Installed/Go/src/reflect/value.go:460 8(reflect.Value.Call): D:/Mohan/Softwares/Installed/Go/src/reflect/value.go:321 9(net/rpc.(*service).call): D:/Mohan/Softwares/Installed/Go/src/net/rpc/server.go:377 10(runtime.goexit): D:/Mohan/Softwares/Installed/Go/src/runtime/asm_amd64.s:1373

panic: unknown export format version 1 1(runtime.gopanic): D:/Mohan/Softwares/Installed/Go/src/runtime/panic.go:969 2(main.(*gc_ibin_parser).parse_export): D:/GoPath/src/github.com/nsf/gocode/package_ibin.go:143 3(main.(*package_file_cache).process_package_data): D:/GoPath/src/github.com/nsf/gocode/package.go:138 4(main.(*package_file_cache).update_cache): D:/GoPath/src/github.com/nsf/gocode/package.go:92 5(main.update_packages.func1): D:/GoPath/src/github.com/nsf/gocode/autocompletecontext.go:455 6(runtime.goexit): D:/Mohan/Softwares/Installed/Go/src/runtime/asm_amd64.s:1373

mohan5246 avatar Apr 18 '20 10:04 mohan5246