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 related to overlay file #32929

Closed
muirrn opened this issue Jul 3, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@muirrn
Copy link

commented Jul 3, 2019

I had a file open in my editor that no longer existed on disk. After restarting gopls one time I saw this panic:

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

goroutine 41298 [running]:
golang.org/x/tools/internal/lsp/cache.(*view).link(0xc0001cf380, 0x1789ea0, 0xc014129a40, 0xc00e6a71a0, 0x25, 0xc005cff0e0, 0x0, 0xc012cfe060, 0x0, 0x0)
	/Users/muir/projects/tools/internal/lsp/cache/load.go:223 +0x8df
golang.org/x/tools/internal/lsp/cache.(*view).checkMetadata(0xc0001cf380, 0x1789ea0, 0xc014129a40, 0xc00ee0e960, 0x1e006d0, 0x203005, 0x203005, 0x0, 0x1, 0x3)
	/Users/muir/projects/tools/internal/lsp/cache/load.go:109 +0x488
golang.org/x/tools/internal/lsp/cache.(*view).loadParseTypecheck(0xc0001cf380, 0x1789ea0, 0xc014129a40, 0xc00ee0e960, 0x0, 0x0, 0x0, 0x0, 0x0)
	/Users/muir/projects/tools/internal/lsp/cache/load.go:29 +0xf5
golang.org/x/tools/internal/lsp/cache.(*goFile).GetPackages(0xc00ee0e960, 0x1789ea0, 0xc014129a40, 0x0, 0x0, 0x0)
	/Users/muir/projects/tools/internal/lsp/cache/gofile.go:112 +0x323
golang.org/x/tools/internal/lsp/cache.(*goFile).GetPackage(0xc00ee0e960, 0x1789ea0, 0xc014129a40, 0x3f, 0x1)
	/Users/muir/projects/tools/internal/lsp/cache/gofile.go:137 +0x4c
golang.org/x/tools/internal/lsp/source.Diagnostics(0x1789ea0, 0xc014129a40, 0x1793ae0, 0xc0001cf380, 0x17926e0, 0xc00ee0e960, 0x0, 0x0, 0x0, 0xc00b848e68)
	/Users/muir/projects/tools/internal/lsp/source/diagnostics.go:62 +0x66
golang.org/x/tools/internal/lsp.(*Server).Diagnostics(0xc00023c000, 0x1789ea0, 0xc014129a40, 0x1793ae0, 0xc0001cf380, 0xc00ed22180, 0x3f)
	/Users/muir/projects/tools/internal/lsp/diagnostics.go:27 +0x268
golang.org/x/tools/internal/lsp.(*Server).didOpen.func1(0x1793ae0, 0xc0001cf380, 0xc00023c000, 0xc00ed22180, 0x3f)
	/Users/muir/projects/tools/internal/lsp/text_synchronization.go:29 +0x67
created by golang.org/x/tools/internal/lsp.(*Server).didOpen
	/Users/muir/projects/tools/internal/lsp/text_synchronization.go:27 +0x145

It looks like there are a couple missing continues in the code there.

I'm not sure exactly what happened to get it into this state (couldn't reproduce it). Even if it didn't panic it seems like my overlay file was not going to work anymore.

@gopherbot gopherbot added this to the Unreleased milestone Jul 3, 2019

@gopherbot gopherbot added the gopls label Jul 3, 2019

@gopherbot

This comment has been minimized.

Copy link

commented Jul 14, 2019

Change https://golang.org/cl/185994 mentions this issue: internal/lsp: fix panics in loading, add more logging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.