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

gopls: automated issue report (crash) #2121

Closed
ghost opened this issue Mar 18, 2022 · 2 comments
Closed

gopls: automated issue report (crash) #2121

ghost opened this issue Mar 18, 2022 · 2 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Mar 18, 2022

gopls version: v0.8.1 (go1.18)
gopls flags:
update flags: proxy
extension version: 0.32.0
go version: 1.18
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Fri, 18 Mar 2022 17:49:28 GMT
restart history:
Fri, 18 Mar 2022 17:49:23 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

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

goroutine 115 [running]:
golang.org/x/tools/internal/lsp/cache.parseGoWork({0x1c01bd8, 0xc0002cd2f0}, {0xc00032a390, 0x30}, {0xc000664100%3F, 0xc0004e6ec0%3F}, {0xc00064e400, 0x0, 0x200}, {0x1bfb300, ...})
	  workspace.go:508  0x232
golang.org/x/tools/internal/lsp/cache.loadExplicitWorkspaceFile({0x1c01bd8, 0xc0002cd2f0}, 0xc00065e480, {0x1bfb300%3F, 0xc00061a080%3F})
	  workspace.go:152  0x1e6
golang.org/x/tools/internal/lsp/cache.newWorkspace({0x1c01bd8, 0xc0002cd2f0}, {0xc00032a390, 0x30}, {0x1bfb300, 0xc00061a080}, 0xc000650540, 0x0, 0x0)
	  workspace.go:106  0xbb
golang.org/x/tools/internal/lsp/cache.(*Session).createView(0xc00061a080, {0x1c01bd8, 0xc0002cd2f0}, {0xc000039e10, 0xd}, {0xc000120510, 0x30}, 0xc0001e0240, 0x0)
	  session.go:197  0x25d
golang.org/x/tools/internal/lsp/cache.(*Session).NewView(0xc00061a080, {0x1c01bd8, 0xc0002cd2f0}, {0xc000039e10, 0xd}, {0xc000120510, 0x30}, 0xc000481590%3F)
	  session.go:166  0x287
golang.org/x/tools/internal/lsp.(*Server).addView(0xc0002ce000, {0x1c01bd8, 0xc0002cd2f0}, {0xc000039e10, 0xd}, {0xc000120510, 0x30})
	  workspace.go:42  0x1c7
golang.org/x/tools/internal/lsp.(*Server).addFolders(0xc0002ce000, {0x1c01bd8%3F, 0xc0002cd2f0}, {0xc0002c3940, 0x1, 0x1%3F})
	  general.go:234  0x6f5
golang.org/x/tools/internal/lsp.(*Server).initialized(0xc0002ce000, {0x1c01bd8, 0xc0002cd2f0}, 0xc0004da090%3F)
	  general.go:186  0x2fa
golang.org/x/tools/internal/lsp.(*Server).Initialized(0xc0006b0830%3F, {0x1c01bd8%3F, 0xc0002cd2f0%3F}, 0x1859da0%3F)
	  server_gen.go:156  0x25
golang.org/x/tools/internal/lsp/protocol.serverDispatch({0x1c01bd8, 0xc0002cd2f0}, {0x1c0cd40, 0xc0002ce000}, 0xc000373cb0, {0x1c01dd0, 0xc0002cd230})
	  tsserver.go:140  0x6d3
golang.org/x/tools/internal/lsp/protocol.ServerHandler.func1({0x1c01bd8, 0xc0002cd2f0}, 0xc000373cb0, {0x1c01dd0, 0xc0002cd230})
	  protocol.go:154  0x90
golang.org/x/tools/internal/lsp/lsprpc.handshaker.func1({0x1c01bd8, 0xc0002cd2f0}, 0xc000373cb0, {0x1c01dd0%3F, 0xc0002cd230%3F})
	  lsprpc.go:506  0xa43
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1({0x1c01bd8, 0xc0002cd2f0}, 0xc0002a89f0, {0x1c01dd0%3F, 0xc0002cd230%3F})
	  handler.go:35  0xf6
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2()
	  handler.go:103  0xa3
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
	  handler.go:100  0x20a
[Error - 8:49:23 PM] 

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>

@gopherbot gopherbot added this to the Untriaged milestone Mar 18, 2022
@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/393856 mentions this issue: internal/lsp/cache: check for nil WorkFile.Go

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/397355 mentions this issue: gopls/internal/regtests: add a test for bad go.work files

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Apr 9, 2022
New Features

Fuzz target inference: Gopls will now infer the type of Fuzz targets from
preceding testing.F.Add statements.

Generic completion improvements: This release includes several improvements to
auto-completion of generic code. For example, completion of type or function
instantiation now prefers types that are in terms of the constraint type set.

Bugfixes

The timing of this release is primarily driven by golang/vscode-go#2121, a
panic when go.work files are missing a go directive. We received enough reports
of this crash to know that it was affecting a significant number of users.
Thanks to all those who reported issues - your diligence helps us make gopls
better!
gopherbot pushed a commit to golang/tools that referenced this issue May 17, 2022
Add a test that would have reproduced the panic from
golang/vscode-go#2121.

For golang/vscode-go#2121

Change-Id: Idb07dc0789b51e3056e0b3d0910916ec35931ac4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/397355
Run-TryBot: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Mar 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants