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) - assertion failure in range statement checking logic #3479

Closed
fstiffo opened this issue Aug 6, 2024 · 1 comment
Milestone

Comments

@fstiffo
Copy link

fstiffo commented Aug 6, 2024

gopls version: v0.16.1/go1.22.5
gopls flags:
update flags: proxy
extension version: 0.42.0
environment: Visual Studio Code win32
initialization error: undefined
issue timestamp: Tue, 06 Aug 2024 16:35:15 GMT
restart history:
Tue, 06 Aug 2024 16:26:38 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

panic: C:/Program   stmt.go:932: assertion failed

goroutine 771 [running]:
go/types.(*Checker).handleBailout(0xc000118800, 0xc001167898)
	C:/Program   check.go:367  0x88
panic({0xd5b920%3F, 0xc001149680%3F})
	C:/Program   panic.go:770  0x132
go/types.assert(0x0%3F)
	C:/Program   errors.go:28  0x54
go/types.(*Checker).rangeStmt(0xc000118800, 0x3, 0xc00054b500)
	C:/Program   stmt.go:932  0xe70
go/types.(*Checker).stmt(0xc000118800, 0x0, {0x11ddf80, 0xc00054b500})
	C:/Program   stmt.go:827  0xab9
go/types.(*Checker).stmtList(0xc000118800, 0x0, {0xc0005b0c60%3F, 0x0%3F, 0x30761e%3F})
	C:/Program   stmt.go:121  0x85
go/types.(*Checker).funcBody(0xc000118800, 0x11da370%3F, {0xc000381860%3F, 0x1877ca0%3F}, 0xc0006bfc80, 0xc00042c2d0, {0x0%3F, 0x0%3F})
	C:/Program   stmt.go:41  0x331
go/types.(*Checker).funcDecl.func1()
	C:/Program   decl.go:852  0x3a
go/types.(*Checker).processDelayed(0xc000118800, 0x0)
	C:/Program   check.go:467  0x162
go/types.(*Checker).checkFiles(0xc000118800, {0xc00069bb60, 0x1, 0x1})
	C:/Program   check.go:411  0x1cc
go/types.(*Checker).Files(...)
	C:/Program   check.go:372
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).checkPackage(0xc00112e3c0, {0x11df228, 0xc000573710}, 0xc000e966c0)
	  check.go:1543  0xa25
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).handleSyntaxPackage(0xc00112e3c0, {0x11df228, 0xc000573710}, 0x0, {0xc0003314a0, 0xa})
	  check.go:568  0x5e5
golang.org/x/tools/gopls/internal/cache.(*Snapshot).forEachPackageInternal.func2()
	  check.go:418  0x2b
golang.org/x/sync/errgroup.(*Group).Go.func1()
	  errgroup.go:78  0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 62
	  errgroup.go:75  0x96
gopls stats -anon { "DirStats": { "Files": 8, "TestdataFiles": 0, "GoFiles": 2, "ModFiles": 1, "Dirs": 2 }, "GOARCH": "amd64", "GOOS": "windows", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.22.5", "GoplsVersion": "v0.16.1", "InitialWorkspaceLoadDuration": "1.1098554s", "MemStats": { "HeapAlloc": 7790336, "HeapInUse": 15351808, "TotalAlloc": 103135280 }, "WorkspaceStats": { "Files": { "Total": 485, "Largest": 210104, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.5", "AllPackages": { "Packages": 62, "LargestPackage": 148, "CompiledGoFiles": 483, "Modules": 1 }, "WorkspacePackages": { "Packages": 2, "LargestPackage": 2, "CompiledGoFiles": 3, "Modules": 1 }, "Diagnostics": 0 } ] } }

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 Aug 6, 2024
@hyangah
Copy link
Contributor

hyangah commented Aug 7, 2024

Dup of golang/go#68334

Looks like the fix will be available in go1.22.6 and go1.23.0. (not released yet)

If you build the gopls with go1.23rc2, does it fix the problem?

GOTOOLCHAIN=go1.23rc2 go install golang.org/x/tools/gopls@latest

@hyangah hyangah changed the title gopls: automated issue report (crash) gopls: automated issue report (crash) - assertion failure in range statement checking logic Aug 7, 2024
@hyangah hyangah closed this as completed Aug 8, 2024
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