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: panic in hover #52211

Closed
lixiangzhong opened this issue Apr 6, 2022 · 3 comments
Closed

x/tools/gopls: panic in hover #52211

lixiangzhong opened this issue Apr 6, 2022 · 3 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

@lixiangzhong
Copy link

gopls version: v0.8.2 (go1.18)
gopls flags:
update flags: proxy
extension version: 0.32.0
go version: 1.18
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Wed, 06 Apr 2022 04:16:53 GMT
restart history:
Wed, 06 Apr 2022 01:30:19 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

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

goroutine 8796 [running]:
go/types.(*Package).Path(...)
	  package.go:31
golang.org/x/tools/internal/lsp/source.linkData({0x1c3ee48%3F, 0xc0001aaaf0%3F}, 0xc00822cff0)
	  hover.go:408  0x3a2
golang.org/x/tools/internal/lsp/source.HoverIdentifier({0x1c38550%3F, 0xc0059dc080%3F}, 0xc000264140)
	  hover.go:325  0xa7e
golang.org/x/tools/internal/lsp/source.Hover({0x1c38550, 0xc0059dc080}, {0x1c40b00%3F, 0xc00c3c6480}, {0x1c38898, 0xc00ea76120}, {0x89ac030%3F, 0xc0%3F})
	  hover.go:79  0xf7
golang.org/x/tools/internal/lsp.(*Server).hover(0x187da60%3F, {0x1c38550, 0xc0059dc080}, 0xc0089ac030)
	  hover.go:27  0x1e5
golang.org/x/tools/internal/lsp.(*Server).Hover(0xc0107a8080%3F, {0x1c38550%3F, 0xc0059dc080%3F}, 0x187da60%3F)
	  server_gen.go:144  0x25
golang.org/x/tools/internal/lsp/protocol.serverDispatch({0x1c38550, 0xc0059dc080}, {0x1c44670, 0xc0001ce120}, 0xc0089ac000, {0x1c387f0, 0xc0059dc000})
	  tsserver.go:467  0x13fa
golang.org/x/tools/internal/lsp/protocol.ServerHandler.func1({0x1c38550, 0xc0059dc080}, 0xc0089ac000, {0x1c387f0, 0xc0059dc000})
	  protocol.go:154  0x90
golang.org/x/tools/internal/lsp/lsprpc.handshaker.func1({0x1c38550, 0xc0059dc080}, 0xc0089ac000, {0x1c387f0%3F, 0xc0059dc000%3F})
	  lsprpc.go:506  0xa43
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1({0x1c38550, 0xc0059dc080}, 0xc009e0f068, {0x1c387f0%3F, 0xc0059dc000%3F})
	  handler.go:35  0xf6
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2()
	  handler.go:103  0xa3
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
	  handler.go:100  0x20a
[Error - 12:16:32 PM] 

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>

@suzmue suzmue changed the title gopls: automated issue report (crash) x/tools/gopls: panic in hover Apr 7, 2022
@suzmue suzmue transferred this issue from golang/vscode-go Apr 7, 2022
@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 Apr 7, 2022
@gopherbot gopherbot added this to the Unreleased milestone Apr 7, 2022
@suzmue suzmue modified the milestones: Unreleased, gopls/on-deck Apr 8, 2022
@findleyr
Copy link
Contributor

findleyr commented Apr 8, 2022

Hi, do you by any chance recall what you were hovering over when you hit this panic? I believe this is a regression in https://go.dev/cl/385016, but clearly we did not have tests for this type of hover, so it would be great if we could write down a reproducer rather than just being defensive.

Thanks!

@gopherbot
Copy link

Change https://go.dev/cl/399622 mentions this issue: internal/lsp/source: avoid panic in HoverIdentifier

@findleyr findleyr modified the milestones: gopls/on-deck, gopls/v0.8.4 Apr 11, 2022
@lixiangzhong
Copy link
Author

sorry,I didn't record the situation at that time, and I can't reproduce it now

@golang golang locked and limited conversation to collaborators Jun 22, 2023
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