gopls: automated issue report (crash)
akhilparakka opened this issue · 6 comments
gopls version: v0.17.0-pre.3/go1.23.3
gopls flags:
update flags: proxy
extension version: 0.43.3
environment: Visual Studio Code linux
initialization error: undefined
issue timestamp: Wed, 27 Nov 2024 10:47:25 GMT
restart history:
Wed, 27 Nov 2024 10:47:19 GMT: activation (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
Please attach the stack trace from the crash.
A window with the error message should have popped up in the lower half of your screen.
Please copy the stack trace and error messages from that window and paste it in this issue.
Failed to auto-collect gopls trace: no gopls log.
gopls stats -anon
{ "DirStats": { "Files": 10, "TestdataFiles": 0, "GoFiles": 6, "ModFiles": 1, "Dirs": 5 }, "GOARCH": "amd64", "GOOS": "linux", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.23.3", "GoplsVersion": "v0.17.0-pre.3", "InitialWorkspaceLoadDuration": "539.498729ms", "MemStats": { "HeapAlloc": 128067280, "HeapInUse": 146882560, "TotalAlloc": 499427544 }, "WorkspaceStats": { "Files": { "Total": 1829, "Largest": 1189266, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.23.0", "AllPackages": { "Packages": 312, "LargestPackage": 165, "CompiledGoFiles": 1826, "Modules": 34 }, "WorkspacePackages": { "Packages": 5, "LargestPackage": 2, "CompiledGoFiles": 7, "Modules": 1 }, "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>
I'm sorry, Did not check that. Will Update here Next time it happens. Thanks
@findleyr I am facing a similar issue.
Not sure what might be the problem here.
Output from gopls(server):
goroutine 14705 gp=0x14019f40700 m=nil [select]:
runtime.gopark(0x14019f3e610?, 0x3?, 0x0?, 0x0?, 0x14019f3e5a2?)
/Users/beingnoble/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.darwin-arm64/src/runtime/proc.go:424 +0xc8 fp=0x14019f3e430 sp=0x14019f3e410 pc=0x10442fa98
runtime.selectgo(0x14019f3e610, 0x14019f3e59c, 0x14007b00880?, 0x0, 0x0?, 0x1)
/Users/beingnoble/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.darwin-arm64/src/runtime/select.go:335 +0x67c fp=0x14019f3e560 sp=0x14019f3e430 pc=0x10440bafc
golang.org/x/tools/gopls/internal/cache.(*futureCache[...]).get(0x105275e60, {0x105277ea8, 0x14012426720}, {0x14007b00880, 0x1f}, 0x14019f3e6c8)
/Users/beingnoble/go/pkg/mod/golang.org/x/tools/gopls@v0.17.0/internal/cache/future.go:118 +0x2b8 fp=0x14019f3e680 sp=0x14019f3e560 pc=0x104bc02a8
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage(0x0?, {0x105277ea8?, 0x14012426720?}, {0x14007b00880?, 0x0?})
/Users/beingnoble/go/pkg/mod/golang.org/x/tools/gopls@v0.17.0/internal/cache/check.go:313 +0x60 fp=0x14019f3e6f0 sp=0x14019f3e680 pc=0x104b7d830
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getPackage.func1.1()
/Users/beingnoble/go/pkg/mod/golang.org/x/tools/gopls@v0.17.0/internal/cache/check.go:387 +0x50 fp=0x14019f3e760 sp=0x14019f3e6f0 pc=0x104b7e230
golang.org/x/sync/errgroup.(*Group).Go.func1()
/Users/beingnoble/go/pkg/mod/golang.org/x/sync@v0.9.0/errgroup/errgroup.go:78 +0x54 fp=0x14019f3e7d0 sp=0x14019f3e760 pc=0x1044ed624
runtime.goexit({})
/Users/beingnoble/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.darwin-arm64/src/runtime/asm_arm64.s:1223 +0x4 fp=0x14019f3e7d0 sp=0x14019f3e7d0 pc=0x1044388f4
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 13196
/Users/beingnoble/go/pkg/mod/golang.org/x/sync@v0.9.0/errgroup/errgroup.go:75 +0x98
@beingnoble03 that is not a crashing goroutine, it is just a goroutine waiting on a select statement. Is there anything else in the output window? Also, which gopls version are you using?
Oh sorry! @findleyr
Here's the panic output:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x8 pc=0x100d91b7c]
goroutine 17404 gp=0x14018776700 m=17 mp=0x14016f04008 [running]:
panic({0x101357da0?, 0x101b51f40?})
/Users/beingnoble/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.darwin-arm64/src/runtime/panic.go:804 +0x154 fp=0x14018b0d8e0 sp=0x14018b0d830 pc=0x10064f724
runtime.panicmem(...)
/Users/beingnoble/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.darwin-arm64/src/runtime/panic.go:262
runtime.sigpanic()
/Users/beingnoble/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.darwin-arm64/src/runtime/signal_unix.go:917 +0x300 fp=0x14018b0d940 sp=0x14018b0d8e0 pc=0x100651bf0
go/types.(*Package).Path(...)
/Users/beingnoble/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.darwin-arm64/src/go/types/package.go:34
golang.org/x/tools/gopls/internal/cache/testfuncs.testKind(0x0?)
/Users/beingnoble/go/pkg/mod/golang.org/x/tools/gopls@v0.17.0/internal/cache/testfuncs/tests.go:284 +0xcc fp=0x14018b0d970 sp=0x14018b0d950 pc=0x100d91b7c
golang.org/x/tools/gopls/internal/cache/testfuncs.isTestOrExample(0x140157c4a80)
/Users/beingnoble/go/pkg/mod/golang.org/x/tools/gopls@v0.17.0/internal/cache/testfuncs/tests.go:254 +0xc8 fp=0x14018b0d9f0 sp=0x14018b0d970 pc=0x100d91908
golang.org/x/tools/gopls/internal/cache/testfuncs.(*indexBuilder).build(0x14018b0db78, {0x1401898a108, 0x3, 0x3}, 0x1401384d8c0)
/Users/beingnoble/go/pkg/mod/golang.org/x/tools/gopls@v0.17.0/internal/cache/testfuncs/tests.go:85 +0x240 fp=0x14018b0db20 sp=0x14018b0d9f0 pc=0x100d90890
golang.org/x/tools/gopls/internal/cache/testfuncs.NewIndex(...)
/Users/beingnoble/go/pkg/mod/golang.org/x/tools/gopls@v0.17.0/internal/cache/testfuncs/tests.go:60
golang.org/x/tools/gopls/internal/cache.(*syntaxPackage).tests.func1()
/Users/beingnoble/go/pkg/mod/golang.org/x/tools/gopls@v0.17.0/internal/cache/package.go:86 +0x80 fp=0x14018b0dbb0 sp=0x14018b0db20 pc=0x100dbd690
sync.(*Once).doSlow(0x14016f04008?, 0x14016f04580?)
/Users/beingnoble/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.darwin-arm64/src/sync/once.go:76 +0xf8 fp=0x14018b0dc10 sp=0x14018b0dbb0 pc=0x100664eb8
sync.(*Once).Do(...)
/Users/beingnoble/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.darwin-arm64/src/sync/once.go:67
golang.org/x/tools/gopls/internal/cache.(*syntaxPackage).tests(0x14012eb3d40)
/Users/beingnoble/go/pkg/mod/golang.org/x/tools/gopls@v0.17.0/internal/cache/package.go:85 +0x4c fp=0x14018b0dc40 sp=0x14018b0dc10 pc=0x100dbd5dc
golang.org/x/tools/gopls/internal/cache.storePackageResults({0x101497ea8, 0x140160c7350}, 0x140120970e0, 0x1401b593c20)
/Users/beingnoble/go/pkg/mod/golang.org/x/tools/gopls@v0.17.0/internal/cache/check.go:438 +0x1b4 fp=0x14018b0dfa0 sp=0x14018b0dc40 pc=0x100d9e514
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getPackage.func1.gowrap1()
/Users/beingnoble/go/pkg/mod/golang.org/x/tools/gopls@v0.17.0/internal/cache/check.go:426 +0x34 fp=0x14018b0dfd0 sp=0x14018b0dfa0 pc=0x100d9e164
runtime.goexit({})
/Users/beingnoble/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.darwin-arm64/src/runtime/asm_arm64.s:1223 +0x4 fp=0x14018b0dfd0 sp=0x14018b0dfd0 pc=0x1006588f4
created by golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getPackage.func1 in goroutine 14636
/Users/beingnoble/go/pkg/mod/golang.org/x/tools/gopls@v0.17.0/internal/cache/check.go:426 +0x334
I am using gopls v0.17.0
Thank you very much, @beingnoble03! I can reproduce that crash. We will fix this in gopls@v0.17.1.
I will create a gopls issue to track the fix.
