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

cmd/link/internal/loader: panic: runtime error: index out of range [1232602353] with length 116 #69214

Closed
krhubert opened this issue Sep 2, 2024 · 5 comments
Labels
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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@krhubert
Copy link

krhubert commented Sep 2, 2024

Go version

go version go1.23.0 linux/amd64

Output of go env in your module/workspace:

GO111MODULE='auto'
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/user/.cache/go-build'
GOENV='/home/user/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/user/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/user'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org'
GOROOT='/home/user/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/user/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.0'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/user/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/user/src/project/backend/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 -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build356147905=/tmp/go-build -gno-record-gcc-switches'

What did you do?

Run

go build

Can't trace this right now, and give you a reproducible source code, because I'm not sure what's the root case. I'll keep looking.

What did you see happen?

panic: runtime error: index out of range [1232602353] with length 116

goroutine 1 [running]:
cmd/link/internal/loader.(*Loader).resolve(0xc000778008?, 0x15765d0003eef9?, {0x4?, 0x0?})
        cmd/link/internal/loader/loader.go:647 +0x178
cmd/link/internal/loader.Aux.Sym(...)
        cmd/link/internal/loader/loader.go:73
cmd/link/internal/ld.(*deadcodePass).flood(0xc0000fd688)
        cmd/link/internal/ld/deadcode.go:280 +0xed4
cmd/link/internal/ld.deadcode(0xc0001a6200)
        cmd/link/internal/ld/deadcode.go:440 +0x7d
cmd/link/internal/ld.Main(_, {0x20, 0x20, 0x1, 0x7, 0x10, 0x0, {0xc000012521, 0x1, 0x1}, ...})
        cmd/link/internal/ld/main.go:360 +0x1318
main.main()
        cmd/link/main.go:72 +0xddb

What did you expect to see?

go build without errors

@ianlancetaylor
Copy link
Contributor

Has this happened more than once?

I think we're going to need a way to reproduce the problem.

@krhubert
Copy link
Author

krhubert commented Sep 3, 2024

Has this happened more than once?

Yes

I think we're going to need a way to reproduce the problem.

It's gonna be extremely hard to me to reproduce it.

This happened when I worked on my project and switched between branches.
On the main branch, go build returned without errors, but on other branch with a single commit added,
go build panicked. Today I can't reproduce this case, but yesterday it was like that until a restarted WSL.

I'm not sure if/how I can help more. If there's not enough data to reproduce it I can close this issue.

@dmitshur dmitshur added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. compiler/runtime Issues related to the Go compiler and/or runtime. labels Sep 4, 2024
@dmitshur dmitshur added this to the Backlog milestone Sep 4, 2024
@cherrymui
Copy link
Member

Could you try clear the build cache (go clean -cache) and see if you can still reproduce?

It could be some file corruption in the build cache, or when you switched branch, there was actually some collision in the build cache.

@cherrymui cherrymui added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Sep 4, 2024
@gopherbot
Copy link
Contributor

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
Development

No branches or pull requests

6 participants