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/tools/gopls: crash when using vscode workspace symbol #44806

Closed
benqwu opened this issue Mar 5, 2021 · 2 comments
Closed

x/tools/gopls: crash when using vscode workspace symbol #44806

benqwu opened this issue Mar 5, 2021 · 2 comments
Assignees
Milestone

Comments

@benqwu
Copy link

@benqwu benqwu commented Mar 5, 2021

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

$ go version
go version go1.16 windows/amd64

Does this issue reproduce with the latest release?

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

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\AA\AppData\Local\go-build
set GOENV=C:\Users\AA\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\AA\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\AA\go
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.16
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=NUL
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\AA\AppData\Local\Temp\go-build860268765=/tmp/go-build -gno-record-gcc-switches

What did you do?

while vs-code workspace symbol searching, gopls crashed.

What did you expect to see?

I think the workspace symbol should work properly.

What did you see instead?

When I open one folder, the workspace symbol can work normally, and when I close vscode and open another folder, it crashes every time.

[Info - 下午2:52:22] 2021/03/05 14:52:22 go env for Z:\opensrc\longhorn\longhorn-manager
(root Z:\opensrc\longhorn\longhorn-manager)
(go version go version go1.16 windows/amd64)
(valid build configuration = true)
(build flags: [])
GOSUMDB=sum.golang.org
GOCACHE=C:\Users\AA\AppData\Local\go-build
GOINSECURE=
GOPATH=C:\Users\AA\go
GOMODCACHE=C:\Users\AA\go\pkg\mod
GOPRIVATE=
GO111MODULE=
GOFLAGS=
GOPROXY=https://goproxy.cn,direct
GONOPROXY=
GONOSUMDB=
GOROOT=C:\Program Files\Go
GOMOD=Z:\opensrc\longhorn\longhorn-manager\go.mod

[Info - 下午2:52:26] 2021/03/05 14:52:26 go/packages.Load
snapshot=0
directory=Z:\opensrc\longhorn\longhorn-manager
query=[builtin github.com/longhorn/longhorn-manager/...]
packages=56

panic: interface conversion: ast.Expr is *ast.ParenExpr, not *ast.Ident

goroutine 18538 [running]:
golang.org/x/tools/internal/lsp/source.(*symbolCollector).walkFilesDecls(0xc0083f7200, 0xc01a7e8600, 0xe, 0x10)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/source/workspace_symbol.go:358 +0x5f0
golang.org/x/tools/internal/lsp/source.(*symbolCollector).walk(0xc0083f7200, 0x14f9540, 0xc015ffe660, 0xc00a1e8080, 0x1, 0x1, 0xc0083f7200, 0x14f9540, 0xc015ffe660, 0xc015ffe840, ...)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/source/workspace_symbol.go:289 +0x21b
golang.org/x/tools/internal/lsp/source.WorkspaceSymbols(0x14f9540, 0xc015ffe660, 0x13a4f14, 0x5, 0x13a8d3e, 0x7, 0xc00a1e8080, 0x1, 0x1, 0xc01a4cf540, ...)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/source/workspace_symbol.go:52 +0x19a
golang.org/x/tools/internal/lsp.(*Server).symbol(0xc00017c2a0, 0x14f9498, 0xc015ffe360, 0xc015ffe0c0, 0x0, 0x0, 0x0, 0x0, 0x0)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/workspace_symbol.go:22 +0x209
golang.org/x/tools/internal/lsp.(*Server).Symbol(0xc00017c2a0, 0x14f9498, 0xc00b9dc100, 0xc015ffe0c0, 0xc015ffe0c0, 0x0, 0x0, 0x0, 0xc0089330f1e23e6c)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/server_gen.go:232 +0x54
golang.org/x/tools/internal/lsp/protocol.serverDispatch(0x14f9498, 0xc00b9dc100, 0x150e940, 0xc00017c2a0, 0xc015ffe000, 0x14f9690, 0xc00b9dc000, 0x0, 0x14e8c60, 0xc000006020)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/protocol/tsserver.go:431 +0xc0d
golang.org/x/tools/internal/lsp/protocol.ServerHandler.func1(0x14f9498, 0xc00b9dc100, 0xc015ffe000, 0x14f9690, 0xc00b9dc000, 0xc0089330f1e23e6c, 0x7d4111531)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/protocol/protocol.go:63 +0xc7
golang.org/x/tools/internal/lsp/lsprpc.handshaker.func1(0x14f9498, 0xc00b9dc100, 0xc015ffe000, 0x14f9690, 0xc00b9dc000, 0x0, 0x0)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/lsprpc/lsprpc.go:560 +0x452
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1(0x14f9498, 0xc00b9dc100, 0xc00596e780, 0x14f9690, 0xc00b9dc000, 0xc013a15cf0, 0xa2617d)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/jsonrpc2/handler.go:35 +0xe2
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2(0xc0248761e0, 0xc015ef6060, 0xc00005a320, 0x14f9498, 0xc00b9dc100, 0xc00596e780, 0x14f9690, 0xc00b9dc000)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/jsonrpc2/handler.go:103 +0x8d
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/jsonrpc2/handler.go:100 +0x179
[Info - 下午2:52:52] Connection to server got closed. Server will restart.
[Error - 下午2:52:52] Request workspace/symbol failed.
Error: Connection got disposed.
at Object.dispose (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:77796:27)
at Object.dispose (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:10724:35)
at LanguageClient.handleConnectionClosed (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:13003:42)
at LanguageClient.handleConnectionClosed (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:62954:15)
at closeHandler (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:12990:18)
at CallbackList.invoke (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18546:39)
at Emitter.fire (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18608:36)
at closeHandler (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:77008:26)
at CallbackList.invoke (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18546:39)
at Emitter.fire (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18608:36)
at StreamMessageReader.fireClose (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:76395:27)
at Socket. (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:76480:42)
at Socket.emit (events.js:327:22)
at Pipe. (net.js:674:12)
[Info - 下午2:52:52] 2021/03/05 14:52:52 go env for Z:\opensrc\longhorn\longhorn-manager
(root Z:\opensrc\longhorn\longhorn-manager)
(go version go version go1.16 windows/amd64)
(valid build configuration = true)
(build flags: [])
GOPROXY=https://goproxy.cn,direct
GOROOT=C:\Program Files\Go
GONOSUMDB=
GOPRIVATE=
GOSUMDB=sum.golang.org
GO111MODULE=
GOFLAGS=
GOINSECURE=
GOMODCACHE=C:\Users\AA\go\pkg\mod
GONOPROXY=
GOPATH=C:\Users\AA\go
GOCACHE=C:\Users\AA\AppData\Local\go-build
GOMOD=Z:\opensrc\longhorn\longhorn-manager\go.mod

[Info - 下午2:52:55] 2021/03/05 14:52:55 go/packages.Load
snapshot=0
directory=Z:\opensrc\longhorn\longhorn-manager
query=[builtin github.com/longhorn/longhorn-manager/...]
packages=56

[Error - 下午2:53:01] 2021/03/05 14:53:01 creating workspace dir: mkdir C:\Users\AA\AppData\Local\Temp\gopls-11088.workspace: Cannot create a file when that file already exists.

panic: interface conversion: ast.Expr is *ast.ParenExpr, not *ast.Ident

