Skip to content

gopls: automated issue report (crash) #2923

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

Closed
WAY29 opened this issue Aug 7, 2023 · 4 comments
Closed

gopls: automated issue report (crash) #2923

WAY29 opened this issue Aug 7, 2023 · 4 comments

Comments

@WAY29
Copy link

WAY29 commented Aug 7, 2023

gopls version: v0.13.1 (go1.20.5)
gopls flags:
update flags: proxy
extension version: 0.39.1
go version: 1.20.5
environment: Visual Studio Code linux
initialization error: undefined
issue timestamp: Mon, 07 Aug 2023 14:46:23 GMT
restart history:
Mon, 07 Aug 2023 14:41:51 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

I'm working for yaklang, and when I try to refactor function name in feat/vm/dap branch, I get no results and the refactoring fails, and when I try a few more times, gopls crashes。

panic: unexpected composite literal type: *github.com/yaklang/yaklang/common/yak/antlr4yak/yakvm.buildinMethod

goroutine 12346 [running]:
golang.org/x/tools/refactor/satisfy.(*Finder).expr(0xc01bcee3c0, {0x116d600, 0xc006afca80})
	  find.go:389  0xdda
golang.org/x/tools/refactor/satisfy.(*Finder).expr(0xc01bcee3c0, {0x116d600, 0xc006b324c0})
	  find.go:372  0xe65
golang.org/x/tools/refactor/satisfy.(*Finder).stmt(0xc01bcee3c0, {0x116d3c0%3F, 0xc006b32500%3F})
	  find.go:538  0x112a
golang.org/x/tools/refactor/satisfy.(*Finder).stmt(0xc01bcee3c0, {0x116d4e0%3F, 0xc008f84ae0%3F})
	  find.go:588  0xe45
golang.org/x/tools/refactor/satisfy.(*Finder).Find(0xc01bcee3c0, 0xc00a885a40%3F, {0xc012309900, 0x20, 0x0%3F})
	  find.go:106  0x1e5
golang.org/x/tools/gopls/internal/lsp/source.(*renamer).satisfy(0xc00b8abe80)
	  rename_check.go:836  0xd3
golang.org/x/tools/gopls/internal/lsp/source.(*renamer).checkMethod(0xc00b8abe80, 0xc009486d80)
	  rename_check.go:753  0x3d3
golang.org/x/tools/gopls/internal/lsp/source.(*renamer).check(0xc00b8abe80, {0x1177978, 0xc009486d80})
	  rename_check.go:105  0x167
golang.org/x/tools/gopls/internal/lsp/source.renameObjects({0xc01a8c2f00%3F, 0xe92f60%3F}, {0x116ec98%3F, 0xc0111c6de0%3F}, {0xc0104ab4f6, 0x5}, {0x1174f68, 0xc00f3ae510}, {0xc01a287300, 0x1, ...})
	  rename.go:1031  0x26e
golang.org/x/tools/gopls/internal/lsp/source.renameExported({0x116ec98, 0xc01033d7a0}, {0x117c170, 0xc0058b8580}, {0xc0111fa000, 0x100, 0xef6f8c%3F}, {0xc0009bc940, 0x3d}, {0xc011194ff0, ...}, ...)
	  rename.go:608  0x259
golang.org/x/tools/gopls/internal/lsp/source.renameOrdinary({0x116ec98, 0xc01033d7a0}, {0x117c170, 0xc0058b8580}, {0x116fb20, 0xc002607440}, {0xddc520%3F, 0x0%3F}, {0xc0104ab4f6, 0x5})
	  rename.go:448  0x8fb
golang.org/x/tools/gopls/internal/lsp/source.Rename({0x116ec98%3F, 0xc01033d650%3F}, {0x117c170, 0xc0058b8580}, {0x116fb20, 0xc002607440}, {0xafa6a20%3F, 0xc0%3F}, {0xc0104ab4f6, 0x5})
	  rename.go:234  0x1d7
golang.org/x/tools/gopls/internal/lsp.(*Server).rename(0xd6e580%3F, {0x116ebf0, 0xc0108fd5e0}, 0xc006defa00)
	  rename.go:29  0x24b
golang.org/x/tools/gopls/internal/lsp.(*Server).Rename(0xc00d0a0370%3F, {0x116ebf0%3F, 0xc0108fd5e0%3F}, 0xd6e580%3F)
	  server_gen.go:216  0x25
golang.org/x/tools/gopls/internal/lsp/protocol.serverDispatch({0x116ebf0, 0xc0108fd5e0}, {0x117fd10, 0xc00013efc0}, 0xc01033d4a0, {0x116eec8, 0xc006df9640})
	  tsserver.go:537  0xe05
golang.org/x/tools/gopls/internal/lsp/protocol.ServerHandler.func1({0x116ebf0, 0xc0108fd5e0}, 0xc01033d4a0, {0x116eec8, 0xc006df9640})
	  protocol.go:157  0x90
golang.org/x/tools/gopls/internal/lsp/lsprpc.handshaker.func1({0x116ebf0, 0xc0108fd5e0}, 0xc01033d4a0, {0x116eec8%3F, 0xc006df9640%3F})
	  lsprpc.go:519  0x9f9
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1({0x116ebf0, 0xc0108fd5e0}, 0xc0108ebe60, {0x116eec8%3F, 0xc006df9640%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 - 10:46:20 PM] 

Full Log:
full_log.txt

@gopherbot gopherbot added this to the Untriaged milestone Aug 7, 2023
@findleyr
Copy link
Member

findleyr commented Aug 7, 2023

Great, thanks very much for the reproducer. We will fix.

@findleyr
Copy link
Member

findleyr commented Aug 7, 2023

Closing as a dupe of golang/go#61813. Will fix with high priority.

@findleyr
Copy link
Member

findleyr commented Aug 7, 2023

@WAY29 I'm trying to reproduce this, but it matters which package the renaming occurs in.

Do you remember which package you were editing when you observed the panic?

Hmm, well of course the panic message contains the package name. But I'm still unable to reproduce in the yakvm package.

@findleyr
Copy link
Member

findleyr commented Aug 7, 2023

Aha, I have reproduced (rename a method on the buildinMethod type)! Thanks again.

@golang golang locked and limited conversation to collaborators Aug 6, 2024
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