Open jstbyte opened 7 months ago
CC @adonovan: another mysterious case where analysisNode.summary
may be nil.
It's definitely the summary and not the root that is nil.
xtools$ git co gopls/v0.15.2
xtools$ GOOS=windows GOARCH=amd64 GOTOOLCHAIN=go1.20.1 go build -o x ./gopls
xtools$ go tool objdump -S x | less
...
0xa7a81c 48898c2470010000 MOVQ CX, 0x170(SP)
srcAnalyzer, ok := toSrc[a]
0xa7a824 488d05155a4000 LEAQ type:*+799296(SB), AX
0xa7a82b 488d9c2448030000 LEAQ 0x348(SP), BX
0xa7a833 e8487f99ff CALL runtime.mapaccess2_fast64(SB)
0xa7a838 488b10 MOVQ 0(AX), DX
0xa7a83b 0f1f440000 NOPL 0(AX)(AX*1)
0xa7a840 84db TESTL BL, BL
if !ok {
0xa7a842 0f84b0000000 JE 0xa7a8f8
srcAnalyzer, ok := toSrc[a]
0xa7a848 48899424f8000000 MOVQ DX, 0xf8(SP) // spill srcAnalyzer
summary, ok := root.summary.Actions[stableNames[a]]
0xa7a850 488b942408010000 MOVQ 0x108(SP), DX
0xa7a858 488b7278 MOVQ 0x78(DX), SI // load root.summary
0xa7a85c 488b7640 MOVQ 0x40(SI), SI // load analyzeSummary.Actions <-- SEGV here
0xa7a860 4889b42498010000 MOVQ SI, 0x198(SP)
0xa7a868 488b8c2470010000 MOVQ 0x170(SP), CX
0xa7a870 488d05e95a4000 LEAQ type:*+799584(SB), AX // type for stableNames map
0xa7a877 488b9c24f0000000 MOVQ 0xf0(SP), BX
0xa7a87f 90 NOPL
0xa7a880 e85b7d99ff CALL runtime.mapaccess1_fast64(SB)
(Lovin' the new hover size/offset feature!)
Change https://go.dev/cl/577435 mentions this issue: gopls/internal/cache: add debug assertions to refine golang/go#66732
Change https://go.dev/cl/577596 mentions this issue: [gopls-release-branch.0.15] gopls/internal/cache: add debug assertions to refine golang/go#66732
This stack 3DjTOg
was reported by telemetry:
"root analysisNode has nil summary"
gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Report:=68
golang.org/x/tools/gopls/internal/cache.(*Snapshot).Analyze:+263
golang.org/x/tools/gopls/internal/golang.Analyze:+12
golang.org/x/tools/gopls/internal/server.(*server).diagnose.func6:+5
runtime.goexit:+0
golang.org/x/tools/gopls@v0.16.2-pre.1 go1.22.2 linux/amd64 other,vscode-insiders (1)
Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.
This may still be a problem but I'm bumping to v0.18.0 as the analysis driver has changed significantly; let's reevaluate after v0.17.0.
gopls version: v0.15.2/go1.20.1 gopls flags: update flags: proxy extension version: 0.41.2 environment: Visual Studio Code win32 initialization error: undefined issue timestamp: Sun, 07 Apr 2024 03:13:55 GMT restart history: Sun, 07 Apr 2024 03:01:06 GMT: activation (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
gopls stats -anon
{ "DirStats": { "Files": 2, "TestdataFiles": 0, "GoFiles": 1, "ModFiles": 1, "Dirs": 1 }, "GOARCH": "amd64", "GOOS": "windows", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.20.1", "GoplsVersion": "v0.15.2", "InitialWorkspaceLoadDuration": "1.8348831s", "MemStats": { "HeapAlloc": 2531088, "HeapInUse": 5169152, "TotalAlloc": 12289392 }, "WorkspaceStats": { "Files": { "Total": 2, "Largest": 60, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.2", "AllPackages": { "Packages": 1, "LargestPackage": 1, "CompiledGoFiles": 1, "Modules": 1 }, "WorkspacePackages": { "Packages": 1, "LargestPackage": 1, "CompiledGoFiles": 1, "Modules": 1 }, "Diagnostics": 0 } ] } }