goroutine 13027 [running]:
golang.org/x/tools/internal/lsp/source.(*symbolCollector).walkFilesDecls(0xc005ed6000, 0xc016ca2900, 0xe, 0x10)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/source/workspace_symbol.go:358 +0x5f0
golang.org/x/tools/internal/lsp/source.(*symbolCollector).walk(0xc005ed6000, 0x14f9540, 0xc016016ba0, 0xc015dd5330, 0x1, 0x1, 0xc005ed6000, 0x14f9540, 0xc016016ba0, 0xc016016c60, ...)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/source/workspace_symbol.go:289 +0x21b
golang.org/x/tools/internal/lsp/source.WorkspaceSymbols(0x14f9540, 0xc016016ba0, 0x13a4f14, 0x5, 0x13a8d3e, 0x7, 0xc015dd5330, 0x1, 0x1, 0xc015ae0430, ...)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/source/workspace_symbol.go:52 +0x19a
golang.org/x/tools/internal/lsp.(*Server).symbol(0xc00017c2a0, 0x14f9498, 0xc016016a50, 0xc016016900, 0x0, 0x0, 0x0, 0x0, 0x0)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/workspace_symbol.go:22 +0x209
golang.org/x/tools/internal/lsp.(*Server).Symbol(0xc00017c2a0, 0x14f9498, 0xc015d63980, 0xc016016900, 0xc016016900, 0x0, 0x0, 0x0, 0xc0089333c579d9d4)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/server_gen.go:232 +0x54
golang.org/x/tools/internal/lsp/protocol.serverDispatch(0x14f9498, 0xc015d63980, 0x150e940, 0xc00017c2a0, 0xc0160168d0, 0x14f9690, 0xc015d63900, 0xc015d5e77b, 0x14e8c60, 0xc000006020)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/protocol/tsserver.go:431 +0xc0d
golang.org/x/tools/internal/lsp/protocol.ServerHandler.func1(0x14f9498, 0xc015d63980, 0xc0160168d0, 0x14f9690, 0xc015d63900, 0xc0089333c579d9d4, 0x287652209)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/protocol/protocol.go:63 +0xc7
golang.org/x/tools/internal/lsp/lsprpc.handshaker.func1(0x14f9498, 0xc015d63980, 0xc0160168d0, 0x14f9690, 0xc015d63900, 0x0, 0x0)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/lsprpc/lsprpc.go:560 +0x452
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1(0x14f9498, 0xc015d63980, 0xc0167c6c78, 0x14f9690, 0xc015d63900, 0x13a2f79, 0x14f8250)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/jsonrpc2/handler.go:35 +0xe2
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2(0xc00003c7e0, 0xc016682e10, 0xc00053a050, 0x14f9498, 0xc015d63980, 0xc0167c6c78, 0x14f9690, 0xc015d63900)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/jsonrpc2/handler.go:103 +0x8d
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/jsonrpc2/handler.go:100 +0x179
[Info - 下午2:53:03] Connection to server got closed. Server will restart.
[Error - 下午2:53:03] Request workspace/symbol failed.
Error: Connection got disposed.
at Object.dispose (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:77796:27)
at Object.dispose (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:10724:35)
at LanguageClient.handleConnectionClosed (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:13003:42)
at LanguageClient.handleConnectionClosed (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:62954:15)
at closeHandler (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:12990:18)
at CallbackList.invoke (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18546:39)
at Emitter.fire (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18608:36)
at closeHandler (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:77008:26)
at CallbackList.invoke (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18546:39)
at Emitter.fire (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18608:36)
at StreamMessageReader.fireClose (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:76395:27)
at Socket. (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:76480:42)
at Socket.emit (events.js:327:22)
at Pipe. (net.js:674:12)
[Info - 下午2:53:04] 2021/03/05 14:53:04 go env for Z:\opensrc\longhorn\longhorn-manager
(root Z:\opensrc\longhorn\longhorn-manager)
(go version go version go1.16 windows/amd64)
(valid build configuration = true)
(build flags: [])
GOFLAGS=
GOPROXY=https://goproxy.cn,direct
GOROOT=C:\Program Files\Go
GONOSUMDB=
GOPATH=C:\Users\AA\go
GO111MODULE=
GOPRIVATE=
GOINSECURE=
GOMODCACHE=C:\Users\AA\go\pkg\mod
GOCACHE=C:\Users\AA\AppData\Local\go-build
GOMOD=Z:\opensrc\longhorn\longhorn-manager\go.mod
GOSUMDB=sum.golang.org
GONOPROXY=

[Info - 下午2:53:06] 2021/03/05 14:53:06 go/packages.Load
snapshot=0
directory=Z:\opensrc\longhorn\longhorn-manager
query=[builtin github.com/longhorn/longhorn-manager/...]
packages=56

[Error - 下午2:53:13] 2021/03/05 14:53:13 creating workspace dir: mkdir C:\Users\AA\AppData\Local\Temp\gopls-11088.workspace: Cannot create a file when that file already exists.

panic: interface conversion: ast.Expr is *ast.ParenExpr, not *ast.Ident

goroutine 17991 [running]:
golang.org/x/tools/internal/lsp/source.(*symbolCollector).walkFilesDecls(0xc00525ac00, 0xc0050bd400, 0xe, 0x10)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/source/workspace_symbol.go:358 +0x5f0
golang.org/x/tools/internal/lsp/source.(*symbolCollector).walk(0xc00525ac00, 0x14f9540, 0xc0142b2750, 0xc005f70810, 0x1, 0x1, 0xc00525ac00, 0x14f9540, 0xc0142b2750, 0xc0142b2810, ...)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/source/workspace_symbol.go:289 +0x21b
golang.org/x/tools/internal/lsp/source.WorkspaceSymbols(0x14f9540, 0xc0142b2750, 0x13a4f14, 0x5, 0x13a8d3e, 0x7, 0xc005f70810, 0x1, 0x1, 0xc017d4cb58, ...)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/source/workspace_symbol.go:52 +0x19a
golang.org/x/tools/internal/lsp.(*Server).symbol(0xc00017c2a0, 0x14f9498, 0xc0142b2540, 0xc0142b24b0, 0x0, 0x0, 0x0, 0x0, 0x0)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/workspace_symbol.go:22 +0x209
golang.org/x/tools/internal/lsp.(*Server).Symbol(0xc00017c2a0, 0x14f9498, 0xc00ce48600, 0xc0142b24b0, 0xc0142b24b0, 0x0, 0x0, 0x0, 0xc0089337526efbc4)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/server_gen.go:232 +0x54
golang.org/x/tools/internal/lsp/protocol.serverDispatch(0x14f9498, 0xc00ce48600, 0x150e940, 0xc00017c2a0, 0xc0142b2480, 0x14f9690, 0xc00ce48580, 0x0, 0x14e8c60, 0xc000006020)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/protocol/tsserver.go:431 +0xc0d
golang.org/x/tools/internal/lsp/protocol.ServerHandler.func1(0x14f9498, 0xc00ce48600, 0xc0142b2480, 0x14f9690, 0xc00ce48580, 0xc0089337526efbc4, 0x3257fd0c9)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/protocol/protocol.go:63 +0xc7
golang.org/x/tools/internal/lsp/lsprpc.handshaker.func1(0x14f9498, 0xc00ce48600, 0xc0142b2480, 0x14f9690, 0xc00ce48580, 0x0, 0x0)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/lsprpc/lsprpc.go:560 +0x452
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1(0x14f9498, 0xc00ce48600, 0xc0108997d0, 0x14f9690, 0xc00ce48580, 0x10e2959, 0xc014076d28)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/jsonrpc2/handler.go:35 +0xe2
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2(0xc0051680c0, 0xc0140b7170, 0xc0001e2280, 0x14f9498, 0xc00ce48600, 0xc0108997d0, 0x14f9690, 0xc00ce48580)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/jsonrpc2/handler.go:103 +0x8d
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/jsonrpc2/handler.go:100 +0x179
[Info - 下午2:53:17] Connection to server got closed. Server will restart.
[Error - 下午2:53:17] Request workspace/symbol failed.
Error: Connection got disposed.
at Object.dispose (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:77796:27)
at Object.dispose (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:10724:35)
at LanguageClient.handleConnectionClosed (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:13003:42)
at LanguageClient.handleConnectionClosed (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:62954:15)
at closeHandler (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:12990:18)
at CallbackList.invoke (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18546:39)
at Emitter.fire (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18608:36)
at closeHandler (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:77008:26)
at CallbackList.invoke (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18546:39)
at Emitter.fire (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18608:36)
at StreamMessageReader.fireClose (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:76395:27)
at Socket. (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:76480:42)
at Socket.emit (events.js:327:22)
at Pipe. (net.js:674:12)
[Info - 下午2:53:18] 2021/03/05 14:53:18 go env for Z:\opensrc\longhorn\longhorn-manager
(root Z:\opensrc\longhorn\longhorn-manager)
(go version go version go1.16 windows/amd64)
(valid build configuration = true)
(build flags: [])
GOPRIVATE=
GOCACHE=C:\Users\AA\AppData\Local\go-build
GOFLAGS=
GOSUMDB=sum.golang.org
GO111MODULE=
GOMODCACHE=C:\Users\AA\go\pkg\mod
GONOPROXY=
GOPATH=C:\Users\AA\go
GOINSECURE=
GOMOD=Z:\opensrc\longhorn\longhorn-manager\go.mod
GOROOT=C:\Program Files\Go
GONOSUMDB=
GOPROXY=https://goproxy.cn,direct

[Info - 下午2:53:20] 2021/03/05 14:53:20 go/packages.Load
snapshot=0
directory=Z:\opensrc\longhorn\longhorn-manager
query=[builtin github.com/longhorn/longhorn-manager/...]
packages=56

[Error - 下午2:53:26] 2021/03/05 14:53:26 creating workspace dir: mkdir C:\Users\AA\AppData\Local\Temp\gopls-11088.workspace: Cannot create a file when that file already exists.

panic: interface conversion: ast.Expr is *ast.ParenExpr, not *ast.Ident

goroutine 17040 [running]:
golang.org/x/tools/internal/lsp/source.(*symbolCollector).walkFilesDecls(0xc0058b4600, 0xc0076aef00, 0xe, 0x10)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/source/workspace_symbol.go:358 +0x5f0
golang.org/x/tools/internal/lsp/source.(*symbolCollector).walk(0xc0058b4600, 0x14f9540, 0xc00fc9cc90, 0xc0044a0070, 0x1, 0x1, 0xc0058b4600, 0x14f9540, 0xc00fc9cc90, 0xc00fc9ce10, ...)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/source/workspace_symbol.go:289 +0x21b
golang.org/x/tools/internal/lsp/source.WorkspaceSymbols(0x14f9540, 0xc00fc9cc90, 0x13a4f14, 0x5, 0x13a8d3e, 0x7, 0xc0044a0070, 0x1, 0x1, 0xc013842c40, ...)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/source/workspace_symbol.go:52 +0x19a
golang.org/x/tools/internal/lsp.(*Server).symbol(0xc00017c2a0, 0x14f9498, 0xc00fc9c9f0, 0xc00fc9c2d0, 0x0, 0x0, 0x0, 0x0, 0x0)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/workspace_symbol.go:22 +0x209
golang.org/x/tools/internal/lsp.(*Server).Symbol(0xc00017c2a0, 0x14f9498, 0xc007c8a240, 0xc00fc9c2d0, 0xc00fc9c2d0, 0x0, 0x0, 0x0, 0xc008933a0b673f58)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/server_gen.go:232 +0x54
golang.org/x/tools/internal/lsp/protocol.serverDispatch(0x14f9498, 0xc007c8a240, 0x150e940, 0xc00017c2a0, 0xc00fc9c030, 0x14f9690, 0xc007c8a000, 0x16f74b49520, 0x14e8c60, 0xc000006020)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/protocol/tsserver.go:431 +0xc0d
golang.org/x/tools/internal/lsp/protocol.ServerHandler.func1(0x14f9498, 0xc007c8a240, 0xc00fc9c030, 0x14f9690, 0xc007c8a000, 0xc008933a0b673f58, 0x26db3b9a1)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/protocol/protocol.go:63 +0xc7
golang.org/x/tools/internal/lsp/lsprpc.handshaker.func1(0x14f9498, 0xc007c8a240, 0xc00fc9c030, 0x14f9690, 0xc007c8a000, 0x0, 0x0)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/lsprpc/lsprpc.go:560 +0x452
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1(0x14f9498, 0xc007c8a240, 0xc01d580de0, 0x14f9690, 0xc007c8a000, 0xc014b459d0, 0x0)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/jsonrpc2/handler.go:35 +0xe2
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2(0xc0006880c0, 0xc00fc36ff0, 0xc00005a7d0, 0x14f9498, 0xc007c8a240, 0xc01d580de0, 0x14f9690, 0xc007c8a000)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/jsonrpc2/handler.go:103 +0x8d
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/jsonrpc2/handler.go:100 +0x179
[Info - 下午2:53:28] Connection to server got closed. Server will restart.
[Error - 下午2:53:28] Request workspace/symbol failed.
Error: Connection got disposed.
at Object.dispose (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:77796:27)
at Object.dispose (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:10724:35)
at LanguageClient.handleConnectionClosed (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:13003:42)
at LanguageClient.handleConnectionClosed (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:62954:15)
at closeHandler (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:12990:18)
at CallbackList.invoke (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18546:39)
at Emitter.fire (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18608:36)
at closeHandler (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:77008:26)
at CallbackList.invoke (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18546:39)
at Emitter.fire (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18608:36)
at StreamMessageReader.fireClose (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:76395:27)
at Socket. (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:76480:42)
at Socket.emit (events.js:327:22)
at Pipe. (net.js:674:12)
[Info - 下午2:53:29] 2021/03/05 14:53:29 go env for Z:\opensrc\longhorn\longhorn-manager
(root Z:\opensrc\longhorn\longhorn-manager)
(go version go version go1.16 windows/amd64)
(valid build configuration = true)
(build flags: [])
GOROOT=C:\Program Files\Go
GO111MODULE=
GOMODCACHE=C:\Users\AA\go\pkg\mod
GOCACHE=C:\Users\AA\AppData\Local\go-build
GOFLAGS=
GOMOD=Z:\opensrc\longhorn\longhorn-manager\go.mod
GONOPROXY=
GOPROXY=https://goproxy.cn,direct
GOSUMDB=sum.golang.org
GOINSECURE=
GONOSUMDB=
GOPATH=C:\Users\AA\go
GOPRIVATE=

[Info - 下午2:53:31] 2021/03/05 14:53:31 go/packages.Load
snapshot=0
directory=Z:\opensrc\longhorn\longhorn-manager
query=[builtin github.com/longhorn/longhorn-manager/...]
packages=56

[Error - 下午2:53:37] 2021/03/05 14:53:37 creating workspace dir: mkdir C:\Users\AA\AppData\Local\Temp\gopls-11088.workspace: Cannot create a file when that file already exists.

panic: interface conversion: ast.Expr is *ast.ParenExpr, not *ast.Ident

goroutine 20324 [running]:
golang.org/x/tools/internal/lsp/source.(*symbolCollector).walkFilesDecls(0xc00c368c00, 0xc019c71700, 0xe, 0x10)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/source/workspace_symbol.go:358 +0x5f0
golang.org/x/tools/internal/lsp/source.(*symbolCollector).walk(0xc00c368c00, 0x14f9540, 0xc0230834d0, 0xc007ef44b0, 0x1, 0x1, 0xc00c368c00, 0x14f9540, 0xc0230834d0, 0xc023083590, ...)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/source/workspace_symbol.go:289 +0x21b
golang.org/x/tools/internal/lsp/source.WorkspaceSymbols(0x14f9540, 0xc0230834d0, 0x13a4f14, 0x5, 0x13a8d3e, 0x7, 0xc007ef44b0, 0x1, 0x1, 0xc022abee70, ...)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/source/workspace_symbol.go:52 +0x19a
golang.org/x/tools/internal/lsp.(*Server).symbol(0xc00017c2a0, 0x14f9498, 0xc023083380, 0xc023083230, 0x0, 0x0, 0x0, 0x0, 0x0)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/workspace_symbol.go:22 +0x209
golang.org/x/tools/internal/lsp.(*Server).Symbol(0xc00017c2a0, 0x14f9498, 0xc012433580, 0xc023083230, 0xc023083230, 0x0, 0x0, 0x0, 0xc0089340781ecb38)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/server_gen.go:232 +0x54
golang.org/x/tools/internal/lsp/protocol.serverDispatch(0x14f9498, 0xc012433580, 0x150e940, 0xc00017c2a0, 0xc023083200, 0x14f9690, 0xc012433500, 0x2295c7612a0, 0x14e8c60, 0xc000006020)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/protocol/tsserver.go:431 +0xc0d
golang.org/x/tools/internal/lsp/protocol.ServerHandler.func1(0x14f9498, 0xc012433580, 0xc023083200, 0x14f9690, 0xc012433500, 0xc0089340781ecb38, 0x5e87b670d)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/protocol/protocol.go:63 +0xc7
golang.org/x/tools/internal/lsp/lsprpc.handshaker.func1(0x14f9498, 0xc012433580, 0xc023083200, 0x14f9690, 0xc012433500, 0x0, 0x0)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/lsp/lsprpc/lsprpc.go:560 +0x452
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1(0x14f9498, 0xc012433580, 0xc006b2ea08, 0x14f9690, 0xc012433500, 0xc02218a000, 0xa2617d)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/jsonrpc2/handler.go:35 +0xe2
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2(0xc021776300, 0xc0221faea0, 0xc00031e200, 0x14f9498, 0xc012433580, 0xc006b2ea08, 0x14f9690, 0xc012433500)
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/jsonrpc2/handler.go:103 +0x8d
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
C:/Users/AA/go/pkg/mod/golang.org/x/tools@v0.1.1-0.20210222172741-77e031214674/internal/jsonrpc2/handler.go:100 +0x179
[Error - 下午2:53:54] Connection to server got closed. Server will not be restarted.
[Error - 下午2:53:54] Request workspace/symbol failed.
Error: Connection got disposed.
at Object.dispose (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:77796:27)
at Object.dispose (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:10724:35)
at LanguageClient.handleConnectionClosed (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:13003:42)
at LanguageClient.handleConnectionClosed (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:62954:15)
at closeHandler (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:12990:18)
at CallbackList.invoke (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18546:39)
at Emitter.fire (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18608:36)
at closeHandler (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:77008:26)
at CallbackList.invoke (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18546:39)
at Emitter.fire (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:18608:36)
at StreamMessageReader.fireClose (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:76395:27)
at Socket. (c:\Users\AA.vscode\extensions\golang.go-0.22.1\dist\goMain.js:76480:42)
at Socket.emit (events.js:327:22)
at Pipe. (net.js:674:12)

@gopherbot gopherbot added the gopls label Mar 5, 2021
@benqwu benqwu changed the title vs-code shows gopls(server) panic in workspace_symbol.go x/tools/gopls: crash when vscode use workspace symbol Mar 5, 2021
@gopherbot gopherbot added the Tools label Mar 5, 2021
@gopherbot gopherbot added this to the Unreleased milestone Mar 5, 2021
@benqwu benqwu changed the title x/tools/gopls: crash when vscode use workspace symbol x/tools/gopls: crash when using vscode workspace symbol Mar 5, 2021
@findleyr findleyr self-assigned this Mar 5, 2021
@findleyr
Copy link
Contributor

@findleyr findleyr commented Mar 5, 2021

Thanks for the report. This looks like a straightforward bug -- I'll fix.

@gopherbot
Copy link

@gopherbot gopherbot commented Mar 5, 2021

Change https://golang.org/cl/298852 mentions this issue: internal/lsp/source: correct workspace symbol logic for unpacking receivers

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

Successfully merging a pull request may close this issue.

None yet
4 participants