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: crash when editing files in live share #3366

Closed
knisbet opened this issue Apr 25, 2024 · 3 comments
Closed

gopls: crash when editing files in live share #3366

knisbet opened this issue Apr 25, 2024 · 3 comments
Milestone

Comments

@knisbet
Copy link

knisbet commented Apr 25, 2024

gopls version: v0.15.3/go1.22.2
gopls flags:
update flags: proxy
extension version: 0.41.3
environment: Visual Studio Code - Insiders darwin
initialization error: undefined
issue timestamp: Thu, 25 Apr 2024 20:32:09 GMT
restart history:
Wed, 24 Apr 2024 16:02:15 GMT: activation (enabled: true)
Thu, 25 Apr 2024 15:38:24 GMT: manual (enabled: true)
Thu, 25 Apr 2024 20:26:29 GMT: manual (enabled: true)
Thu, 25 Apr 2024 20:32:25 GMT: manual (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

Myself and another developer were using the VS code live share support and working on different files to do some refactoring. We've seen it crash twice when making changes so far this afternoon.

panic: file not found for pos = 1 (-)

goroutine 156799 [running]:
go/types.(*Checker).handleBailout(0x14016a9ac00, 0x14010a53878)
	  check.go:367  0x9c
panic({0x101328cc0%3F, 0x1400e85bca0%3F})
	  panic.go:770  0x124
go/types.(*Checker).fileFor(0x14016a9ac00, 0x1)
	  version.go:131  0x154
go/types.(*Checker).allowVersion(0x14016a9ac00, 0x0%3F, {0x1014a5740%3F, 0x1401c531ae8%3F}, {0x100fe623b, 0x6})
	  version.go:97  0x64
go/types.(*Checker).genericExprList(0x14016a9ac00, {0x14016845d40, 0x2, 0x1401c531ad0%3F})
	  call.go:383  0xb64
go/types.(*Checker).callExpr(0x14016a9ac00, 0x1400384c3c0, 0x14003ae62c0)
	  call.go:303  0x560
go/types.(*Checker).exprInternal(0x14016a9ac00, 0x0, 0x1400384c3c0, {0x1014ab0d0, 0x14003ae62c0}, {0x0, 0x0})
	  expr.go:1374  0xd0
go/types.(*Checker).rawExpr(0x14016a9ac00, 0x0, 0x1400384c3c0, {0x1014ab0d0%3F, 0x14003ae62c0%3F}, {0x0%3F, 0x0%3F}, 0x0)
	  expr.go:979  0x12c
go/types.(*Checker).expr(0x14016a9ac00, 0x140000d2380%3F, 0x1400384c3c0, {0x1014ab0d0%3F, 0x14003ae62c0%3F})
	  expr.go:1513  0x38
go/types.(*Checker).initVars(0x14016a9ac00, {0x140161078c0, 0x2, 0x100af4614%3F}, {0x14016845d60, 0x1400384c380%3F, 0x1014a7ce0%3F}, {0x1014ab220, 0x14016845d80%3F})
	  assignments.go:381  0x570
go/types.(*Checker).stmt(0x14016a9ac00, 0x1, {0x1014ab220, 0x14016845d80})
	  stmt.go:524  0x1898
go/types.(*Checker).stmtList(0x14016a9ac00, 0x1, {0x1401e7a0cc0%3F, 0x100fe4e43%3F, 0x5%3F})
	  stmt.go:121  0x88
go/types.(*Checker).stmt(0x14016a9ac00, 0x1, {0x1014ab130, 0x1400b41b980})
	  stmt.go:562  0x1974
go/types.(*Checker).stmt(0x14016a9ac00, 0x1, {0x1014ab100, 0x14003ae6300})
	  stmt.go:574  0x258c
go/types.(*Checker).stmtList(0x14016a9ac00, 0x5, {0x14013011300%3F, 0x100fe381c%3F, 0x4%3F})
	  stmt.go:121  0x88
go/types.(*Checker).stmt(0x14016a9ac00, 0x0, {0x1014ab3d0, 0x14016a720f0})
	  stmt.go:628  0x249c
go/types.(*Checker).stmtList(0x14016a9ac00, 0x0, {0x14013031400%3F, 0x0%3F, 0x0%3F})
	  stmt.go:121  0x88
go/types.(*Checker).funcBody(0x14016a9ac00, 0x1014a8230%3F, {0x1401c6f4cb0%3F, 0x140000d2380%3F}, 0x14001917740, 0x14016a72120, {0x0%3F, 0x0%3F})
	  stmt.go:41  0x21c
go/types.(*Checker).funcDecl.func1()
	  decl.go:852  0x44
go/types.(*Checker).processDelayed(0x14016a9ac00, 0x0)
	  check.go:467  0x12c
go/types.(*Checker).checkFiles(0x14016a9ac00, {0x14001916000, 0x7, 0x8})
	  check.go:411  0x188
go/types.(*Checker).Files(...)
	  check.go:372
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).checkPackage(0x1400f0a25a0, {0x1014aca08, 0x14013d1c1e0}, 0x140150ca000)
	  check.go:1532  0x764
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).handleSyntaxPackage(0x1400f0a25a0, {0x1014aca08, 0x14013d1c1e0}, 0x0, {0x14001502e10, 0x13})
	  check.go:563  0x534
golang.org/x/tools/gopls/internal/cache.(*Snapshot).forEachPackageInternal.func2()
	  check.go:414  0x34
golang.org/x/sync/errgroup.(*Group).Go.func1()
	  errgroup.go:78  0x58
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 153069
	  errgroup.go:75  0x98
gopls stats -anon { "DirStats": { "Files": 90240, "TestdataFiles": 0, "GoFiles": 529, "ModFiles": 2, "Dirs": 9112 }, "GOARCH": "arm64", "GOOS": "darwin", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.22.2", "GoplsVersion": "v0.15.3", "InitialWorkspaceLoadDuration": "6.743321583s", "MemStats": { "HeapAlloc": 188338536, "HeapInUse": 254541824, "TotalAlloc": 832696632 }, "WorkspaceStats": { "Files": { "Total": 7319, "Largest": 6105329, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.2", "AllPackages": { "Packages": 1432, "LargestPackage": 213, "CompiledGoFiles": 7590, "Modules": 208 }, "WorkspacePackages": { "Packages": 188, "LargestPackage": 59, "CompiledGoFiles": 621, "Modules": 1 }, "Diagnostics": 909 } ] } }
@gopherbot gopherbot added this to the Untriaged milestone Apr 25, 2024
@hyangah
Copy link
Contributor

hyangah commented Apr 26, 2024

Interesting. @knisbet Is the crash log from the host? Is it possible to test with open source code and post logs?
(We are not handling LSP messages with vsls:// URIs; I wonder if that causes confusion to gopls).

cc @golang/tools-team

@hyangah hyangah changed the title gopls: automated issue report (crash) gopls: crash when editing files in live share Apr 26, 2024
@findleyr
Copy link
Member

This looks like a dupe of golang/go#66790, which was curiously also during a live share.

@findleyr
Copy link
Member

(closing as a dupe but we'd definitely like to know the answers to @hyangah's questions).

@findleyr findleyr closed this as not planned Won't fix, can't repro, duplicate, stale Apr 26, 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

4 participants