golang/go

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

Closed this issue · 3 comments

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>

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

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

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