Skip to content

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

Closed
Sangwaniya opened this issue May 24, 2024 · 7 comments
Closed

gopls: automated issue report (crash) #3401

Sangwaniya opened this issue May 24, 2024 · 7 comments

Comments

@Sangwaniya
Copy link

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.

panic: runtime error: slice bounds out of range [45:44]

goroutine 6640 [running]:
golang.org/x/tools/internal/imports.(*ModuleResolver).scanDirForPackage(0xc00076c8f0, {{0xc009370705%3F, 0x7558ca276deb0b9c%3F}, 0x8%3F}, {0xc0003e62a0, 0x2c})
	  mod.go:727  0x705
golang.org/x/tools/internal/imports.(*ModuleResolver).scan.func3({{0xc009370705%3F, 0x1a05e20%3F}, 0xc003398180%3F}, {0xc0003e62a0%3F, 0x24112a8%3F})
	  mod.go:601  0x50
golang.org/x/tools/internal/gopathwalk.(*walker).walk(0xc009776a20, {0xc003766ec0, 0x37}, 0x0, {0x1e40af8, 0xc00370ed90})
	  walk.go:268  0x3d7
golang.org/x/tools/internal/gopathwalk.(*walker).walk(0xc009776a20, {0xc009370705, 0x2c}, 0x0, {0x1e40b30, 0xc003398160})
	  walk.go:334  0x87b
golang.org/x/tools/internal/gopathwalk.walkDir({{0xc009370705%3F, 0xc003a53f18%3F}, 0xc003a53f18%3F}, 0xc003398130, 0xc003398120, {0x0%3F, 0x20%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 4798
	  mod.go:610  0x465
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>

@gopherbot gopherbot added this to the Untriaged milestone May 24, 2024
@Sangwaniya
Copy link
Author

this issue is the same that golang/go#67156
So closing this one

@findleyr
Copy link
Member

@Sangwaniya do you by any chance have a replace directive in your go.mod file? Perhaps one that is an absolute windows file path?

@Sangwaniya
Copy link
Author

Sangwaniya commented May 27, 2024

@findleyr yes i forgot about that
in windows path separator value is "\" (double backslash) butt i changed to '/' to avoid error while extracting data from aws using cli.
image
after that i haven't changed back, btw windows always giving error due to this path separator value, needs to update it on many tasks 😵‍💫

@findleyr
Copy link
Member

@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.

@Sangwaniya
Copy link
Author

@findleyr I corrected the path separator value but still gopls crashing.
here is crashing report after the correcting the path separator value:
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: Wed, 29 May 2024 14:11:39 GMT
restart history:
Wed, 29 May 2024 14:08:10 GMT: activation (enabled: true)

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.
DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.

<OPTIONAL: ATTACH LOGS HERE>

@Sangwaniya Sangwaniya reopened this May 29, 2024
@findleyr
Copy link
Member

@Sangwaniya did you rebuild gopls after making this fix?

@findleyr
Copy link
Member

Let's continue discussion on golang/go#67156.

@findleyr findleyr closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
@golang golang locked and limited conversation to collaborators May 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants