Open
Description
gopls version: v0.15.3/go1.22.1
gopls flags:
update flags: proxy
extension version: 0.41.4
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Sun, 26 May 2024 22:40:43 GMT
restart history:
Sun, 26 May 2024 21:36:23 GMT: activation (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
panic: start: pos 1 is not in range [68046:88632] of file /Users/perrybenyella/Documents/GitHub/CS345/CS_345_Distributed_Systems/raft/test_test.go goroutine 1514 [running]: golang.org/x/tools/gopls/internal/cache/xrefs.Index.func2({0x101713c20, 0x14000e8d160}) xrefs.go:52 0x8c golang.org/x/tools/gopls/internal/cache/xrefs.Index.func3({0x101713c20%3F, 0x14000e8d160}) xrefs.go:89 0x464 go/ast.inspector.Visit(0x140025b3400, {0x101713c20%3F, 0x14000e8d160%3F}) walk.go:386 0x38 go/ast.Walk({0x1017108c0%3F, 0x140025b3400%3F}, {0x101713c20, 0x14000e8d160}) walk.go:51 0x44 go/ast.Walk({0x1017108c0%3F, 0x140025b3400%3F}, {0x101713e50, 0x1400000f680}) walk.go:112 0x1d94 go/ast.Walk({0x1017108c0%3F, 0x140025b3400%3F}, {0x101713e28, 0x14000d2bac0}) walk.go:143 0x21e8 go/ast.Walk({0x1017108c0%3F, 0x140025b3400%3F}, {0x101713e00, 0x140004b3380}) walk.go:153 0x1948 go/ast.walkExprList(...) walk.go:26 go/ast.Walk({0x1017108c0%3F, 0x140025b3400%3F}, {0x101713e28, 0x14000d2bb40}) walk.go:144 0x2208 go/ast.Walk({0x1017108c0%3F, 0x140025b3400%3F}, {0x101714760, 0x14000d40a80}) walk.go:206 0x3254 go/ast.walkStmtList(...) walk.go:32 go/ast.Walk({0x1017108c0%3F, 0x140025b3400%3F}, {0x101713f40, 0x14000574210}) walk.go:234 0x29f4 go/ast.Walk({0x1017108c0%3F, 0x140025b3400%3F}, {0x101713ea0, 0x14000574240}) walk.go:357 0xd90 go/ast.walkDeclList(...) walk.go:38 go/ast.Walk({0x1017108c0%3F, 0x140025b3400%3F}, {0x101713ce8, 0x1400048ac80}) walk.go:366 0x2e14 go/ast.Inspect(...) walk.go:397 golang.org/x/tools/gopls/internal/cache/xrefs.Index({0x140011712f0, 0x5, 0x140022bd600%3F}, 0x140010bf2c0, 0x140010bf320) xrefs.go:57 0x130 golang.org/x/tools/gopls/internal/cache.(*syntaxPackage).xrefs.func1() pkg.go:72 0x38 sync.(*Once).doSlow(0x14000582d08%3F, 0x14000583388%3F) once.go:74 0x100 sync.(*Once).Do(...) once.go:65 golang.org/x/tools/gopls/internal/cache.(*syntaxPackage).xrefs(0x140002bc2d0) pkg.go:71 0x50 golang.org/x/tools/gopls/internal/cache.storePackageResults({0x1017189e8, 0x14001c460f0}, 0x14001164d80, 0x140011e2420) check.go:582 0x80 created by golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).handleSyntaxPackage in goroutine 1420 check.go:570 0x5d0
gopls stats -anon
{ "DirStats": { "Files": 440, "TestdataFiles": 0, "GoFiles": 44, "ModFiles": 2, "Dirs": 198 }, "GOARCH": "arm64", "GOOS": "darwin", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.22.1", "GoplsVersion": "v0.15.3", "InitialWorkspaceLoadDuration": "88.230458ms", "MemStats": { "HeapAlloc": 2537088, "HeapInUse": 4964352, "TotalAlloc": 11719808 }, "WorkspaceStats": { "Files": { "Total": 0, "Largest": 0, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.1", "AllPackages": { "Packages": 0, "LargestPackage": 0, "CompiledGoFiles": 0, "Modules": 0 }, "WorkspacePackages": { "Packages": 0, "LargestPackage": 0, "CompiledGoFiles": 0, "Modules": 0 }, "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>
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
findleyr commentedon May 29, 2024
CC @adonovan this is a new one.
Transferring to the Go issue tracker.
[-]gopls: automated issue report (crash)[/-][+]x/tools/gopls: crash in xrefs.Index[/+]adonovan commentedon May 29, 2024
This is the offending line, complete with "can't fail" comment. ;-)
Interpreting the stack, the offending Node is the
Sel
identifier in a call expressionx.Sel(...)
. I don't know how it got a bogus start pos of 1.adonovan commentedon May 29, 2024
Hi @perrybenyella, do you remember how you triggered this crash while working in test_test.go? If you're able to reproduce it, that would be a great help for us trying to fix it. Thanks!
[-]x/tools/gopls: crash in xrefs.Index[/-][+]x/tools/gopls: panic after failed PosRange in xrefs.Index[/+]findleyr commentedon May 31, 2024
Bumping to the next milestone as this code has not changed recently, and this is our first report of this crash.
Hopefully we can get a reproducer.
perrybenyella commentedon May 31, 2024
I am not exactly sure, but I was working on a project on vscode using the live share extension with a couple of other collaborators. Then we made edits to the files (test_test.go was one of these files), and for some reason, we weren't able to save the changes we made to the files while working. Because of that, I had to restart my vs code each tim,\e it happened. This kind of happend a few times. It also seemed to be an issue that only my computer was affected by because the other collaborators did not experience it when they used their own live share links.
12 remaining items