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: automated issue report (crash) #44300

Closed
smeadows-rewardstyle opened this issue Feb 16, 2021 · 3 comments
Closed

x/tools/gopls: automated issue report (crash) #44300

smeadows-rewardstyle opened this issue Feb 16, 2021 · 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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@smeadows-rewardstyle
Copy link

gopls version: v0.6.5
gopls flags:
extension version: 0.22.1
environment: Visual Studio Code darwin
initialization error: undefined
manual restart count: 0
total start count: 1

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=0x13d19fa]

goroutine 8923 [running]:
go/types.(*Package).Path(...)
	  package.go:31
golang.org/x/tools/internal/lsp/source.HoverIdentifier(0x1b38b60, 0xc00944b560, 0xc007b207e0, 0x0, 0x0, 0x0)
	  hover.go:190  0x43a
golang.org/x/tools/internal/lsp/source.Hover(0x1b38aa0, 0xc003a2e540, 0x1b4aaa0, 0xc008800000, 0x1b3c760, 0xc002063320, 0x4044800000000000, 0x405a400000000000, 0x1b41880, 0xc002063320, ...)
	  hover.go:64  0xdb
golang.org/x/tools/internal/lsp.(*Server).hover(0xc00019a460, 0x1b38aa0, 0xc003a2e540, 0xc00943e0c0, 0x0, 0x0, 0x0)
	  hover.go:25  0x2ce
golang.org/x/tools/internal/lsp.(*Server).Hover(0xc00019a460, 0x1b38aa0, 0xc003a2e540, 0xc00943e0c0, 0xc00943e0c0, 0x0, 0x0)
	  server_gen.go:100  0x49
golang.org/x/tools/internal/lsp/protocol.serverDispatch(0x1b38aa0, 0xc003a2e540, 0x1b4d4c0, 0xc00019a460, 0xc00943e030, 0x1b38ce0, 0xc003a2e400, 0xc00025c210, 0x1b38b60, 0xc009437b30)
	  tsserver.go:299  0x1afb
golang.org/x/tools/internal/lsp/protocol.ServerHandler.func1(0x1b38aa0, 0xc003a2e540, 0xc00943e030, 0x1b38ce0, 0xc003a2e400, 0x564fc91e, 0x1fad980)
	  protocol.go:63  0xc5
golang.org/x/tools/internal/lsp/lsprpc.handshaker.func1(0x1b38aa0, 0xc003a2e540, 0xc00943e030, 0x1b38ce0, 0xc003a2e400, 0x0, 0x0)
	  lsprpc.go:560  0x452
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1(0x1b38aa0, 0xc003a2e540, 0xc004c3e840, 0x1b38ce0, 0xc003a2e400, 0xc007d6a800, 0x1f)
	  handler.go:35  0xcf
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2(0xc00088efc0, 0xc009437d10, 0xc0008aa1b0, 0x1b38aa0, 0xc003a2e540, 0xc004c3e840, 0x1b38ce0, 0xc003a2e400)
	  handler.go:103  0x86
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
	  handler.go:100  0x173
[Error - 2:01:03 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>

@stamblerre stamblerre transferred this issue from golang/vscode-go Feb 16, 2021
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Feb 16, 2021
@stamblerre stamblerre changed the title gopls: automated issue report (crash) x/tools/ggopls: automated issue report (crash) Feb 16, 2021
@stamblerre stamblerre changed the title x/tools/ggopls: automated issue report (crash) x/tools/gopls: automated issue report (crash) Feb 16, 2021
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Feb 16, 2021
@gopherbot gopherbot added this to the Unreleased milestone Feb 16, 2021
@stamblerre stamblerre added this to the gopls/v0.6.6 milestone Feb 16, 2021
@gopherbot
Copy link

Change https://golang.org/cl/292671 mentions this issue: internal/lsp: fix nil pointer in hover when (types.Object).Pkg() is nil

@stamblerre
Copy link
Contributor

@smeadows-rewardstyle: Would you be able to share the code you were working on when you saw this crash?

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 16, 2021
@gopherbot
Copy link

Change https://golang.org/cl/292730 mentions this issue: internal/lsp: fix nil pointer in hover when (types.Object).Pkg() is nil

gopherbot pushed a commit to golang/tools that referenced this issue Feb 16, 2021
We haven't been able to reproduce this scenario, but it may be possible
when the user is in a broken state. Avoid panicking by gating every
use of obj.Pkg() with nil checks.

Fixes golang/go#44300

Change-Id: Ia0c56a7fd5d6b89795dded1efdf05838f3de8209
Reviewed-on: https://go-review.googlesource.com/c/tools/+/292671
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
(cherry picked from commit ffc2075)
Reviewed-on: https://go-review.googlesource.com/c/tools/+/292730
Reviewed-by: Robert Findley <rfindley@google.com>
@golang golang locked and limited conversation to collaborators Feb 16, 2022
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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants