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 during SignatureHelp #40230

Closed
chikaku opened this issue Jul 15, 2020 · 2 comments
Closed

x/tools/gopls: crash during SignatureHelp #40230

chikaku opened this issue Jul 15, 2020 · 2 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@chikaku
Copy link
Contributor

chikaku commented Jul 15, 2020

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

I write some code with problem and it crashed.

Please attach the stack trace from the crash.
A window with the error message should have popped up in the lower half of your screen.
Please copy the stack trace from that window and paste it in this issue.

[Info  - 3:32:23 PM] 2020/07/15 15:32:23 background imports cache refresh starting

[Info  - 3:32:23 PM] 2020/07/15 15:32:23 background refresh finished after 460.899124ms

[Info  - 3:33:19 PM] 2020/07/15 15:33:19 background imports cache refresh starting

[Info  - 3:33:19 PM] 2020/07/15 15:33:19 background refresh finished after 125.066717ms

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x13ec3f0]

goroutine 62690 [running]:
golang.org/x/tools/internal/lsp/source.newBuiltinSignature(0x1a68360, 0xc02b980a80, 0x1a7a340, 0xc000522840, 0x18ed2e9, 0x7, 0x36ef2e444c090201, 0xc02f2bde60, 0xc0521e1350)
	/homepath/code/gopath/pkg/mod/golang.org/x/[email protected]/internal/lsp/source/types_format.go:82 +0xd0
golang.org/x/tools/internal/lsp/source.builtinSignature(0x1a68360, 0xc02b980a80, 0x1a7a340, 0xc000522840, 0xc017866440, 0x18ed2e9, 0x7, 0x30afddd, 0xc02f1662e0, 0xc0000d5e00, ...)
	/homepath/code/gopath/pkg/mod/golang.org/x/[email protected]/internal/lsp/source/signature_help.go:140 +0x81
golang.org/x/tools/internal/lsp/source.SignatureHelp(0x1a68360, 0xc02b980a80, 0x1a7b3a0, 0xc05277ab80, 0x1a6c160, 0xc0124438c0, 0x4040800000000000, 0x4040800000000000, 0x0, 0x0, ...)
	/homepath/code/gopath/pkg/mod/golang.org/x/[email protected]/internal/lsp/source/signature_help.go:81 +0x11aa
golang.org/x/tools/internal/lsp.(*Server).signatureHelp(0xc0000b5b80, 0x1a682a0, 0xc01796fc80, 0xc0521c7480, 0x0, 0x0, 0xc0521d8fd0)
	/homepath/code/gopath/pkg/mod/golang.org/x/[email protected]/internal/lsp/signature_help.go:21 +0xf6
golang.org/x/tools/internal/lsp.(*Server).SignatureHelp(0xc0000b5b80, 0x1a682a0, 0xc01796fc80, 0xc0521c7480, 0xc0521c7480, 0x0, 0x0)
	/homepath/code/gopath/pkg/mod/golang.org/x/[email protected]/internal/lsp/server_gen.go:188 +0x49
golang.org/x/tools/internal/lsp/protocol.serverDispatch(0x1a682a0, 0xc01796fc80, 0x1a82720, 0xc0000b5b80, 0xc02b980390, 0x1a684e0, 0xc01796fbc0, 0x0, 0x0, 0xbfbbca33214a08a0)
	/homepath/code/gopath/pkg/mod/golang.org/x/[email protected]/internal/lsp/protocol/tsserver.go:276 +0x494a
golang.org/x/tools/internal/lsp/protocol.ServerHandler.func1(0x1a682a0, 0xc01796fc80, 0xc02b980390, 0x1a684e0, 0xc01796fbc0, 0x0, 0x0)
	/homepath/code/gopath/pkg/mod/golang.org/x/[email protected]/internal/lsp/protocol/protocol.go:62 +0xc0
