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) #1656

Closed
hritesh-sonawane opened this issue Aug 1, 2021 · 1 comment
Closed

gopls: automated issue report (crash) #1656

hritesh-sonawane opened this issue Aug 1, 2021 · 1 comment

Comments

@hritesh-sonawane
Copy link

gopls version: v0.7.1-pre.1
gopls flags:
update flags: proxy
extension version: 2021.7.2819
go version: 1.16.6
environment: Visual Studio Code linux
initialization error: undefined
manual restart count: 0
total start count: 1

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

A crash which resulted in no linting for go files. Had to restart VSCode to get things back as it were.
panic: invalid Pos value 181 (should be in [1, 180[)

goroutine 158 [running]:
go/token.(*File).PositionFor(0xc0006979e0, 0xb5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	  position.go:349  0x1a5
golang.org/x/tools/internal/lsp.(*encoded).strStack(0xc00012e460, 0xc00007d220, 0xc000458de8)
	  semantic.go:239  0x2fc
golang.org/x/tools/internal/lsp.(*encoded).unkIdent(0xc00012e460, 0xc00028c9e0)
	  semantic.go:604  0x27c
golang.org/x/tools/internal/lsp.(*encoded).ident(0xc00012e460, 0xc00028c9e0)
	  semantic.go:427  0xe1c
golang.org/x/tools/internal/lsp.(*encoded).inspector(0xc00012e460, 0xfb7b30, 0xc00028c9e0, 0xc00007d101)
	  semantic.go:343  0x32b
golang.org/x/tools/internal/lsp.(*encoded).semantics.func1(0xfb7b30, 0xc00028c9e0, 0xc00042c601)
	  semantic.go:129  0x3e
go/ast.inspector.Visit(0xc00007d130, 0xfb7b30, 0xc00028c9e0, 0xfb4d40, 0xc00007d130)
	  walk.go:373  0x3a
go/ast.Walk(0xfb4d40, 0xc00007d130, 0xfb7b30, 0xc00028c9e0)
	  walk.go:52  0x63
go/ast.Walk(0xfb4d40, 0xc00007d130, 0xfb7a40, 0xc000358e80)
	  walk.go:270  0x76e
go/ast.walkStmtList(0xfb4d40, 0xc00007d130, 0xc00023a480, 0x4, 0x4)
	  walk.go:32  0x9e
go/ast.Walk(0xfb4d40, 0xc00007d130, 0xfb76f8, 0xc000247800)
	  walk.go:224  0x1968
go/ast.Walk(0xfb4d40, 0xc00007d130, 0xfb7a68, 0xc000247830)
	  walk.go:344  0xce6
go/ast.Inspect(...)
	  walk.go:385
golang.org/x/tools/internal/lsp.(*encoded).semantics(0xc00012e460)
	  semantic.go:137  0x3a9
golang.org/x/tools/internal/lsp.(*Server).computeSemanticTokens(0xc00023fc20, 0xfc5d58, 0xc00004c840, 0xc000112ff0, 0x4b, 0xc000248210, 0x0, 0x0, 0x0)
	  semantic.go:116  0x4b7
golang.org/x/tools/internal/lsp.(*Server).semanticTokensRange(...)
	  semantic.go:43
golang.org/x/tools/internal/lsp.(*Server).SemanticTokensRange(0xc00023fc20, 0xfc5d58, 0xc00004c840, 0xc000248200, 0xc000248200, 0x0, 0x0)
	  server_gen.go:220  0x5e
golang.org/x/tools/internal/lsp/protocol.serverDispatch(0xfc5d58, 0xc00004c840, 0xfdcd40, 0xc00023fc20, 0xc000475110, 0xfc5fc0, 0xc00004c740, 0x0, 0x0, 0xfb46e0)
	  tsserver.go:288  0x7be5
golang.org/x/tools/internal/lsp/protocol.ServerHandler.func1(0xfc5d58, 0xc00004c840, 0xc000475110, 0xfc5fc0, 0xc00004c740, 0x0, 0xc039aa594d001894)
	  protocol.go:154  0xc5
golang.org/x/tools/internal/lsp/lsprpc.handshaker.func1(0xfc5d58, 0xc00004c840, 0xc000475110, 0xfc5fc0, 0xc00004c740, 0x0, 0x0)
	  lsprpc.go:506  0x459
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1(0xfc5d58, 0xc00004c840, 0xc00000e750, 0xfc5fc0, 0xc00004c740, 0xc00024efb0, 0x1)
	  handler.go:35  0xd7
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2(0xc0002943c0, 0xc0003efad0, 0xc0003aa6b0, 0xfc5d58, 0xc00004c840, 0xc00000e750, 0xfc5fc0, 0xc00004c740)
	  handler.go:103  0x86
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
	  handler.go:100  0x173
[Error - 11:02:21 AM] 2021/08/01 11:02:21 DocumentSymbols failed: invalid pos
	URI=file:///home/hr7tesh/Gamakichi/Level 1/31/solution.go

[Error - 11:02:21 AM] 
@gopherbot gopherbot added this to the Untriaged milestone Aug 1, 2021
@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/339169 mentions this issue: internal/lsp: handle invalid positions in semantic token debug logic

gopherbot pushed a commit to golang/tools that referenced this issue Aug 2, 2021
Check that a position is in range before using it.

Fixes golang/vscode-go#1656

Change-Id: I1598ebab76a1775afd8f63b9849049b31fb74a8b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/339169
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Peter Weinberger <pjw@google.com>
@golang golang locked and limited conversation to collaborators Aug 2, 2022
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