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 parseGoWork with missing Go directive #51844

Closed
jarrettv opened this issue Mar 20, 2022 · 1 comment
Closed

x/tools/gopls: crash in parseGoWork with missing Go directive #51844

jarrettv opened this issue Mar 20, 2022 · 1 comment

Comments

@jarrettv
Copy link

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 linux
initialization error: undefined
issue timestamp: Sun, 20 Mar 2022 23:46:57 GMT
restart history:
Sun, 20 Mar 2022 23:46:50 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

Empty go.work file

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

goroutine 146 [running]:
golang.org/x/tools/internal/lsp/cache.parseGoWork({0x1001cc8, 0xc0003cb140}, {0xc000592c00, 0x25}, {0xc000592b70%3F, 0xc000610ec0%3F}, {0xc000018000, 0x0, 0x200}, {0xffb500, ...})
	  workspace.go:508  0x232
golang.org/x/tools/internal/lsp/cache.loadExplicitWorkspaceFile({0x1001cc8, 0xc0003cb140}, 0xc00015ef30, {0xffb500%3F, 0xc000290080%3F})
	  workspace.go:152  0x1e6
golang.org/x/tools/internal/lsp/cache.newWorkspace({0x1001cc8, 0xc0003cb140}, {0xc000592c00, 0x25}, {0xffb500, 0xc000290080}, 0xc000479d40, 0x0, 0x0)
	  workspace.go:106  0xbb
golang.org/x/tools/internal/lsp/cache.(*Session).createView(0xc000290080, {0x1001cc8, 0xc0003cb140}, {0xc0005a0350, 0x6}, {0xc000592000, 0x25}, 0xc0003606c0, 0x0)
	  session.go:197  0x25d
golang.org/x/tools/internal/lsp/cache.(*Session).NewView(0xc000290080, {0x1001cc8, 0xc0003cb140}, {0xc0005a0350, 0x6}, {0xc000592000, 0x25}, 0xc000118820%3F)
	  session.go:166  0x287
golang.org/x/tools/internal/lsp.(*Server).addView(0xc000472240, {0x1001cc8, 0xc0003cb140}, {0xc0005a0350, 0x6}, {0xc000592000, 0x25})
	  workspace.go:42  0x1c7
golang.org/x/tools/internal/lsp.(*Server).addFolders(0xc000472240, {0x1001cc8%3F, 0xc0003cb140}, {0xc0003ad740, 0x1, 0x1%3F})
	  general.go:234  0x6f5
golang.org/x/tools/internal/lsp.(*Server).initialized(0xc000472240, {0x1001cc8, 0xc0003cb140}, 0xc000590000%3F)
	  general.go:186  0x2fa
golang.org/x/tools/internal/lsp.(*Server).Initialized(0xc000634850%3F, {0x1001cc8%3F, 0xc0003cb140%3F}, 0xc5af00%3F)
	  server_gen.go:156  0x25
golang.org/x/tools/internal/lsp/protocol.serverDispatch({0x1001cc8, 0xc0003cb140}, {0x100cdc0, 0xc000472240}, 0xc0000b2000, {0x1001ec0, 0xc0003cb080})
	  tsserver.go:140  0x6d3
golang.org/x/tools/internal/lsp/protocol.ServerHandler.func1({0x1001cc8, 0xc0003cb140}, 0xc0000b2000, {0x1001ec0, 0xc0003cb080})
	  protocol.go:154  0x90
golang.org/x/tools/internal/lsp/lsprpc.handshaker.func1({0x1001cc8, 0xc0003cb140}, 0xc0000b2000, {0x1001ec0%3F, 0xc0003cb080%3F})
	  lsprpc.go:506  0xa43
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1({0x1001cc8, 0xc0003cb140}, 0xc00028e030, {0x1001ec0%3F, 0xc0003cb080%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 - 6:46:52 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>

@findleyr
Copy link
Contributor

Hi, sorry for the crash: this is a dupe of golang/vscode-go#2121.

@findleyr findleyr changed the title gopls: automated issue report (crash) x/tools/gopls: crash in parseGoWork with missing Go directive Mar 21, 2022
@findleyr findleyr transferred this issue from golang/vscode-go Mar 21, 2022
@findleyr findleyr added this to the gopls/v0.8.2 milestone Mar 21, 2022
@findleyr findleyr self-assigned this Mar 31, 2022
@golang golang locked and limited conversation to collaborators Jun 22, 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

3 participants