-
Notifications
You must be signed in to change notification settings - Fork 799
gopls: automated issue report (crash) #3401
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
Comments
this issue is the same that golang/go#67156 |
@Sangwaniya do you by any chance have a replace directive in your go.mod file? Perhaps one that is an absolute windows file path? |
@findleyr yes i forgot about that |
@Sangwaniya are you saying that the crash was avoided once you changed the path separator back, and rebuilt gopls? I would expect that very few applications work correctly on windows when build with a modified GOROOT that changes the path separator. |
@findleyr I corrected the path separator value but still gopls crashing. ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW. Describe what you observed. panic: runtime error: slice bounds out of range [45:44] goroutine 6535 [running]: golang.org/x/tools/internal/imports.(*ModuleResolver).scanDirForPackage(0xc000e6e840, {{0xc00536f6a5%3F, 0x3071f2db721b2800%3F}, 0x8%3F}, {0xc0077bcb40, 0x2c}) mod.go:727 0x705 golang.org/x/tools/internal/imports.(*ModuleResolver).scan.func3({{0xc00536f6a5%3F, 0xeb5e20%3F}, 0xc006a09760%3F}, {0xc0077bcb40%3F, 0x18c12a8%3F}) mod.go:601 0x50 golang.org/x/tools/internal/gopathwalk.(*walker).walk(0xc0067a3c20, {0xc0089d5640, 0x37}, 0x0, {0x12f0af8, 0xc006dff650}) walk.go:268 0x3d7 golang.org/x/tools/internal/gopathwalk.(*walker).walk(0xc0067a3c20, {0xc00536f6a5, 0x2c}, 0x0, {0x12f0b30, 0xc006a09740}) walk.go:334 0x87b golang.org/x/tools/internal/gopathwalk.walkDir({{0xc00536f6a5%3F, 0xc003037f18%3F}, 0xc003037f18%3F}, 0xc006a09710, 0xc006a09700, {0x0%3F, 0x0%3F, 0x4%3F}) walk.go:120 0x366 golang.org/x/tools/internal/gopathwalk.WalkSkip(...) walk.go:77 golang.org/x/tools/internal/imports.(*ModuleResolver).scan.func4() mod.go:626 0x2db created by golang.org/x/tools/internal/imports.(*ModuleResolver).scan in goroutine 4807 mod.go:610 0x465 gopls stats -anon{ "DirStats": { "Files": 2172, "TestdataFiles": 0, "GoFiles": 1626, "ModFiles": 2, "Dirs": 555 }, "GOARCH": "amd64", "GOOS": "windows", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.21.6", "GoplsVersion": "v0.15.3", "InitialWorkspaceLoadDuration": "3.818475s", "MemStats": { "HeapAlloc": 31110824, "HeapInUse": 40493056, "TotalAlloc": 86128408 }, "WorkspaceStats": { "Files": { "Total": 2205, "Largest": 1654271, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.21.6", "AllPackages": { "Packages": 417, "LargestPackage": 134, "CompiledGoFiles": 2217, "Modules": 49 }, "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. <OPTIONAL: ATTACH LOGS HERE> |
@Sangwaniya did you rebuild gopls after making this fix? |
Let's continue discussion on golang/go#67156. |
gopls version: v0.15.3/go1.21.6
gopls flags:
update flags: proxy
extension version: 0.41.4
environment: Visual Studio Code win32
initialization error: undefined
issue timestamp: Thu, 23 May 2024 12:47:58 GMT
restart history:
Thu, 23 May 2024 12:44:26 GMT: activation (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
gopls stats -anon
{ "DirStats": { "Files": 2172, "TestdataFiles": 0, "GoFiles": 1626, "ModFiles": 2, "Dirs": 563 }, "GOARCH": "amd64", "GOOS": "windows", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.21.6", "GoplsVersion": "v0.15.3", "InitialWorkspaceLoadDuration": "5.2947379s", "MemStats": { "HeapAlloc": 31101496, "HeapInUse": 39739392, "TotalAlloc": 69362360 }, "WorkspaceStats": { "Files": { "Total": 2207, "Largest": 1654271, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.21.6", "AllPackages": { "Packages": 417, "LargestPackage": 134, "CompiledGoFiles": 2217, "Modules": 49 }, "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>
The text was updated successfully, but these errors were encountered: