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/buildinfo: index out of range in buildinfo.Read #58137

Closed
catenacyber opened this issue Jan 29, 2023 · 5 comments
Closed

debug/buildinfo: index out of range in buildinfo.Read #58137

catenacyber opened this issue Jan 29, 2023 · 5 comments
Assignees
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.19 linux/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
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=""
GOTOOLDIR="/root/.go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/src/ngolo-fuzzing/go.mod"
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 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2481516251=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Run https://go.dev/play/p/ojlksZmmfU7

What did you expect to see?

The program finishing and printing Hello

What did you see instead?

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

goroutine 1 [running]:
internal/xcoff.NewFile({0x4f1528?, 0xc000016270})
	/usr/local/go-faketime/src/internal/xcoff/file.go:330 +0x1731
debug/buildinfo.readRawBuildInfo({0x4f1528, 0xc000016270})
	/usr/local/go-faketime/src/debug/buildinfo/buildinfo.go:128 +0x36c
debug/buildinfo.Read({0x4f1528?, 0xc000016270?})
	/usr/local/go-faketime/src/debug/buildinfo/buildinfo.go:74 +0x27
main.main()
	/tmp/sandbox2805455450/prog.go:12 +0x98

Program exited.

Found by https://github.com/catenacyber/ngolo-fuzzing with oss-fuzz :
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55444

@mknyszek mknyszek added compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jan 30, 2023
@mknyszek mknyszek added this to the Backlog milestone Jan 30, 2023
@mknyszek
Copy link
Contributor

CC @golang/compiler

@thanm
Copy link
Contributor

thanm commented Jan 30, 2023

@golang/aix

@AlexanderYastrebov
Copy link
Contributor

Looks similar to #54584

I think the ultimate fix of this error class could be to use unsigned integers for all struct fields of https://github.com/golang/go/blob/master/src/internal/xcoff/xcoff.go

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/464336 mentions this issue: internal/xcoff: use unsigned integers in file structs to avoid negative values

AlexanderYastrebov added a commit to AlexanderYastrebov/go that referenced this issue Feb 2, 2023
@mknyszek
Copy link
Contributor

mknyszek commented Feb 8, 2023

In triage now, I think this is waiting on a +2 from a @golang/aix owner. Assigning to @laboger who's one of the reviewers.

@mknyszek mknyszek moved this to In Progress in Go Compiler / Runtime Feb 8, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Go Compiler / Runtime Feb 8, 2023
johanbrandhorst pushed a commit to Pryz/go that referenced this issue Feb 12, 2023
…ve values

Fixes golang#58137
Updates golang#54584

Change-Id: Ifeee1be22051b842e0707d1907dbfa58bfeb336b
GitHub-Last-Rev: 9768e7c
GitHub-Pull-Request: golang#58164
Reviewed-on: https://go-review.googlesource.com/c/go/+/464336
Reviewed-by: Ayappan Perumal <ayappanec@gmail.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
@golang golang locked and limited conversation to collaborators Feb 8, 2024
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

Successfully merging a pull request may close this issue.

6 participants