cmd/link: Oversize object file (example uses generics) causes confusing "slice bounds out of range" panic #66357
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.
Milestone
Go version
go version go1.21.8 linux/amd64
Output of
go env
in your module/workspace:What did you do?
We updated our AWS SDK v1 version and existing code started failing. I distilled it down to this minimal case. The issue happens when the generated object in the GOCACHE goes above 4GB. The goobj/objfile Header appears to be using a uint32, which seems like an overflow might be happening when calculating the offsets. I dumped the headers from one of the objects while investigating (not the minimal case above, so offsets are a little different):
I tested it in a few other versions:
1.22.1 - compiles
1.22.0 - compiles
1.22rc2 - compiles
1.22rc1 - fails for same reason
What did you see happen?
What did you expect to see?
A successful build
The text was updated successfully, but these errors were encountered: