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: automated issue report (crash) #48763

Closed
reflog opened this issue Oct 4, 2021 · 2 comments
Closed

x/tools/gopls: automated issue report (crash) #48763

reflog opened this issue Oct 4, 2021 · 2 comments
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

@reflog
Copy link

reflog commented Oct 4, 2021

gopls version: v0.7.2
gopls flags:
update flags: proxy
extension version: 0.28.1
go version: 1.16.6
environment: Visual Studio Code - Insiders linux
initialization error: undefined
issue timestamp: Mon, 04 Oct 2021 09:05:51 GMT
restart history:
Thu, 30 Sep 2021 08:37:00 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

panic: invalid Pos value 5481227 (should be in [5479891, 5481226[)

goroutine 815 [running]:
go/token.(*File).Offset(0xc002a4cf00, 0x53a30b, 0x537)
	  position.go:281  0x146
golang.org/x/tools/internal/lsp/cache.fixInitStmt(0xc002faf1f0, 0xfd0668, 0xc003083300, 0xc002a4cf00, 0xc0017d7b80, 0x537, 0x580)
	  parse.go:998  0x7b
golang.org/x/tools/internal/lsp/cache.fixAST.func1(0xfd0500, 0xc002faf1f0, 0xfd0668, 0xc003083300, 0x7f74e5567301)
	  parse.go:700  0x3d7
golang.org/x/tools/internal/lsp/cache.walkASTWithParent.func1(0xfd0500, 0xc002faf1f0, 0xc00308a000)
	  parse.go:748  0xb2
go/ast.inspector.Visit(0xc00308a0c0, 0xfd0500, 0xc002faf1f0, 0x0, 0x0)
	  walk.go:373  0x3a
go/ast.Walk(0xfcdb20, 0xc00308a0c0, 0xfd0500, 0xc002faf1f0)
	  walk.go:52  0x63
go/ast.walkExprList(0xfcdb20, 0xc00308a0c0, 0xc003083280, 0x4, 0x4)
	  walk.go:26  0x9e
go/ast.Walk(0xfcdb20, 0xc00308a0c0, 0xfd0668, 0xc003083300)
	  walk.go:137  0xfc5
go/ast.Walk(0xfcdb20, 0xc00308a0c0, 0xfd08c0, 0xc002feb520)
	  walk.go:196  0x1a05
go/ast.walkStmtList(0xfcdb20, 0xc00308a0c0, 0xc002feb530, 0x1, 0x1)
	  walk.go:32  0x9e
go/ast.Walk(0xfcdb20, 0xc00308a0c0, 0xfd0618, 0xc002fc3bf0)
	  walk.go:224  0x1968
go/ast.Walk(0xfcdb20, 0xc00308a0c0, 0xfd0960, 0xc003083340)
	  walk.go:275  0x6aa
go/ast.walkStmtList(0xfcdb20, 0xc00308a0c0, 0xc002fe9e80, 0x2, 0x2)
	  walk.go:32  0x9e
go/ast.Walk(0xfcdb20, 0xc00308a0c0, 0xfd0618, 0xc002fc3c20)
	  walk.go:224  0x1968
go/ast.Walk(0xfcdb20, 0xc00308a0c0, 0xfd09b0, 0xc002feb540)
	  walk.go:98  0x29f2
go/ast.Walk(0xfcdb20, 0xc00308a0c0, 0xfd0668, 0xc003083380)
	  walk.go:136  0xf85
go/ast.Walk(0xfcdb20, 0xc00308a0c0, 0xfd0a28, 0xc002feb060)
	  walk.go:210  0x385
go/ast.walkStmtList(0xfcdb20, 0xc00308a0c0, 0xc002fe9200, 0x2, 0x2)
	  walk.go:32  0x9e
go/ast.Walk(0xfcdb20, 0xc00308a0c0, 0xfd0618, 0xc002fc36e0)
	  walk.go:224  0x1968
go/ast.Inspect(...)
	  walk.go:385
golang.org/x/tools/internal/lsp/cache.walkASTWithParent(0xfd0618, 0xc002fc36e0, 0xc002fc0eb0)
	  parse.go:731  0x9e
golang.org/x/tools/internal/lsp/cache.fixAST(0xfdef80, 0xc001039ad0, 0xfd0618, 0xc002fc36e0, 0xc002a4cf00, 0xc0017d7b80, 0x537, 0x580, 0x0)
	  parse.go:677  0x105
golang.org/x/tools/internal/lsp/cache.fixAST.func1(0xfd0528, 0xc002faed20, 0xfd0618, 0xc002fc36e0, 0xd7c720)
	  parse.go:682  0x20a
golang.org/x/tools/internal/lsp/cache.walkASTWithParent.func1(0xfd0528, 0xc002faed20, 0xc002feab00)
	  parse.go:748  0xb2
go/ast.inspector.Visit(0xc002a7dc80, 0xfd0528, 0xc002faed20, 0x0, 0x0)
	  walk.go:373  0x3a
go/ast.Walk(0xfcdb20, 0xc002a7dc80, 0xfd0528, 0xc002faed20)
	  walk.go:52  0x63
go/ast.walkStmtList(0xfcdb20, 0xc002a7dc80, 0xc002fe9200, 0x2, 0x2)
	  walk.go:32  0x9e
go/ast.Walk(0xfcdb20, 0xc002a7dc80, 0xfd0618, 0xc002fc36e0)
	  walk.go:224  0x1968
go/ast.Walk(0xfcdb20, 0xc002a7dc80, 0xfd0988, 0xc002fc3710)
	  walk.go:344  0xce6
go/ast.walkDeclList(0xfcdb20, 0xc002a7dc80, 0xc002fe9220, 0x2, 0x2)
	  walk.go:38  0x9e
go/ast.Walk(0xfcdb20, 0xc002a7dc80, 0xfd0938, 0xc0021f3200)
	  walk.go:353  0x2446
go/ast.Inspect(...)
	  walk.go:385
golang.org/x/tools/internal/lsp/cache.walkASTWithParent(0xfd0938, 0xc0021f3200, 0xc002fc0be0)
	  parse.go:731  0x9e
golang.org/x/tools/internal/lsp/cache.fixAST(0xfdef80, 0xc001039ad0, 0xfd0938, 0xc0021f3200, 0xc002a4cf00, 0xc0017d7b80, 0x537, 0x580, 0xc002a7dc50)
	  parse.go:677  0x105
golang.org/x/tools/internal/lsp/cache.parseGo(0xfdeed8, 0xc001039ad0, 0xc0000a3980, 0xfe2d18, 0xc000f1c240, 0x2, 0x0)
	  parse.go:282  0x9ae
golang.org/x/tools/internal/lsp/cache.(*snapshot).parseGoHandle.func1(0xfdeed8, 0xc002420f00, 0xfccba0, 0xc000b0a400, 0xc00017c1e0, 0x0)
	  parse.go:62  0x7d
golang.org/x/tools/internal/memoize.(*Handle).run.func1(0xc000ad6b10, 0xfdeed8, 0xc002420f00, 0xc001242300, 0xfccba0, 0xc000b0a400, 0xc000f1c3c0)
	  memoize.go:322  0xab
created by golang.org/x/tools/internal/memoize.(*Handle).run
	  memoize.go:315  0x185
[Error - 12:05:43] 

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
Copy link
Contributor

hyangah commented Oct 4, 2021

@golang/tools-team Unlike golang/vscode-go#1656 or #48249 this occurred during ast walk for memoize/cache. Similar to #47231 (milestone gopls/v0.7.1) but invalid position was found in fixInitStmt instead of fixArrayType. I guess this can happen any time - shouldn't the range check like in cl/334892 be applied to everywhere?

Transferring to gopls issue tracker.

@hyangah hyangah changed the title gopls: automated issue report (crash) x/tools/gopls: automated issue report (crash) Oct 4, 2021
@hyangah hyangah transferred this issue from golang/vscode-go Oct 4, 2021
@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 Oct 4, 2021
@gopherbot gopherbot added this to the Unreleased milestone Oct 4, 2021
@hyangah hyangah modified the milestones: Unreleased, gopls/v0.7.3 Oct 4, 2021
@stamblerre stamblerre self-assigned this Oct 4, 2021
@gopherbot
Copy link

Change https://golang.org/cl/353889 mentions this issue: internal/lsp: handle nil pointer in fixInitStmt

@golang golang locked and limited conversation to collaborators Jun 23, 2023
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