Skip to content

testing: fuzz: runtime out of memory on GOARCH=386 #80559

Description

@gabriel-vasile

Go version

1.26.5

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=''
GOCACHE='/home/gabriel-vasile/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/gabriel-vasile/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1381177345=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/gabriel-vasile/Code/mimetype/go.mod'
GOMODCACHE='/home/gabriel-vasile/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/gabriel-vasile/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/gabriel-vasile/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.26.5'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

I have a fuzz function

func FuzzF(f *testing.F) {
    f.Add("asd") // string and []byte trigger the panic, int does not
    f.Fuzz(func(t *testing.T, data string) {
        _ = data
    })
}

Then I run:
GOARCH=386 GOMAXPROCS=20 go test -fuzz=F --fuzztime=4s

The problem does not reproduce if I use GOARCH=amd64.
--fuzztime=4s does not make a difference, the panic happens if I SIGINT the process instead.
GOMAXPROCS=20 is important. If I switch to GOMAXPROCS=19, the panic very rarely reproduces.

What did you see happen?

a panic happened

runtime: out of memory: cannot allocate 104857600-byte block (1905852416 in use)

fuzz.log

What did you expect to see?

fuzz function finishes successfully

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone 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.

    Type

    No type

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions