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 deference in semanticTokensRange when viewing git diff #41873

zikaeroh opened this issue Oct 9, 2020 · 3 comments


Copy link

@zikaeroh zikaeroh commented Oct 9, 2020

ATTENTION: Please answer these questions BEFORE submitting your issue. Thanks!

What did you do?

Opened up VS Code's git diff viewer. I also run the nightly extension (which IIRC now includes semantic tokens support via an updated LSP client).

What did you expect to see?

No crash.

What did you see instead?

The server crashes with the diff open.

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

goroutine 124 [running]:*Server).semanticTokensRange(0xc0000e0bb0, 0xef58e0, 0xc00046e500, 0xc0063d9220, 0x0, 0x0, 0xc00123c160)
	/home/jake/go/pkg/mod/ +0x191*Server).SemanticTokensRange(0xc0000e0bb0, 0xef58e0, 0xc00046e500, 0xc0063d9220, 0xc0063d9220, 0x0, 0x0)
	/home/jake/go/pkg/mod/ +0x49, 0xc00046e500, 0xf09480, 0xc0000e0bb0, 0xc0063ec270, 0xef5b20, 0xc00046e480, 0x0, 0xee2e00, 0xc00123c000)
	/home/jake/go/pkg/mod/ +0x5f92, 0xc00046e500, 0xc0063ec270, 0xef5b20, 0xc00046e480, 0x328fc423, 0x134fde0)
	/home/jake/go/pkg/mod/ +0xc5, 0xc00046e500, 0xc0063ec270, 0xef5b20, 0xc00046e480, 0x0, 0x0)
	/home/jake/go/pkg/mod/ +0x452, 0xc00046e500, 0xc0003e5580, 0xef5b20, 0xc00046e480, 0x0, 0x0)
	/home/jake/go/pkg/mod/ +0xcf, 0xc0004382a0, 0xc0005be3e0, 0xef58e0, 0xc00046e500, 0xc0003e5580, 0xef5b20, 0xc00046e480)
	/home/jake/go/pkg/mod/ +0x86
created by
	/home/jake/go/pkg/mod/ +0x173
[Error - 7:24:29 PM] Connection to server got closed. Server will not be restarted.


Build info master h1:Fxf8D75bsdvDgLpM6enYCHxPn+lFAiEBFAvdk/0UJ7s= h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= h1:x1hHgXABYbwIYbEYxs6ypae/tryqQ7YQ1/DwGyKp4Ok= h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k= h1:t8TAw9WgTLghti7RYkpPmqk4JtQ3+wcP5GgZqgWeWLQ= h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
@gopherbot gopherbot added this to the Unreleased milestone Oct 9, 2020
@zikaeroh zikaeroh changed the title x/tools/gopls: nil pointer deference when viewing git diff in semanticTokensRange x/tools/gopls: nil pointer deference in semanticTokensRange when viewing git diff Oct 9, 2020
Copy link

@stamblerre stamblerre commented Oct 9, 2020

/cc @pjweinb

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.2 Oct 9, 2020
Copy link

@gopherbot gopherbot commented Oct 9, 2020

Change mentions this issue: internal/lsp: handle nil pointer in semantic tokens

Copy link
Contributor Author

@zikaeroh zikaeroh commented Oct 10, 2020

Note that the same thing seems to happen when you open up a go.mod file; not sure if it's the same fix or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants