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

x/tool/cmd/gopls: crashes frequently #32564

Closed
hulb opened this issue Jun 12, 2019 · 2 comments
Closed

x/tool/cmd/gopls: crashes frequently #32564

hulb opened this issue Jun 12, 2019 · 2 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.
Milestone

Comments

@hulb
Copy link

hulb commented Jun 12, 2019

What version of Go are you using (go version)?

$ go version
go version go1.12.5 windows/amd64

Does this issue reproduce with the latest release?

yes, I updated gopls yesterday

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
go version go1.12.5 windows/amd64

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\jack\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\jack\go
set GOPROXY=https://goproxy.io
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=c:\Users\jack\Documents\codes\compute\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\jack\AppData\Local\Temp\go-build140485090=/tmp/go-build -gno-record-gcc-switches

What did you do?

I'm trying to write a test case.

What did you expect to see?

gopls works fine

What did you see instead?

gopls crashed. here is the gopls log

[Info  - 上午11:42:36] Build info
----------
no module information, gopls not built in module mode

Go info
-------
go version go1.12.5 windows/amd64

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\jack\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\jack\go
set GOPROXY=https://goproxy.io
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=c:\Users\jack\Documents\codes\compute\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\jack\AppData\Local\Temp\go-build140485090=/tmp/go-build -gno-record-gcc-switches

panic: parse : empty url

goroutine 8 [running]:
golang.org/x/tools/internal/span.URI.Filename(0x0, 0x0, 0xc006ba8c30, 0x47)
	C:/Users/jack/go/src/golang.org/x/tools/internal/span/uri.go:27 +0xd1
golang.org/x/tools/internal/span.CompareURI(0xc0003537c0, 0x4f, 0x0, 0x0, 0x4082f00000000000)
	C:/Users/jack/go/src/golang.org/x/tools/internal/span/uri.go:64 +0x89
golang.org/x/tools/internal/lsp/protocol.(*ColumnMapper).Range(0xc005afe570, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4082f00000000000, ...)
	C:/Users/jack/go/src/golang.org/x/tools/internal/lsp/protocol/span.go:49 +0xb1
golang.org/x/tools/internal/lsp.toProtocolDocumentSymbols(0xc005afe570, 0xc004b34c00, 0xb, 0x10, 0xc004b34c00, 0xb, 0x10)
	C:/Users/jack/go/src/golang.org/x/tools/internal/lsp/symbols.go:35 +0x267
golang.org/x/tools/internal/lsp.(*Server).documentSymbol(0xc000184d00, 0xb550c0, 0xc005afe540, 0xc001817700, 0xc001817700, 0x0, 0x0, 0x0, 0xc000337e00)
	C:/Users/jack/go/src/golang.org/x/tools/internal/lsp/symbols.go:23 +0x16b
golang.org/x/tools/internal/lsp.(*Server).DocumentSymbol(0xc000184d00, 0xb550c0, 0xc005afe540, 0xc001817700, 0xc001817700, 0x0, 0x0, 0x0, 0x0)
	C:/Users/jack/go/src/golang.org/x/tools/internal/lsp/server.go:199 +0x54
golang.org/x/tools/internal/lsp/protocol.serverHandler.func1(0xb550c0, 0xc005afe540, 0xc0001ce000, 0xc004bea2a0)
	C:/Users/jack/go/src/golang.org/x/tools/internal/lsp/protocol/tsserver.go:335 +0x53c3
golang.org/x/tools/internal/jsonrpc2.(*Conn).Run.func1(0xc000049860, 0xc0001ce000)
	C:/Users/jack/go/src/golang.org/x/tools/internal/jsonrpc2/jsonrpc2.go:288 +0x190
created by golang.org/x/tools/internal/jsonrpc2.(*Conn).Run
	C:/Users/jack/go/src/golang.org/x/tools/internal/jsonrpc2/jsonrpc2.go:278 +0xc1
[Info  - 上午11:43:14] Connection to server got closed. Server will restart.
[Error - 上午11:43:14] Request textDocument/documentSymbol failed.
Error: Connection got disposed.
	at Object.dispose (C:\Users\jack\.vscode\extensions\ms-vscode.go-0.10.2\node_modules\vscode-jsonrpc\lib\main.js:876:25)
	at Object.dispose (C:\Users\jack\.vscode\extensions\ms-vscode.go-0.10.2\node_modules\vscode-languageclient\lib\client.js:57:35)
	at LanguageClient.handleConnectionClosed (C:\Users\jack\.vscode\extensions\ms-vscode.go-0.10.2\node_modules\vscode-languageclient\lib\client.js:2036:42)
	at LanguageClient.handleConnectionClosed (C:\Users\jack\.vscode\extensions\ms-vscode.go-0.10.2\node_modules\vscode-languageclient\lib\main.js:127:15)
	at closeHandler (C:\Users\jack\.vscode\extensions\ms-vscode.go-0.10.2\node_modules\vscode-languageclient\lib\client.js:2023:18)
	at CallbackList.invoke (C:\Users\jack\.vscode\extensions\ms-vscode.go-0.10.2\node_modules\vscode-jsonrpc\lib\events.js:62:39)
	at Emitter.fire (C:\Users\jack\.vscode\extensions\ms-vscode.go-0.10.2\node_modules\vscode-jsonrpc\lib\events.js:120:36)
	at closeHandler (C:\Users\jack\.vscode\extensions\ms-vscode.go-0.10.2\node_modules\vscode-jsonrpc\lib\main.js:226:26)
	at CallbackList.invoke (C:\Users\jack\.vscode\extensions\ms-vscode.go-0.10.2\node_modules\vscode-jsonrpc\lib\events.js:62:39)
	at Emitter.fire (C:\Users\jack\.vscode\extensions\ms-vscode.go-0.10.2\node_modules\vscode-jsonrpc\lib\events.js:120:36)
	at StreamMessageReader.fireClose (C:\Users\jack\.vscode\extensions\ms-vscode.go-0.10.2\node_modules\vscode-jsonrpc\lib\messageReader.js:111:27)
	at Socket.listen.readable.on (C:\Users\jack\.vscode\extensions\ms-vscode.go-0.10.2\node_modules\vscode-jsonrpc\lib\messageReader.js:151:46)
	at Socket.emit (events.js:187:15)
	at Pipe.Socket._destroy._handle.close [as _onclose] (net.js:596:12)
@gopherbot gopherbot added this to the Unreleased milestone Jun 12, 2019
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jun 12, 2019
@ianthehat
Copy link

This was fixed in https://go-review.googlesource.com/c/tools/+/181677 earlier today.
Could you try updating gopls (don't forget to restart your editor afterwards) and see if it still happens?

@hulb
Copy link
Author

hulb commented Jun 12, 2019

@ianthehat I update gopls and everything works fine! Thank you guys for the effort.

@hulb hulb closed this as completed Jun 12, 2019
@golang golang locked and limited conversation to collaborators Jun 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.
Projects
None yet
Development

No branches or pull requests

3 participants