Repository navigation
Closed
Labels
NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Milestone
Description
The following code:
package main
type large struct {
large_d430158
b [1500000000]byte
}
func (x large) f1() int {
return 5
}
type large_d430158 struct {
b [1500000000]byte
}Resulted in this output:
# fflreduce
<autogenerated>:1: internal compiler error: '(*large).f1': MoveLoop too small:-1294967296, expect:24
goroutine 53 [running]:
runtime/debug.Stack()
/home/fuzz/WorkSpace/fusion-fuzz/projects/go/go-src/src/runtime/debug/stack.go:26 +0x5e
cmd/compile/internal/base.FatalfAt({0x40e072d0?, 0xc8d?}, {0xc8d40e07270, 0x26}, {0xc8d3ffcfaa0, 0x3, 0x3})
/home/fuzz/WorkSpace/fusion-fuzz/projects/go/go-src/src/cmd/compile/internal/base/print.go:232 +0x18b
cmd/compile/internal/base.Fatalf(...)
/home/fuzz/WorkSpace/fusion-fuzz/projects/go/go-src/src/cmd/compile/internal/base/print.go:197
cmd/compile/internal/ssagen.(*ssafn).Fatalf(0x0?, {0x1ccfdc0?, 0x0?}, {0x106f596, 0x20}, {0xc8d3ffd46c0, 0x2, 0x8?})
/home/fuzz/WorkSpace/fusion-fuzz/projects/go/go-src/src/cmd/compile/internal/ssagen/ssa.go:8056 +0x185
cmd/compile/internal/ssa.(*Func).FatalfWithPos(0xc8d3fd021c0, {0x19b4ae0?, 0x0?}, {0x106f596, 0x20}, {0xc8d3ffd46c0, 0x2, 0x2})
/home/fuzz/WorkSpace/fusion-fuzz/projects/go/go-src/src/cmd/compile/internal/ssa/func.go:801 +0x190
cmd/compile/internal/ssa.(*Value).Fatalf(...)
/home/fuzz/WorkSpace/fusion-fuzz/projects/go/go-src/src/cmd/compile/internal/ssa/value.go:559
cmd/compile/internal/riscv64.ssaGenValue(0xc8d3ffc6be0, 0xc8d40d14550)
/home/fuzz/WorkSpace/fusion-fuzz/projects/go/go-src/src/cmd/compile/internal/riscv64/ssa.go:909 +0xe2f
cmd/compile/internal/ssagen.genssa({0x1a73ba8, 0x0}, 0xc8d3fd021c0, 0xc8d3ffc5ce0)
/home/fuzz/WorkSpace/fusion-fuzz/projects/go/go-src/src/cmd/compile/internal/ssagen/ssa.go:7181 +0x19ac
cmd/compile/internal/ssagen.Compile({0x1a71270, 0x1d10160}, 0xc8d3fd72780, 0x2b, 0x0?)
/home/fuzz/WorkSpace/fusion-fuzz/projects/go/go-src/src/cmd/compile/internal/ssagen/pgen.go:316 +0x513
cmd/compile/internal/gc.compileFunctions.func2()
/home/fuzz/WorkSpace/fusion-fuzz/projects/go/go-src/src/cmd/compile/internal/gc/compile.go:174 +0x1b9
sync.(*WaitGroup).Go.func1()
/home/fuzz/WorkSpace/fusion-fuzz/projects/go/go-src/src/sync/waitgroup.go:258 +0x4a
created by sync.(*WaitGroup).Go in goroutine 1
/home/fuzz/WorkSpace/fusion-fuzz/projects/go/go-src/src/sync/waitgroup.go:238 +0x7d
To reproduce:
GOOS=linux GOARCH=riscv64 go build .
Compiler version:
go version go1.28-devel_603439a1 Fri Aug 28 21:44:26 2026 -0700 linux/amd64
Commit:
603439a1c6f2d37c7f02e246342847056ed04c21
Build configuration:
cd src && ./make.bash (GOROOT_BOOTSTRAP=go1.26.0)
Operating System:
Ubuntu 22.04 Host, Docker fusion-fuzz-go:latest
This bug was found by fusion-fuzz
Metadata
Metadata
Assignees
Labels
NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Type
Projects
- StatusShow more project fieldsDone
Activity
gabyhelp commentedon Aug 31, 2026
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
thepudds commentedon Aug 31, 2026
On linux/amd64 (including on playground), this reports:
A bisect treating the ICE as "BAD" and cross compiling for
GOARCH=riscv64seemed to land on 4dac9e0:The "GOOD" parent commit reported
stack frame too large (>1GB).CC @mengzhuo @golang/compiler
mengzhuo commentedon Aug 31, 2026
That's fun, I only changed riscv64 related part...
OP shows underflow
MoveLoop too small:-1294967296, expect:24whilestack frame too largerandall77 commentedon Aug 31, 2026
Looks like this is a problem with packing a move size into 32 bits, here:
go/src/cmd/compile/internal/ssa/_gen/RISCV64.rules
Line 457 in 4283cd5
We need to do this on riscv64 because we also need to record alignment. Probably we should put alignment in the Aux field instead, so we have a full 64 bits for the size.
[-]ICE: MoveLoop too small[/-][+]cmd/compile: internal compiler error: MoveLoop too small[/+]gopherbot commentedon Aug 31, 2026
Change https://go.dev/cl/824984 mentions this issue:
cmd/compile: fix large riscv64 move/zerocmd/compile: fix large riscv64 move/zero
randall77 commentedon Sep 1, 2026
@gopherbot Please open backport issues.
This original report is not really strong motivation, as it is an ICE that is happening before we would otherwise report a "stack frame too big" error.
But this could be more insidious. For large types (>2GB?), at certain sizes the compiler will silently incompletely zero or copy those types. Such types are probably really rare, but we should either compile them correctly, or barf somehow. Compiling them incorrectly is pretty bad.
gopherbot commentedon Sep 1, 2026
Backport issue(s) opened: #81295 (for 1.26), #81296 (for 1.27).
Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.