Skip to content

debug/elf: panic slice out of range in DWARF #75516

@catenacyber

Description

@catenacyber

Go version

go version go1.23.4 linux/amd64

Output of go env in your module/workspace:

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

What did you do?

Run https://go.dev/play/p/au5FqKXuhYH?v=gotip

Found by ngolo-fuzzing https://issues.oss-fuzz.com/u/1/issues/445759373?pli=1

What did you see happen?

panic: runtime error: slice bounds out of range [18446744073709551615:3]

goroutine 1 [running]:
debug/elf.(*File).applyRelocationsAMD64(0x2e5ffa0e000?, {0x2e5ffa0c000, 0xa3, 0xa3}, {0x2e5ffa0e000, 0x138, 0x138})
/usr/local/go-faketime/src/debug/elf/file.go:843 +0x365
debug/elf.(*File).applyRelocations(0x2e5ffa00e80?, {0x2e5ffa0c000?, 0x2e5ff8fa167?, 0x4?}, {0x2e5ffa0e000?, 0xe?, 0x0?})
/usr/local/go-faketime/src/debug/elf/file.go:762 +0x31
debug/elf.(*File).DWARF.func2(0x1b, 0x2e5ffa00e00)
/usr/local/go-faketime/src/debug/elf/file.go:1376 +0xfa
debug/elf.(*File).DWARF(0x2e5ff96a210)
/usr/local/go-faketime/src/debug/elf/file.go:1395 +0x37a
main.main()
/tmp/sandbox2152432672/prog.go:13 +0x9e

Program exited.

What did you expect to see?

no panic

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions