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

Closed
idilhaq opened this issue Sep 6, 2024 · 4 comments
Closed

gopls: automated issue report (crash) #3526

idilhaq opened this issue Sep 6, 2024 · 4 comments
Milestone

Comments

@idilhaq
Copy link

idilhaq commented Sep 6, 2024

gopls version: v0.16.2/go1.21.0
gopls flags:
update flags: proxy
extension version: 0.42.0
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Fri, 06 Sep 2024 04:23:07 GMT
restart history:
Thu, 05 Sep 2024 23:09:52 GMT: activation (enabled: true)
Thu, 05 Sep 2024 23:58:08 GMT: installation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

panic: start: pos 1 is not in range [337128:352034] of file /Users/idil.amir/go/src/github.com/goto/dex/internal/metric/metric_service_test.go

goroutine 10071 [running]:
golang.org/x/tools/gopls/internal/cache/xrefs.Index.func2({0x1054f0438, 0x140063d8820})
	  xrefs.go:51  0x8c
golang.org/x/tools/gopls/internal/cache/xrefs.Index.func3({0x1054f0438%3F, 0x140063d8820%3F})
	  xrefs.go:88  0x224
go/ast.inspector.Visit(0x1400419c000, {0x1054f0438%3F, 0x140063d8820%3F})
	  walk.go:386  0x38
go/ast.Walk({0x1054ed160%3F, 0x1400419c000%3F}, {0x1054f0438%3F, 0x140063d8820%3F})
	  walk.go:51  0x4c
go/ast.Walk({0x1054ed160%3F, 0x1400419c000%3F}, {0x1054f0ed8%3F, 0x140063d4498%3F})
	  walk.go:112  0x2f8
go/ast.Walk({0x1054ed160%3F, 0x1400419c000%3F}, {0x1054f0fa0%3F, 0x14003dbd600%3F})
	  walk.go:143  0x580
go/ast.Walk({0x1054ed160%3F, 0x1400419c000%3F}, {0x1054f0ed8%3F, 0x140063d44b0%3F})
	  walk.go:111  0x2dc
go/ast.Walk({0x1054ed160%3F, 0x1400419c000%3F}, {0x1054f0fa0%3F, 0x14003dbd680%3F})
	  walk.go:143  0x580
go/ast.Walk({0x1054ed160%3F, 0x1400419c000%3F}, {0x1054f0ed8%3F, 0x140063d44e0%3F})
	  walk.go:111  0x2dc
go/ast.Walk({0x1054ed160%3F, 0x1400419c000%3F}, {0x1054f0fa0%3F, 0x14003dbd6c0%3F})
	  walk.go:143  0x580
go/ast.Walk({0x1054ed160%3F, 0x1400419c000%3F}, {0x1054f11d0%3F, 0x1400583df00%3F})
	  walk.go:206  0xa4c
go/ast.walkStmtList(...)
	  walk.go:32
go/ast.Walk({0x1054ed160%3F, 0x1400419c000%3F}, {0x1054f0e60%3F, 0x140063c89c0%3F})
	  walk.go:234  0x184c
go/ast.Walk({0x1054ed160%3F, 0x1400419c000%3F}, {0x1054f0e10%3F, 0x1400583dfd0%3F})
	  walk.go:99  0x1dc
go/ast.walkExprList(...)
	  walk.go:26
go/ast.Walk({0x1054ed160%3F, 0x1400419c000%3F}, {0x1054f0fa0%3F, 0x14003dbd940%3F})
	  walk.go:144  0x19d0
go/ast.Walk({0x1054ed160%3F, 0x1400419c000%3F}, {0x1054f11d0%3F, 0x1400583dff0%3F})
	  walk.go:206  0xa4c
go/ast.walkStmtList(...)
	  walk.go:32
go/ast.Walk({0x1054ed160%3F, 0x1400419c000%3F}, {0x1054f0e60%3F, 0x140063c8cc0%3F})
	  walk.go:234  0x184c
go/ast.Walk({0x1054ed160%3F, 0x1400419c000%3F}, {0x1054f14f0%3F, 0x140063c8cf0%3F})
	  walk.go:357  0x13c4
go/ast.walkDeclList(...)
	  walk.go:38
go/ast.Walk({0x1054ed160%3F, 0x1400419c000%3F}, {0x1054f0500%3F, 0x140058572c0%3F})
	  walk.go:366  0x154c
go/ast.Inspect(...)
	  walk.go:397
golang.org/x/tools/gopls/internal/cache/xrefs.Index({0x14004076ed0, 0x2, 0x0%3F}, 0x14007a103c0, 0x1400b9c8230)
	  xrefs.go:56  0x130
golang.org/x/tools/gopls/internal/cache.(*syntaxPackage).xrefs.func1()
	  package.go:67  0x38
sync.(*Once).doSlow(0x0%3F, 0x0%3F)
	  once.go:74  0x100
sync.(*Once).Do(...)
	  once.go:65
golang.org/x/tools/gopls/internal/cache.(*syntaxPackage).xrefs(0x140006fab00)
	  package.go:66  0x50
golang.org/x/tools/gopls/internal/cache.storePackageResults({0x1054f52a8, 0x14008eeb3e0}, 0x14002b92000, 0x14004d06f60)
	  check.go:587  0x74
created by golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).handleSyntaxPackage in goroutine 9618
	  check.go:575  0x5f8
gopls stats -anon { "DirStats": { "Files": 1799, "TestdataFiles": 0, "GoFiles": 387, "ModFiles": 1, "Dirs": 333 }, "GOARCH": "arm64", "GOOS": "darwin", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.21.0", "GoplsVersion": "v0.16.2", "InitialWorkspaceLoadDuration": "2.179543917s", "MemStats": { "HeapAlloc": 86748648, "HeapInUse": 132972544, "TotalAlloc": 1005293960 }, "WorkspaceStats": { "Files": { "Total": 3817, "Largest": 663008, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.21.0", "AllPackages": { "Packages": 787, "LargestPackage": 140, "CompiledGoFiles": 3825, "Modules": 139 }, "WorkspacePackages": { "Packages": 65, "LargestPackage": 129, "CompiledGoFiles": 399, "Modules": 1 }, "Diagnostics": 1 } ] } }

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

hyangah commented Sep 6, 2024

Thanks for sharing the report, @idilhaq
This looks like a duplicate of golang/go#67704
which looks correlated with concurrent editing through the live share.
Do you remember how you triggered this crash?

@idilhaq
Copy link
Author

idilhaq commented Sep 6, 2024

Hi @hyangah , yup this was happening during a live share session.
I have been facing this issue few times this week.
It was just happening suddenly in the middle of the session. Probably connection issue?
It can be resolved by restarting(?) the extension at the bottom and check the item. Sometimes need to do this several times and it will be working again.
Screenshot 2024-09-06 at 20 53 20
Screenshot 2024-09-06 at 20 53 10

@adonovan
Copy link
Member

It's not a connection issue (though the crash will cause the server to disconnect). The investigation at golang/go#67704 identifies the culprit as an expression of the form x.Sel(...) that has a bad position, likely due to poor parser error recovery. If you are able to identify a sequence of keystrokes or edits that reproduces the crash, that would be very helpful information.

@adonovan
Copy link
Member

Closing as dup of golang/go#67704. If you are able to reproduce this reliably by editing, please do follow up on either issue.

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

4 participants