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: nil pointer panic on current master #36020

Closed
bmhatfield opened this issue Dec 6, 2019 · 4 comments
Closed

x/tools/gopls: nil pointer panic on current master #36020

bmhatfield opened this issue Dec 6, 2019 · 4 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.
Milestone

Comments

@bmhatfield
Copy link

What version of Go are you using (go version)?

1.13.4

Does this issue reproduce with the latest release?

This issue reproduces with current x/tools master (3393d29b)

What operating system and processor architecture are you using (go env)?

OSX / VSCode

What did you do?

I use VSCode with multiple "top level" folders in my workspace. Only one of these workspace top level folders is a go repository.

See also #35455 and #35468 for a description of my environment. Though the error is different, the underlying setup remains the same.

Note that the directory referenced in the error here (schema) does not have Go code within it.

2019/12/06 11:47:01 failed to load snapshot: no packages found for query ./...
	directory = file:///Users/bhatfield/Documents/digits/schema
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x1593785]

goroutine 12691 [running]:
golang.org/x/tools/internal/lsp/cache.(*snapshot).View(0x0, 0xc001257cd0, 0x0)
	/Users/bhatfield/go/src/github.com/golang/tools/internal/lsp/cache/snapshot.go:61 +0x5
golang.org/x/tools/internal/lsp.(*Server).diagnoseSnapshot(0xc00020c960, 0x18516e0, 0x0)
	/Users/bhatfield/go/src/github.com/golang/tools/internal/lsp/diagnostics.go:20 +0x69
created by golang.org/x/tools/internal/lsp.(*Server).addFolders
	/Users/bhatfield/go/src/github.com/golang/tools/internal/lsp/general.go:173 +0x600

What did you expect to see?

No crash.

What did you see instead?

VSCode told me that gopls was repeatedly crashing

@gopherbot gopherbot added this to the Unreleased milestone Dec 6, 2019
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Dec 6, 2019
@gopherbot
Copy link

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Dec 6, 2019
@bmhatfield
Copy link
Author

I just spent some time trying different commits, and this error was introduced with a5887330 - cc @stamblerre

@gopherbot
Copy link

Change https://golang.org/cl/210215 mentions this issue: internal/lsp: fix error suppression in (*session).createView

@stamblerre
Copy link
Contributor

Thank you for tracking this down! Just mailed a fix.

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.
Projects
None yet
Development

No branches or pull requests

3 participants