#!stacks
"gopanic" && "golang.org/x/tools/go/ast/inspector.(*visitor).push:+24"
Issue created by stacks.
func (v *visitor) push(ek edge.Kind, eindex int, node ast.Node) {
...
// 32M elements in an []ast.Node ought to be enough for anyone!
if ek2, eindex2 := unpackEdgeKindAndIndex(packEdgeKindAndIndex(ek, eindex)); ek2 != ek || eindex2 != eindex {
panic("Node slice index exceeded uint25")
}
}
This stack dYd0DQ
was reported by telemetry:
crash/crash
runtime.gopanic:+69,+0x167
golang.org/x/tools/go/ast/inspector.(*visitor).push:+24,+0x22f
golang.org/x/tools/go/ast/inspector.walk:+1,+0x39
golang.org/x/tools/go/ast/inspector.walkList[...]:=21,+0x2b44
golang.org/x/tools/go/ast/inspector.walk:+49,+0x2b14
golang.org/x/tools/go/ast/inspector.walkList[...]:=21,+0x1d8d
golang.org/x/tools/go/ast/inspector.walk:+260,+0x1d65
golang.org/x/tools/go/ast/inspector.walkList[...]:=21,+0x3fee
golang.org/x/tools/go/ast/inspector.walk:+285,+0x3c1
golang.org/x/tools/go/ast/inspector.walkList[...]:=21,+0x2cb4
golang.org/x/tools/go/ast/inspector.walk:+305,+0xcd4
golang.org/x/tools/go/ast/inspector.traverse:+18,+0x13d
golang.org/x/tools/go/ast/inspector.New:=74,+0x4e6
golang.org/x/tools/gopls/internal/cache/parsego.Parse:+75,+0x4ca
golang.org/x/tools/gopls/internal/cache.(*parseCache).startParse.func1:+5,+0xf5
golang.org/x/tools/internal/memoize.(*Promise).run.func2.1:+7,+0x95
runtime/trace.WithRegion:+19,+0xd0
golang.org/x/tools/internal/memoize.(*Promise).run.func2:+1,+0x11c
runtime.goexit:+0,+0x0
golang.org/x/tools/gopls@v0.19.1 go1.24.4 windows/amd64 other,vscode-insiders (6)
Comment From: adonovan
The crash is trivial to reproduce by loading the output of this program into gopls:
fmt.Println(`package p; var _ = []int{`)
fmt.Println(strings.Repeat("0,", 1<<25))
fmt.Println(`}`)
Not sure how to fix it, nor whether fixing it should be a priority. Fixing the code generator would be a better solution.
Comment From: gabyhelp
Related Issues
- x/tools/gopls: slice OOB panic in fixAST on array type #70745 (closed)
- x/tools/gopls: xrefs.Index panics after "can't fail" pgf.PosRange #70446 (closed)
- x/tools/gopls: Parse: crash in fixInitStmt #72026 (closed)
- x/tools/gopls: sigpanic in persistent.(*mapNode).forEach (bad SP) #71115
- x/tools/gopls: Inline: panic in falcon analysis (unexpected core type) #74393 (closed)
- x/tools/gopls: panic in aeshashbody on behalf of mapaccess2_faststr: string memory corrupted #71367
- x/tools/gopls: OOM reported by fatal in runtime.mallocgc (windows) #70445 (closed)
- x/tools/gopls: analysisinternal.ZeroValue crash on (presumably) unsafe.Pointer #70585 (closed)
- x/tools/gopls: slice bounds out of range - internal/lsp/cache.fixArrayType #58943 (closed)
- x/tools/gopls: illegal line number panic #37226 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)