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/cmd/gopls: panic in (*goFile).GetAST #32478

Closed
muirdm opened this issue Jun 7, 2019 · 2 comments
Closed

x/tools/cmd/gopls: panic in (*goFile).GetAST #32478

muirdm opened this issue Jun 7, 2019 · 2 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.
Milestone

Comments

@muirdm
Copy link

muirdm commented Jun 7, 2019

Just saw this on master (5aed782) as I was debugging a different gopls issue. I think my packages/files were in an unexpected state due to the "parse: no package found for ..." issue I was experiencing.

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

goroutine 7 [running]:
golang.org/x/tools/internal/lsp/cache.(*goFile).GetAST(0xc01eaaff00, 0x1757be0, 0xc03bcde7e0, 0x0)
	/Users/muir/projects/tools/internal/lsp/cache/gofile.go:64 +0x119
golang.org/x/tools/internal/lsp/source.DocumentSymbols(0x1757be0, 0xc03bcde7e0, 0x175eee0, 0xc01eaaff00, 0xc0389685f0, 0x4e, 0x175eee0)
	/Users/muir/projects/tools/internal/lsp/source/symbols.go:45 +0x8d
golang.org/x/tools/internal/lsp.(*Server).documentSymbol(0xc0001723f0, 0x1757be0, 0xc03bcde7e0, 0xc03c43d4a0, 0xc03c43d4a0, 0x0, 0x0, 0x0, 0xc03af48460)
	/Users/muir/projects/tools/internal/lsp/symbols.go:22 +0x138
golang.org/x/tools/internal/lsp.(*Server).DocumentSymbol(0xc0001723f0, 0x1757be0, 0xc03bcde7e0, 0xc03c43d4a0, 0xc03c43d4a0, 0x0, 0x0, 0x0, 0x0)
	/Users/muir/projects/tools/internal/lsp/server.go:198 +0x4d
golang.org/x/tools/internal/lsp/protocol.serverHandler.func1(0x1757be0, 0xc03bcde7e0, 0xc000172460, 0xc03a230860)
	/Users/muir/projects/tools/internal/lsp/protocol/tsserver.go:335 +0x53bc
golang.org/x/tools/internal/jsonrpc2.(*Conn).Run.func1(0xc000093860, 0xc000172460)
	/Users/muir/projects/tools/internal/jsonrpc2/jsonrpc2.go:288 +0x189
created by golang.org/x/tools/internal/jsonrpc2.(*Conn).Run
	/Users/muir/projects/tools/internal/jsonrpc2/jsonrpc2.go:278 +0xba
@gopherbot gopherbot added this to the Unreleased milestone Jun 7, 2019
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jun 7, 2019
@stamblerre
Copy link
Contributor

I think https://golang.org/cl/180857 should fix this.

@muirdm
Copy link
Author

muirdm commented Jun 10, 2019

Closing. Will reopen if I see it again.

@muirdm muirdm closed this as completed Jun 10, 2019
@golang golang locked and limited conversation to collaborators Jun 9, 2020
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.
Projects
None yet
Development

No branches or pull requests

3 participants