golang.org/x/tools/internal/lsp/lsprpc.handshaker.func1(0x1a682a0, 0xc01796fc80, 0xc02b980390, 0x1a684e0, 0xc01796fbc0, 0x0, 0x0)
	/homepath/code/gopath/pkg/mod/golang.org/x/[email protected]/internal/lsp/lsprpc/lsprpc.go:509 +0x40e
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1(0x1a682a0, 0xc01796fc80, 0xc02ef640a0, 0x1a684e0, 0xc01796fbc0, 0x1951b20, 0x0)
	/homepath/code/gopath/pkg/mod/golang.org/x/[email protected]/internal/jsonrpc2/handler.go:35 +0xd3
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2(0xc052b4d6e0, 0xc02ac72de0, 0xc0000a94c0, 0x1a682a0, 0xc01796fc80, 0xc02ef640a0, 0x1a684e0, 0xc01796fbc0)
	/homepath/code/gopath/pkg/mod/golang.org/x/[email protected]/internal/jsonrpc2/handler.go:103 +0x86
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
	/homepath/code/gopath/pkg/mod/golang.org/x/[email protected]/internal/jsonrpc2/handler.go:100 +0x171
[Error - 3:33:32 PM] Connection to server got closed. Server will not be restarted.
[Error - 3:33:32 PM] Request textDocument/signatureHelp failed.
Error: Connection got disposed.
	at Object.dispose (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/main.js:904:25)
	at Object.dispose (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:74:35)
	at LanguageClient.handleConnectionClosed (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:2309:42)
	at LanguageClient.handleConnectionClosed (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/main.js:155:15)
	at closeHandler (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:2296:18)
	at CallbackList.invoke (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:62:39)
	at Emitter.fire (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:121:36)
	at closeHandler (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/main.js:240:26)
	at CallbackList.invoke (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:62:39)
	at Emitter.fire (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:121:36)
	at StreamMessageReader.fireClose (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/messageReader.js:111:27)
	at Socket.<anonymous> (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/messageReader.js:151:46)
	at Socket.emit (events.js:208:15)
	at Pipe.<anonymous> (net.js:588:12)
[Error - 3:33:32 PM] Request textDocument/foldingRange failed.
Error: Connection got disposed.
	at Object.dispose (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/main.js:904:25)
	at Object.dispose (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:74:35)
	at LanguageClient.handleConnectionClosed (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:2309:42)
	at LanguageClient.handleConnectionClosed (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/main.js:155:15)
	at closeHandler (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-languageclient/lib/client.js:2296:18)
	at CallbackList.invoke (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:62:39)
	at Emitter.fire (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:121:36)
	at closeHandler (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/main.js:240:26)
	at CallbackList.invoke (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:62:39)
	at Emitter.fire (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/events.js:121:36)
	at StreamMessageReader.fireClose (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/messageReader.js:111:27)
	at Socket.<anonymous> (/homepath/.vscode/extensions/golang.go-0.15.1/node_modules/vscode-jsonrpc/lib/messageReader.js:151:46)
	at Socket.emit (events.js:208:15)
	at Pipe.<anonymous> (net.js:588:12)

OPTIONAL: If you would like to share more information, you can attach your complete gopls logs.

NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE.
DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.

<OPTIONAL: ATTACH LOGS HERE>

@hyangah
Copy link
Contributor

hyangah commented Jul 15, 2020

@chikaku Thanks for the report! I am going to transfer this issue to the gopls issue tracker so gopls devs can follow up.

@pjweinbgo @stamblerre The stack trace is different from the crash reported in #40208

@hyangah hyangah changed the title gopls: automated issue report (crash) x/tools/gopls: crash during SignatureHelp Jul 15, 2020
@hyangah hyangah transferred this issue from golang/vscode-go Jul 15, 2020
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jul 15, 2020
@gopherbot gopherbot added this to the Unreleased milestone Jul 15, 2020
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/242798 mentions this issue: internal/lsp/source: handle nil pointer in newBuiltinSignature

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.4.4 Jul 15, 2020
@golang golang locked and limited conversation to collaborators Jul 15, 2021
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. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants