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: unrecovered panic when type checking #52210

Closed
crabxyj opened this issue Apr 6, 2022 · 2 comments
Closed

x/tools/gopls: unrecovered panic when type checking #52210

crabxyj opened this issue Apr 6, 2022 · 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.

Comments

@crabxyj
Copy link

crabxyj commented Apr 6, 2022

gopls version: v0.8.2 (go1.17)
gopls flags:
update flags: proxy
extension version: 0.32.0
go version: 1.17
environment: Visual Studio Code win32
initialization error: undefined
issue timestamp: Wed, 06 Apr 2022 02:57:47 GMT
restart history:
Wed, 06 Apr 2022 02:57:30 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0xad4900]

goroutine 420 [running]:
go/types.(*Checker).handleBailout(0xc0050f2f00, 0xc00621f660)
	C:/Program   check.go:245  0x8b
panic({0x1246200, 0x1a9dbe0})
	C:/Program   panic.go:1038  0x215
go/ast.(*Ident).Pos(0xc00621edf0)
	C:/Program   ast.go:469
go/types.spanOf({0x1554380, 0x0})
	C:/Program   errors.go:243  0x134
go/types.(*Checker).newError(0xc0050f2f00, {0x1554380, 0x0}, 0x27, 0x0, {0xc008d17380, 0x33})
	C:/Program   errors.go:154  0x4f
go/types.(*Checker).error(0xc00c15e5a0, {0x1554380, 0x0}, 0x0, {0xc008d17380, 0x36})
	C:/Program   errors.go:173  0x35
go/types.(*Checker).errorf(0xc0050f2f00, {0x1554380, 0x0}, 0xc005a31fc1, {0x136f5c5, 0xc005f5f3c0}, {0x0, 0x0, 0x0})
	C:/Program   errors.go:177  0x68
go/types.(*Checker).collectObjects.func1({0x15559e0, 0xc0005ffe00})
	C:/Program   resolver.go:279  0xbfd
go/types.(*Checker).walkDecl(0x800000000000, {0x1568820, 0xc000a9d500}, 0xc007c07530)
	C:/Program   decl.go:431  0x1c7
go/types.(*Checker).walkDecls(0xc005f5f3c0, {0xc000a9d800, 0x4, 0x1}, 0x0)
	C:/Program   decl.go:418  0x6a
go/types.(*Checker).collectObjects(0xc0050f2f00)
	C:/Program   resolver.go:252  0x225
go/types.(*Checker).checkFiles(0xc0050f2f00, {0xc0051413f0, 0xc0006e0b40, 0x0})
	C:/Program   check.go:263  0xb5
go/types.(*Checker).Files(...)
	C:/Program   check.go:250
golang.org/x/tools/internal/lsp/cache.doTypeCheck({0x156b3d8, 0xc0008030c0}, 0xc000364120, 0xc001c84960, 0x2, 0xc0021f35f0, 0xc000068460)
	  check.go:551  0x953
golang.org/x/tools/internal/lsp/cache.typeCheck({0x156b3d8, 0xc0008030c0}, 0xc000364120, 0xc001c84960, 0x2, 0x0)
	  check.go:317  0xe5
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildPackageHandle.func1({0x156b3d8, 0xc0008030c0}, {0x15549a0, 0xc000364120})
	  check.go:125  0x23e
golang.org/x/tools/internal/memoize.(*Handle).run.func1()
	  memoize.go:327  0xa9
created by golang.org/x/tools/internal/memoize.(*Handle).run
	  memoize.go:320  0x1b0
[Error - 10:57: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>

@suzmue suzmue added the gopls Issues related to the Go language server, gopls. label Apr 7, 2022
@suzmue suzmue transferred this issue from golang/vscode-go Apr 7, 2022
@suzmue suzmue changed the title gopls: automated issue report (crash) x/tools/gopls: unrecovered panic when type checking Apr 7, 2022
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Apr 7, 2022
@gopherbot gopherbot added this to the Unreleased milestone Apr 7, 2022
@suzmue
Copy link
Contributor

suzmue commented Apr 7, 2022

@crabxyj Thanks for filing an issue! Could you provide any more information about the code you were editing and what you were trying to do when this crash occurred?

@findleyr
Copy link
Contributor

This is a dupe of https://go.dev/issue/48082, and was fixed in go1.17.1. Could you please update your version of Go? Thanks.

@findleyr findleyr modified the milestones: gopls/later, gopls/unplanned May 10, 2022
@findleyr findleyr closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2022
@golang golang locked and limited conversation to collaborators Jul 1, 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