Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug/dwarf: slice bounds out of range in SeekPC #55948

Closed
catenacyber opened this issue Sep 29, 2022 · 2 comments
Closed

debug/dwarf: slice bounds out of range in SeekPC #55948

catenacyber opened this issue Sep 29, 2022 · 2 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@catenacyber
Copy link
Contributor

What version of Go are you using (go version)?

$ go version
go version go1.18.3 darwin/amd64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/catena/Library/Caches/go-build"
GOENV="/Users/catena/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/catena/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/catena/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18.3"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/pp/dc1dtf9x2js3v0jx_m010nqr0000gn/T/go-build2205394633=/tmp/go-build -gno-record-gcc-switches -fno-common"
GOROOT/bin/go version: go version go1.18.3 darwin/amd64
GOROOT/bin/go tool compile -V: compile version go1.18.3
uname -v: Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64
ProductName:	macOS
ProductVersion:	12.6
BuildVersion:	21G115
lldb --version: lldb-1400.0.30.3
Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50)
gdb --version: GNU gdb (GDB) 12.1

What did you do?

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

What did you expect to see?

The program printing Hello

What did you see instead?

panic: runtime error: slice bounds out of range [-1:]

goroutine 1 [running]:
debug/dwarf.(*Data).dwarf2Ranges(0xc000002180?, 0xb?, 0x0?, 0x0?, {0x0?, 0x9c?, 0x9c?})
	/usr/local/go-faketime/src/debug/dwarf/entry.go:1110 +0x365
debug/dwarf.(*Data).Ranges(0xc000002180, 0xc000016360)
	/usr/local/go-faketime/src/debug/dwarf/entry.go:1069 +0x2fd
debug/dwarf.(*Reader).SeekPC(0xc000074ed8, 0x0)
	/usr/local/go-faketime/src/debug/dwarf/entry.go:981 +0x227
main.main()
	/tmp/sandbox721696693/prog.go:13 +0x339

Program exited.

Found by ngolo-fuzzing https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51961

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Sep 29, 2022
@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 29, 2022
@dmitshur dmitshur added this to the Backlog milestone Sep 29, 2022
@dmitshur
Copy link
Contributor

CC @golang/compiler.

@gopherbot
Copy link

Change https://go.dev/cl/436876 mentions this issue: debug/dwarf: don't crash on negative range/rnglist offset

@golang golang locked and limited conversation to collaborators Oct 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants