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 on open empty file in vscode with .go extension. #34597

Closed
renthraysk opened this issue Sep 29, 2019 · 2 comments
Closed

x/tools/gopls: crash on open empty file in vscode with .go extension. #34597

renthraysk opened this issue Sep 29, 2019 · 2 comments
Labels
Milestone

Comments

@renthraysk
Copy link

@renthraysk renthraysk commented Sep 29, 2019

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

$ go version
go version go1.13.1 linux/amd64

$gopls version
golang.org/x/tools/gopls v0.1.6
    golang.org/x/tools/gopls@(devel)

Patch for #34433 ( https://go-review.googlesource.com/c/tools/+/196662/ ) has been applied.

Does this issue reproduce with the latest release?

Yes

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

What did you do?

Open an empty file in vscode with a .go file extension.

Normal workflow in vscode, is press the New File button, and give it a name, vscode automatically opens and if the name ends in .go, gopls crashes.

What did you expect to see?

No crashes.

What did you see instead?

The gopls server crashed 5 times in the last 3 minutes. The server will not be restarted.

Log output

[Error - 15:55:21] Request textDocument/documentLink failed.
  Message: method "textDocument/documentLink" did not reply
  Code: -32603 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5a5cc9]

goroutine 57 [running]:
go/ast.Walk(0xc03c00, 0xc000329a40, 0xc06940, 0x0)
	/usr/local/go/src/go/ast/walk.go:349 +0x25f9
go/ast.Inspect(...)
	/usr/local/go/src/go/ast/walk.go:385
golang.org/x/tools/internal/lsp.(*Server).documentLink(0xc000183680, 0xc10b20, 0xc000230300, 0xc000388b00, 0xc000388b00, 0x0, 0x0, 0x0, 0xc0000e6630)
	/home/jared/go/src/golang.org/x/tools/internal/lsp/link.go:36 +0x2be
golang.org/x/tools/internal/lsp.(*Server).DocumentLink(0xc000183680, 0xc10b20, 0xc000230300, 0xc000388b00, 0xc000388b00, 0x0, 0x0, 0x0, 0x0)
	/home/jared/go/src/golang.org/x/tools/internal/lsp/server.go:212 +0x4d
golang.org/x/tools/internal/lsp/protocol.serverHandler.Deliver(0xc228a0, 0xc000183680, 0xc10b20, 0xc000230300, 0xc000230340, 0x0, 0x1)
	/home/jared/go/src/golang.org/x/tools/internal/lsp/protocol/tsserver.go:499 +0x3a18
golang.org/x/tools/internal/jsonrpc2.(*Conn).Run.func1(0xc000200420, 0xc000230340, 0xc0001836e0, 0xc10b20, 0xc000230300, 0x0, 0x0, 0xc000194ad0)
	/home/jared/go/src/golang.org/x/tools/internal/jsonrpc2/jsonrpc2.go:370 +0x170
created by golang.org/x/tools/internal/jsonrpc2.(*Conn).Run
	/home/jared/go/src/golang.org/x/tools/internal/jsonrpc2/jsonrpc2.go:354 +0x86a
[Error - 15:55:21] Connection to server got closed. Server will not be restarted.
@gopherbot gopherbot added this to the Unreleased milestone Sep 29, 2019
@gopherbot gopherbot added the Tools label Sep 29, 2019
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Sep 29, 2019

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 label Sep 29, 2019
@renthraysk

This comment has been minimized.

Copy link
Author

@renthraysk renthraysk commented Oct 4, 2019

Updated x/tools to master and can no longer replicate.

@renthraysk renthraysk closed this Oct 4, 2019
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
2 participants
You can’t perform that action at this time.