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/internal/lsp: nil pointer panic in definition.go #31604

Closed
muirdm opened this issue Apr 21, 2019 · 1 comment
Closed

x/tools/internal/lsp: nil pointer panic in definition.go #31604

muirdm opened this issue Apr 21, 2019 · 1 comment

Comments

@muirdm
Copy link

muirdm commented Apr 21, 2019

gopls occasionally crashes with the below panic. I don't have a repro or even a good description of what I am doing when it happens. I think it happens after files change via version control.

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

goroutine 5 [running]:
golang.org/x/tools/internal/lsp/source.identifier(0x14d4600, 0xc010a35180, 0x14d4780, 0xc0001f8000, 0x14d8000, 0xc000437c20, 0x23c70, 0x18b, 0x44, 0x2fb8)
	/Users/muir/projects/tools/internal/lsp/source/identifier.go:57 +0xc1
golang.org/x/tools/internal/lsp/source.Identifier(0x14d4600, 0xc010a35180, 0x14d4780, 0xc0001f8000, 0x14d8000, 0xc000437c20, 0x23c70, 0x2fb8, 0xc00ccfac80, 0xc0001ae780)
	/Users/muir/projects/tools/internal/lsp/source/identifier.go:40 +0x7d
golang.org/x/tools/internal/lsp.(*Server).hover(0xc0000bc7e0, 0x14d4600, 0xc010a35180, 0xc00c0c4960, 0x0, 0x0, 0xc005ffeaa0)
	/Users/muir/projects/tools/internal/lsp/hover.go:31 +0x24d
golang.org/x/tools/internal/lsp.(*Server).Hover(0xc0000bc7e0, 0x14d4600, 0xc010a35180, 0xc00c0c4960, 0xc00c0c4960, 0x0, 0x0)
	/Users/muir/projects/tools/internal/lsp/server.go:170 +0x49
golang.org/x/tools/internal/lsp/protocol.serverHandler.func1(0x14d4600, 0xc010a35180, 0xc00015a3f0, 0xc006325ec0)
	/Users/muir/projects/tools/internal/lsp/protocol/server.go:248 +0x12bf
golang.org/x/tools/internal/jsonrpc2.(*Conn).Run.func1(0xc000082960, 0xc00015a3f0)
	/Users/muir/projects/tools/internal/jsonrpc2/jsonrpc2.go:276 +0xda
created by golang.org/x/tools/internal/jsonrpc2.(*Conn).Run
	/Users/muir/projects/tools/internal/jsonrpc2/jsonrpc2.go:270 +0xba
@gopherbot gopherbot added this to the Unreleased milestone Apr 21, 2019
@gopherbot
Copy link

Change https://golang.org/cl/172968 mentions this issue: internal/lsp: add check for nil package

@golang golang locked and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants