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: slice bounds out of range - internal/lsp/cache.fixArrayType #58943

Closed
notchi590 opened this issue Mar 7, 2023 · 2 comments
Closed
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@notchi590
Copy link

gopls version: v0.11.0 (go1.18.4)
gopls flags:
update flags: proxy
extension version: 0.38.0
go version: 1.18.4
environment: code-server linux
initialization error: undefined
issue timestamp: Tue, 07 Mar 2023 07:41:02 GMT
restart history:
Tue, 07 Mar 2023 05:37:17 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

panic: runtime error: slice bounds out of range [:33306] with capacity 33305

goroutine 4001 [running]:
golang.org/x/tools/gopls/internal/lsp/cache.fixArrayType(0xc005d21020, {0x10a4700, 0xc005d2ac40}, 0x0%3F, {0xc005736000, 0xc0049556e0%3F, 0x8219})
	  parse.go:996  0x31c
golang.org/x/tools/gopls/internal/lsp/cache.fixAST.func1({0x10a45c0%3F, 0xc005d21020%3F}, {0x10a4700%3F, 0xc005d2ac40})
	  parse.go:568  0x23f
golang.org/x/tools/gopls/internal/lsp/cache.walkASTWithParent.func1({0x10a45c0%3F, 0xc005d21020%3F})
	  parse.go:628  0xbe
go/ast.inspector.Visit(0xc0059e7fe0, {0x10a45c0%3F, 0xc005d21020%3F})
	  walk.go:387  0x31
go/ast.Walk({0x10a30c0%3F, 0xc0059e7fe0%3F}, {0x10a45c0%3F, 0xc005d21020%3F})
	  walk.go:52  0x62
go/ast.walkExprList({0x10a30c0, 0xc0059e7fe0}, {0xc0059f6a00%3F, 0x9, 0x50e511%3F})
	  walk.go:26  0x91
go/ast.Walk({0x10a30c0%3F, 0xc0059e7fe0%3F}, {0x10a4700%3F, 0xc005d2ac40%3F})
	  walk.go:145  0xa8b
go/ast.walkExprList({0x10a30c0, 0xc0059e7fe0}, {0xc005d18960%3F, 0x1, 0x50e511%3F})
	  walk.go:26  0x91
go/ast.Walk({0x10a30c0%3F, 0xc0059e7fe0%3F}, {0x10a4570%3F, 0xc005d2ac80%3F})
	  walk.go:218  0x1548
go/ast.walkStmtList({0x10a30c0, 0xc0059e7fe0}, {0xc0059af800%3F, 0x7, 0x10a8a70%3F})
	  walk.go:32  0x91
go/ast.Walk({0x10a30c0%3F, 0xc0059e7fe0%3F}, {0x10a46b0%3F, 0xc005d11ec0%3F})
	  walk.go:235  0x10e5
go/ast.Walk({0x10a30c0%3F, 0xc0059e7fe0%3F}, {0x10a4a20%3F, 0xc005d18970%3F})
	  walk.go:100  0x1c36
go/ast.Walk({0x10a30c0%3F, 0xc0059e7fe0%3F}, {0x10a4700%3F, 0xc005d2ad00%3F})
	  walk.go:144  0xa65
go/ast.Walk({0x10a30c0%3F, 0xc0059e7fe0%3F}, {0x10a4a98%3F, 0xc005d18080%3F})
	  walk.go:221  0x695
go/ast.walkStmtList({0x10a30c0, 0xc0059e7fe0}, {0xc0059fd280%3F, 0x3, 0xc005d16be0%3F})
	  walk.go:32  0x91
go/ast.Walk({0x10a30c0%3F, 0xc0059e7fe0%3F}, {0x10a46b0%3F, 0xc0059fa900%3F})
	  walk.go:235  0x10e5
go/ast.Inspect(...)
	  walk.go:399
golang.org/x/tools/gopls/internal/lsp/cache.walkASTWithParent({0x10a46b0%3F, 0xc0059fa900%3F}, 0xc005d16be0%3F)
	  parse.go:611  0xac
golang.org/x/tools/gopls/internal/lsp/cache.fixAST({0x10a8a70%3F, 0xc0049556e0}, {0x10a46b0, 0xc0059fa900}, 0xc00527c240, {0xc005736000, 0x8219, 0x8219})
	  parse.go:557  0x147
golang.org/x/tools/gopls/internal/lsp/cache.fixAST.func1({0x10a45e8%3F, 0xc0059d9210%3F}, {0x10a46b0%3F, 0xc0059fa900})
	  parse.go:562  0x1af
golang.org/x/tools/gopls/internal/lsp/cache.walkASTWithParent.func1({0x10a45e8%3F, 0xc0059d9210%3F})
	  parse.go:628  0xbe
go/ast.inspector.Visit(0xc0059e76c8, {0x10a45e8%3F, 0xc0059d9210%3F})
	  walk.go:387  0x31
go/ast.Walk({0x10a30c0%3F, 0xc0059e76c8%3F}, {0x10a45e8%3F, 0xc0059d9210%3F})
	  walk.go:52  0x62
go/ast.walkStmtList({0x10a30c0, 0xc0059e76c8}, {0xc0059fd280%3F, 0x3, 0x10a8a70%3F})
	  walk.go:32  0x91
go/ast.Walk({0x10a30c0%3F, 0xc0059e76c8%3F}, {0x10a46b0%3F, 0xc0059fa900%3F})
	  walk.go:235  0x10e5
go/ast.Walk({0x10a30c0%3F, 0xc0059e76c8%3F}, {0x10a49f8%3F, 0xc0059fa930%3F})
	  walk.go:358  0x4b0
go/ast.walkDeclList({0x10a30c0, 0xc0059e76c8}, {0xc0059f6500%3F, 0x9, 0xc005d16410%3F})
	  walk.go:38  0x91
go/ast.Walk({0x10a30c0%3F, 0xc0059e76c8%3F}, {0x10a49a8%3F, 0xc0059af680%3F})
	  walk.go:367  0x1890
go/ast.Inspect(...)
	  walk.go:399
golang.org/x/tools/gopls/internal/lsp/cache.walkASTWithParent({0x10a49a8%3F, 0xc0059af680%3F}, 0xc005d16410%3F)
	  parse.go:611  0xac
golang.org/x/tools/gopls/internal/lsp/cache.fixAST({0x10a8a70%3F, 0xc0049556e0}, {0x10a49a8, 0xc0059af680}, 0xc00527c240, {0xc005736000, 0x8219, 0x8219})
	  parse.go:557  0x147
golang.org/x/tools/gopls/internal/lsp/cache.parseGoImpl({0x10a89c8, 0xc00497a6c0}, 0xd37c80%3F, {0x10a8cd8, 0xc0002783f0}, 0x2)
	  parse.go:195  0x9a5
golang.org/x/tools/gopls/internal/lsp/cache.(*snapshot).ParseGo.func1({0x10a89c8%3F, 0xc00497a6c0%3F}, {0xe1de80%3F, 0xc0030e4b00%3F})
	  parse.go:63  0x59
golang.org/x/tools/internal/memoize.(*Promise).run.func2.1()
	  memoize.go:187  0xa9
runtime/trace.WithRegion({0x10a89c8%3F, 0xc00497a6c0%3F}, {0xc0049568c0, 0x1a}, 0xc00012cf90)
	  annotation.go:141  0xe3
golang.org/x/tools/internal/memoize.(*Promise).run.func2()
	  memoize.go:180  0x145
created by golang.org/x/tools/internal/memoize.(*Promise).run
	  memoize.go:179  0x1d0
[Error - 4:40:49 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>

@hyangah hyangah changed the title gopls: automated issue report (crash) x/tools/gopls: slice bounds out of range - internal/lsp/cache.fixArrayType Mar 8, 2023
@hyangah hyangah transferred this issue from golang/vscode-go Mar 8, 2023
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Mar 8, 2023
@gopherbot gopherbot added this to the Unreleased milestone Mar 8, 2023
@hyangah hyangah modified the milestones: Unreleased, gopls/v0.12.0 Mar 8, 2023
@adonovan
Copy link
Member

adonovan commented Mar 9, 2023

The file has since changed but this is the failing operation in v0.11.0:

https://cs.opensource.google/go/x/tools/+/refs/tags/gopls/v0.11.0:gopls/internal/lsp/cache/parse.go;l=996

@adonovan
Copy link
Member

adonovan commented Apr 7, 2023

This is a dup of #57484, which is fixed.

@adonovan adonovan closed this as completed Apr 7, 2023
@golang golang locked and limited conversation to collaborators Apr 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants