Skip to content

cmd/compile: internal compiler error on : "tried to free an already free register" with generic function and type >= 192 bytes #77604

@Janso123

Description

@Janso123

Go version

go version go1.26.0 linux/amd64

Output of go env in your module/workspace:

AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN='/home/user/.local/share/mise/installs/go/1.25.3/bin'
GOCACHE='/home/user/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/user/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1675535395=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/user/Documents/projects/test/go.mod'
GOMODCACHE='/home/user/go/pkg/mod'
GONOPROXY='gitlab.prive.sh'
GONOSUMDB='gitlab.prive.sh'
GOOS='linux'
GOPATH='/home/user/go'
GOPRIVATE='gitlab.prive.sh'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/user/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.26.0.linux-amd64'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/user/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/user/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.26.0.linux-amd64/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.26.0'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

ompiling a program that uses github.com/go-fuego/fuego v0.19.0 with a route handler returning a type >= 192 bytes produces an internal compiler error tested on linux/amd64 and darwin/arm64.

Minimal reproducer:

package main

import "github.com/go-fuego/fuego"

func handler(c fuego.ContextNoBody) ([192]byte, error) {
	return [192]byte{}, nil
}

func main() {
	s := fuego.NewServer()
	fuego.Get(s, "/test", handler)
}

To reproduce:

mkdir /tmp/go-ice-repro && cd /tmp/go-ice-repro
go mod init repro
go mod edit -go=1.26.0          # must use Go 1.26.0 toolchain
go get github.com/go-fuego/fuego@v0.19.0
# save the above code as main.go
go build .

What did you see happen?

# repro
/home/user/go/pkg/mod/github.com/go-fuego/fuego@v0.19.0/serialization.go:40:19: internal compiler error: 'transformOut[go.shape.[192]uint8]': tried to free an already free register 1


Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new

What did you expect to see?

Successful compilation.

Metadata

Metadata

Assignees

Labels

BugReportIssues describing a possible bug in the Go implementation.CriticalA critical problem that affects the availability or correctness of production systems built using GoFixPendingIssues that have a fix which has not yet been reviewed or submitted.compiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions