Repository navigation
Closed
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Description
The following code:
package main
import (
"fmt"
"runtime"
"unsafe"
)
var callback func()
type T struct{
big2
}
//go:uintptrescapes
func (T) Mv(ptrs ...uintptr) { callback() }
var tests = []func(ptr unsafe.Pointer){
func(ptr unsafe.Pointer) { T{}.Mv(uintptr(ptr)) },
}
func main() {
for i, test := range tests {
finalized := false
ptr := new([64]byte)
runtime.SetFinalizer(ptr, func(*[64]byte) {
})
callback = func() {
if finalized {
fmt.Printf("test #%d failed\n", i)
}
}
test(unsafe.Pointer(ptr))
}
}
type big1 struct {
w [1<<30 - 1]uint32
}
type big2 struct {
d [1<<29 - 1]uint64
}
func loadLargeOffset(sw *big1, sd *big2) (uint32, uint64) {
a3 := sw.w[1<<10]
b3 := sw.w[1<<16]
c3 := sw.w[1<<28]
d3 := sw.w[1<<29]
a4 := sd.d[1<<10]
b4 := sd.d[1<<16]
c4 := sd.d[1<<27]
d4 := sd.d[1<<28]
return a3 + b3 + c3 + d3, a4 + b4 + c4 + d4
}
type big1_bd84f3a struct {
w [1<<30 - 1]uint32
}
type big2_bd84f3a struct {
d [1<<29 - 1]uint64
}
func loadLargeOffset_bd84f3a(sw *big1_bd84f3a, sd *big2_bd84f3a) (uint32, uint64) {
a3 := sw.w[1<<10]
b3 := sw.w[1<<16]
c3 := sw.w[1<<28]
d3 := sw.w[1<<29]
a4 := sd.d[1<<10]
b4 := sd.d[1<<16]
c4 := sd.d[1<<27]
d4 := sd.d[1<<28]
return a3 + b3 + c3 + d3, a4 + b4 + c4 + d4
}Resulted in this output:
# fflreduce
./main.go:14:35: internal compiler error: 'init.func1': ZeroLoop too small:-8, expect:192
goroutine 23 [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({0xcf74b2d0?, 0x11b9?}, {0x11b9cf74b270, 0x26}, {0x11b9cf67db90, 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(0x9661ca?, {0xcf9800a0?, 0x11b9?}, {0x106f576, 0x20}, {0x11b9cf5f3ea0, 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(0x11b9cf726000, {0x19b4ae0?, 0x0?}, {0x106f576, 0x20}, {0x11b9cf5f3ea0, 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(0x11b9cf9800a0, 0x11b9cebf4e30)
/home/fuzz/WorkSpace/fusion-fuzz/projects/go/go-src/src/cmd/compile/internal/riscv64/ssa.go:818 +0xb09
cmd/compile/internal/ssagen.genssa({0x1a73ba8, 0x0}, 0x11b9cf726000, 0x11b9cf65daa0)
/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}, 0x11b9ce62c8c0, 0xd, 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
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.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.)
YuanchengJiang commentedon Aug 31, 2026
reduced to:
dr2chase commentedon Aug 31, 2026
@golang/riscv64
thepudds commentedon Aug 31, 2026
FWIW, this also seems not new to Go 1.27.
Currently running a bisect, and the remaining window is in early September, 2025.
thepudds commentedon Aug 31, 2026
Bisect seemed to land on 879ff73, which is one commit off from where the #81240 bisect landed:
CC @mengzhuo
HeliC829 commentedon Aug 31, 2026
It looks like the log “ZeroLoop too small:” is coming from https://go-review.googlesource.com/c/go/+/699635
[-]ICE: ZeroLoop too small[/-][+]cmd/compile: internal compiler error: ZeroLoop 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