Skip to content

cmd/compile: panic: runtime error: index out of range in ssagen #78876

Description

@matthewdupre

Go version

1.26.2

Output of go env in your module/workspace:

Starting with UID: 9001
AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/user/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/user/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2830984150=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/user/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.26.2'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

Compile a fairly large closed source project which I unfortunately cannot share with you. The issue is intermittent, and later reruns passed. Note that the compilation happens in parallel with other go builds.

What did you see happen?

panic: runtime error: index out of range [-536880912]

goroutine 60 [running]:
cmd/compile/internal/ssagen.genssa.func1(0x4ccb3780?, 0x10ee?)
	cmd/compile/internal/ssagen/ssa.go:7337 +0xeb
cmd/compile/internal/ssa.(*FuncDebug).PutLocationListDwarf5(0x104b0c0?, {0x10ee4d23bf40, 0x13, 0x3c}, 0x10ee4771a488, 0x10ee4ccb3780, 0x10ee4c357600)
	cmd/compile/internal/ssa/debug.go:1502 +0x246
cmd/compile/internal/ssa.(*FuncDebug).PutLocationList(0x58f4f5?, {0x10ee4d23bf40?, 0x10ee4ccb3700?, 0x5?}, 0x10ee4c60e580?, 0x1?, 0xffffffffffffffff?)
	cmd/compile/internal/ssa/debug.go:1478 +0x25
cmd/compile/internal/dwarfgen.createComplexVars.createComplexVar.func1({0x104b0c0?, 0x10ee4ccb3780?}, {0x104b0c0?, 0x10ee4c357600?})
	cmd/compile/internal/dwarfgen/dwarf.go:568 +0x5f
cmd/internal/dwarf.putvar(...)
	cmd/internal/dwarf/dwarf.go:1635
cmd/internal/dwarf.putscope({0x10d4ec8, 0x10ee4771a488}, 0x10ee4ce3dd50, {0x10ee4cfc5b80, 0x1, 0x1}, 0x0, 0x6, {0x10ee4d2667b0, 0x0, ...})
	cmd/internal/dwarf/dwarf.go:1509 +0xb4e
cmd/internal/dwarf.putPrunedScopes({0x10d4ec8, 0x10ee4771a488}, 0x10ee4ce3dd50, 0x6)
	cmd/internal/dwarf/dwarf.go:1191 +0x5ba
cmd/internal/dwarf.PutConcreteFunc({0x10d4ec8, 0x10ee4771a488}, 0x10ee4ce3dd50, 0x0, 0x10ee49d3da40?)
	cmd/internal/dwarf/dwarf.go:1388 +0x247
cmd/internal/obj.(*Link).populateDWARF(...)
	cmd/internal/obj/dwarf.go:384
cmd/internal/obj.Flushplist(0x10ee4771a488, 0x10ee4ce3df18, 0x10ee4d210420)
	cmd/internal/obj/plist.go:173 +0x13d9
cmd/compile/internal/objw.(*Progs).Flush(...)
	cmd/compile/internal/objw/prog.go:112
cmd/compile/internal/ssagen.Compile(0x10ee49d3da40, 0x0, 0x0?)
	cmd/compile/internal/ssagen/pgen.go:329 +0x6df
cmd/compile/internal/gc.compileFunctions.func5.1(0x10ee475b3680?)
	cmd/compile/internal/gc/compile.go:199 +0x38
cmd/compile/internal/gc.compileFunctions.func3.1()
	cmd/compile/internal/gc/compile.go:181 +0x30
created by cmd/compile/internal/gc.compileFunctions.func3 in goroutine 17
	cmd/compile/internal/gc/compile.go:180 +0x325

What did you expect to see?

The compiler not panic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions