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

Closed
DoisKoh opened this issue Aug 11, 2024 · 1 comment
Closed

gopls: automated issue report (crash) #3487

DoisKoh opened this issue Aug 11, 2024 · 1 comment
Milestone

Comments

@DoisKoh
Copy link

DoisKoh commented Aug 11, 2024

gopls version: v0.16.1/go1.22.5
gopls flags:
update flags: proxy
extension version: 0.42.0
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Sun, 11 Aug 2024 16:25:29 GMT
restart history:
Sun, 11 Aug 2024 16:25:28 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

Suddenly crashed when using the reflect package (trying to loop over NumFields())

Note: I was typing it out as ... range := t.NumFields() - as if I'm trying to loop over an int instead of an array. I know it's wrong but it shouldn't crash. Hope that helps.

panic:   stmt.go:932: assertion failed

goroutine 1507 [running]:
go/types.(*Checker).handleBailout(0x140002a8e00, 0x14002237878)
	  check.go:367  0x9c
panic({0x1053f73a0%3F, 0x14001700220%3F})
	  panic.go:770  0x124
go/types.assert(0x0%3F)
	  errors.go:28  0x60
go/types.(*Checker).rangeStmt(0x140002a8e00, 0x3, 0x14000d26960)
	  stmt.go:932  0xb58
go/types.(*Checker).stmt(0x140002a8e00, 0x0, {0x105580e80, 0x14000d26960})
	  stmt.go:827  0x874
go/types.(*Checker).stmtList(0x140002a8e00, 0x0, {0x14000145800%3F, 0x0%3F, 0x14001ac20f0%3F})
	  stmt.go:121  0x88
go/types.(*Checker).funcBody(0x140002a8e00, 0x10557e588%3F, {0x1400079a236%3F, 0x140000543f0%3F}, 0x140007d0980, 0x140003de9c0, {0x0%3F, 0x0%3F})
	  stmt.go:41  0x21c
go/types.(*Checker).funcDecl.func1()
	  decl.go:852  0x44
go/types.(*Checker).processDelayed(0x140002a8e00, 0x0)
	  check.go:467  0x12c
go/types.(*Checker).checkFiles(0x140002a8e00, {0x14000032820, 0x3, 0x4})
	  check.go:411  0x188
go/types.(*Checker).Files(...)
	  check.go:372
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).checkPackage(0x140020819e0, {0x105582168, 0x14001948e10}, 0x14001119200)
	  check.go:1543  0x788
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).handleSyntaxPackage(0x140020819e0, {0x105582168, 0x14001948e10}, 0x0, {0x14000299800, 0x31})
	  check.go:568  0x534
golang.org/x/tools/gopls/internal/cache.(*Snapshot).forEachPackageInternal.func2()
	  check.go:418  0x34
golang.org/x/sync/errgroup.(*Group).Go.func1()
	  errgroup.go:78  0x58
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 148
	  errgroup.go:75  0x98
gopls stats -anon gopls stats -anon failed after 290 ms. Please check if gopls is killed by OS.
@gopherbot gopherbot added this to the Untriaged milestone Aug 11, 2024
@findleyr
Copy link
Contributor

Thanks. This is a dupe of golang/go#68334, a regression in the go type checking in 1.22.5. Should be fixed by 1.22.6 (or 1.23.0!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants