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: crash in internal/lsp.(*Server).handleFatalErrors (v0.5.1) #42240

Closed
mellaught opened this issue Oct 27, 2020 · 5 comments
Closed

x/tools/gopls: crash in internal/lsp.(*Server).handleFatalErrors (v0.5.1) #42240

mellaught opened this issue Oct 27, 2020 · 5 comments
Labels
Milestone

Comments

@mellaught
Copy link

@mellaught mellaught commented Oct 27, 2020

gopls version: v0.5.1
gopls flags:

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x8 pc=0x4b9845]

goroutine 32 [running]:
os.(*fileStat).Name(0x0, 0xc00097c840, 0x40)
	  types.go:108  0x5
golang.org/x/tools/internal/lsp.(*Server).handleFatalErrors.func1(0xc00097c840, 0x40, 0xeee8c0, 0x0, 0xed6280, 0xc001d9eab0, 0x0, 0x0)
	  diagnostics.go:400  0x45
path/filepath.walk(0xc00097c380, 0x3c, 0xeee8c0, 0xc0004a0000, 0xc001d656e8, 0x0, 0x1)
	  path.go:380  0x213
path/filepath.Walk(0xc00097c380, 0x3c, 0xc001d656e8, 0x3c, 0x5)
	  path.go:406  0x106
golang.org/x/tools/internal/lsp.(*Server).handleFatalErrors(0xc000078320, 0xee9140, 0xc00033ccc0, 0xefe780, 0xc0000f4240, 0xed5b60, 0xc000820b40, 0xed5b60, 0xc000820b40, 0xc00033cd50)
	  diagnostics.go:399  0x11b
golang.org/x/tools/internal/lsp.(*Server).diagnose(0xc000078320, 0xee9740, 0xc0003120d0, 0xefe780, 0xc0000f4240, 0xc000292000, 0x0, 0x0)
	  diagnostics.go:115  0xb58
golang.org/x/tools/internal/lsp.(*Server).diagnoseDetached(0xc000078320, 0xefe780, 0xc0000f4240)
	  diagnostics.go:36  0xdb
golang.org/x/tools/internal/lsp.(*Server).addFolders.func3(0xc000078320, 0xefe780, 0xc0000f4240, 0xc00060f890, 0xc000161190, 0xc00028bed0)
	  general.go:224  0x46
created by golang.org/x/tools/internal/lsp.(*Server).addFolders
	  general.go:223  0xc7d
[Error - 13:32:05] 

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>

@hyangah
Copy link
Contributor

@hyangah hyangah commented Oct 28, 2020

@mellaught Thanks for the report - can you try if you still see the crash when using the pre-release of v0.5.2? On Linux or mac, the following command will install the desired version to the $GOPATH/bin.

$ cd ~
$ GO111MODULE=on go get golang.org/x/tools/gopls@v0.5.2-pre.1

And I am transferring this issue to gopls issue tracker.

@stamblerre - can you please check if this is a known issue?

@hyangah hyangah changed the title gopls: automated issue report (crash) x/tools/gopls: crash in internal/lsp.(*Server).handleFatalErrors (v0.5.1) Oct 28, 2020
@hyangah hyangah transferred this issue from golang/vscode-go Oct 28, 2020
@gopherbot gopherbot added this to the Unreleased milestone Oct 28, 2020
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Oct 28, 2020

Thanks for the report. It was an unknown issue--just mailed a fix, which will be part of the v0.5.2 release.

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 28, 2020

Change https://golang.org/cl/265763 mentions this issue: internal/lsp: handle nil pointer exceptions in check for Go files

@mellaught
Copy link
Author

@mellaught mellaught commented Oct 28, 2020

I have fixed it. Run go get golang.org/x/tools/gopls. Thx for your replies!

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 28, 2020

Change https://golang.org/cl/265977 mentions this issue: internal/lsp: handle nil pointer exceptions in check for Go files

gopherbot pushed a commit to golang/tools that referenced this issue Oct 28, 2020
Fixes golang/go#42240

Change-Id: I48382613c9eb9d021a9e1dc9ca6ab6b4b1dfcf8f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/265763
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
(cherry picked from commit 8cd080b)
Reviewed-on: https://go-review.googlesource.com/c/tools/+/265977
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.