Skip to content

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

Closed
@hulb

Description

@hulb

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)

Activity

added this to the Unreleased milestone on Jun 12, 2019
added
goplsIssues related to the Go language server, gopls.
on Jun 12, 2019
ianthehat

ianthehat commented on Jun 12, 2019

@ianthehat

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

hulb commented on Jun 12, 2019

@hulb
Author

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

locked and limited conversation to collaborators on Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgegoplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ianthehat@hulb@gopherbot

        Issue actions

          x/tool/cmd/gopls: crashes frequently · Issue #32564 · golang/go