Skip to content

gopls: automated issue report (crash) #2087

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
d0ngw opened this issue Mar 3, 2022 · 6 comments
Closed

gopls: automated issue report (crash) #2087

d0ngw opened this issue Mar 3, 2022 · 6 comments

Comments

@d0ngw
Copy link

d0ngw commented Mar 3, 2022

gopls version: v0.7.5
gopls flags:
update flags: proxy
extension version: 0.31.1
go version: 1.18rc1
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Thu, 03 Mar 2022 08:07:45 GMT
restart history:
Thu, 03 Mar 2022 07:45:36 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

panic: assertion failed

goroutine 6078 [running]:
go/types.(*Checker).handleBailout(0xc0003d08c0, 0xc009cf9688)
	  check.go:304  0x8b
panic({0x1854680, 0x1bce5d0})
	  panic.go:838  0x207
go/types.assert(...)
	  errors.go:21
go/types.(*unifier).nify(0xc002d0fe00, {0x1bd3b00%3F, 0xc002a721c0%3F}, {0x1bd3b00%3F, 0xc0027e3f80%3F}, 0x0)
	  unify.go:461  0x1045
go/types.(*unifier).nify(0xc002d0fe00, {0x1bd3b28%3F, 0xc001392870%3F}, {0x1bd3b28%3F, 0xc00242b970%3F}, 0x0)
	  unify.go:351  0x8d4
go/types.(*unifier).nify(0xc002d0fe00, {0x1bd3b00%3F, 0xc002a72230%3F}, {0x1bd3b00%3F, 0xc002a72000%3F}, 0x0)
	  unify.go:463  0xff4
go/types.(*unifier).nify(0xc002d0fe00, {0x1bd3b28%3F, 0xc001392830%3F}, {0x1bd3b28%3F, 0xc00242b910%3F}, 0x0)
	  unify.go:351  0x8d4
go/types.(*unifier).unify(...)
	  unify.go:64
go/types.(*Checker).infer(0xc0003d08c0, {0x1bd0280, 0xc002f41a00}, {0xc0013927f0, 0x2, 0x2}, {0x0%3F, 0x18877c0%3F, 0xc00243be30%3F}, 0xc002e38828, ...)
	  infer.go:193  0x599
go/types.(*Checker).arguments(0xc0003d08c0, 0xc002f41a00, 0xc002f0db80, {0x0, 0x0, 0x0}, {0xc0030fcd18%3F, 0x1, 0x1}, {0x0, ...})
	  call.go:390  0x945
go/types.(*Checker).callExpr(0xc0003d08c0, 0xc0019dc3c0, 0xc002f41a00)
	  call.go:210  0x669
go/types.(*Checker).exprInternal(0xc0003d08c0, 0xc0019dc3c0, {0x1bd5b70%3F, 0xc002f41a00}, {0x0%3F, 0x0%3F})
	  expr.go:1483  0x9f2
go/types.(*Checker).rawExpr(0xc000328d80%3F, 0xc0019dc3c0%3F, {0x1bd5b70%3F, 0xc002f41a00%3F}, {0x0%3F, 0x0%3F}, 0x0)
	  expr.go:1111  0x45
go/types.(*Checker).multiExpr(0xc009cf8618%3F, 0x12ad15b%3F, {0x1bd5b70%3F, 0xc002f41a00%3F})
	  expr.go:1613  0x35
go/types.(*Checker).exprList(0xc009cf8538%3F, {0xc002ed2f30%3F, 0x8%3F, 0x0%3F}, 0x0)
	  call.go:253  0x97
go/types.(*Checker).initVars(0x1885960%3F, {0xc0030fccf8, 0x1, 0x0%3F}, {0xc002ed2f30, 0x1, 0x1%3F}, {0x0, 0x0})
	  assignments.go:318  0x89
go/types.(*Checker).shortVarDecl(0xc0003d08c0, {0x1bd1c80, 0xc005affe00}, {0xc002ed2e70, 0x1, 0x8%3F}, {0xc002ed2f30%3F, 0x1, 0x1})
	  assignments.go:471  0x9d2
go/types.(*Checker).stmt(0xc0003d08c0, 0x0, {0x1bd59f0%3F, 0xc002f41a80%3F})
	  stmt.go:473  0x1c07
go/types.(*Checker).stmtList(0x1%3F, 0x0, {0xc0090c6b00%3F, 0x3%3F, 0xc002190401%3F})
	  stmt.go:125  0xc9
go/types.(*Checker).funcBody(0xc0003d08c0, 0xc0036693e0, {0x1bd3ab0%3F, 0xc002e38000%3F}, 0xc002f0c9c0, 0xc003397980, {0x0, 0x0})
	  stmt.go:46  0x285
go/types.(*Checker).funcDecl.func1()
	  decl.go:790  0x45
go/types.(*Checker).processDelayed(0xc0003d08c0, 0x0)
	  check.go:375  0x39
go/types.(*Checker).checkFiles(0xc0003d08c0, {0xc001166280%3F, 0xc002637a90%3F, 0x2%3F})
	  check.go:326  0xcb
go/types.(*Checker).Files(...)
	  check.go:309
golang.org/x/tools/internal/lsp/cache.doTypeCheck({0x1bd71f0, 0xc0031c46c0}, 0xc0090c6500, 0xc0002f81e0, 0x2, 0xc00243a180, 0x1%3F)
	  check.go:536  0x8b3
golang.org/x/tools/internal/lsp/cache.typeCheck({0x1bd71f0, 0xc0031c46c0}, 0xc0090c6500, 0xc0002f81e0, 0x2, 0xc00243a180%3F)
	  check.go:313  0xe5
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildPackageHandle.func1({0x1bd71f0%3F, 0xc0031c46c0}, {0x1bd0b40%3F, 0xc0090c6500})
	  check.go:124  0x233
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  0x1b8
[Error - 4:07:36 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>

@gopherbot gopherbot added this to the Untriaged milestone Mar 3, 2022
@hyangah
Copy link
Contributor

hyangah commented Mar 3, 2022

Thanks for the report @d0ngw
Can you please update gopls (v0.8.0 was released just now!) and see if this crash is reproducible?
Make sure to compile the gopls with the go1.18rc1.

@d0ngw
Copy link
Author

d0ngw commented Mar 4, 2022

Thanks for the reply, I have updated gopls to 0.8.0 this morning. I will use it in development and check if there are still crashes.

@findleyr
Copy link
Member

findleyr commented Mar 4, 2022

Hi, is it possible that you compiled gopls with a different version of Go?

The line numbers in your stack trace do not align with RC1. For example, there is no assertion on line 461 of unify.go. It looks like perhaps you built gopls with beta2?
https://cs.opensource.google/go/go/+/refs/tags/go1.18beta2:src/go/types/unify.go;l=461;drc=deb45802a4384ea3c7c3434113fb64a57a494cb2

Could that be possible?

@findleyr
Copy link
Member

findleyr commented Mar 4, 2022

Also, can you please share any additional context about what you were doing when you got the crash? What did the code look like that you were inferring?

@findleyr
Copy link
Member

findleyr commented Mar 4, 2022

Aha, this looks like a dupe of golang/go#50929.

I believe this should be fixed with RC1. Closing, please reopen if you disagree.

@findleyr findleyr closed this as completed Mar 4, 2022
@d0ngw
Copy link
Author

d0ngw commented Mar 4, 2022

OK, Thanks.

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

4 participants