Skip to content

cmd/compile: OOM killed on linux/arm64 [1.25 backport] #75844

@j-modernc-org

Description

@j-modernc-org

Go version

go version go1.25.2 linux/arm64

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=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/jnml/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/jnml/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2613515218=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='arm64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/home/jnml/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/jnml'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/jnml/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_arm64'
GOVCS=''
GOVERSION='go1.25.2'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

me@rpi5:~/tmp/bug $ ls -l
total 12
-rw-r--r-- 1 me me 9491 Oct 10 11:34 ccgo.zip
me@rpi5:~/tmp/bug $ unzip -q ccgo.zip && cd ccgo && ls -l
/home/me/tmp/bug/ccgo
total 40
-rw-r--r-- 1 me me   540 Oct 10 10:28 go.mod
-rw-r--r-- 1 me me  3707 Oct 10 10:28 go.sum
-rw-r--r-- 1 me me 31853 Oct 10 11:23 main.go
me@rpi5:~/tmp/bug/ccgo $ time go build
example.com/ccgo: /usr/local/go/pkg/tool/linux_arm64/compile: signal: killed

real	0m23.135s
user	0m33.775s
sys	0m1.539s
me@rpi5:~/tmp/bug/ccgo $ 

Found by CSmith+ccgo. Code only partially minimized, refuses to reproduce the bug when I tried more.

ccgo.zip

What did you see happen?

gc compiler OOM killed.

What did you expect to see?

go build works normally. Like it does with the same program on linux/amd64:

me@e5-1650:~/tmp/bug$ go version
go version go1.25.2 linux/amd64
me@e5-1650:~/tmp/bug$ ls -l
total 12
-rw-r--r-- 1 me me 9491 Oct 10 11:39 ccgo.zip
me@e5-1650:~/tmp/bug$ unzip -q ccgo.zip && cd ccgo && ls -l
/home/me/tmp/bug/ccgo
total 40
-rw-r--r-- 1 me me   540 Oct 10 10:28 go.mod
-rw-r--r-- 1 me me  3707 Oct 10 10:28 go.sum
-rw-r--r-- 1 me me 31853 Oct 10 11:23 main.go
me@e5-1650:~/tmp/bug/ccgo$ time go build

real	0m0.370s
user	0m0.573s
sys	0m0.082s
me@e5-1650:~/tmp/bug/ccgo$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.CherryPickApprovedUsed during the release process for point releasescompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions