Skip to content

cmd/go: crash on unknown GOEXPERIMENT during toolchain selection #74111

Closed
@prattmic

Description

@prattmic

Go version

go version go1.24.4 linux/amd64 (doesn't affect 1.23)

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

What did you do?

Attempted to test the new Green Tea GC: https://tip.golang.org/doc/go1.25#new-experimental-garbage-collector

$ GOTOOLCHAIN=go1.25rc1 GOEXPERIMENT=greenteagc go1.24.4 version

What did you see happen?

$ GOTOOLCHAIN=go1.25rc1 GOEXPERIMENT=greenteagc go1.24.4 version
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x3 pc=0x81a081]

goroutine 1 [running]:
cmd/go/internal/fips140.Init()
        cmd/go/internal/fips140/fips140.go:117 +0x101
cmd/go/internal/modload.Init()
        cmd/go/internal/modload/init.go:419 +0x33
cmd/go/internal/toolchain.Exec({0xc000024114, 0x9})
        cmd/go/internal/toolchain/select.go:356 +0x3fc
cmd/go/internal/toolchain.Select()
        cmd/go/internal/toolchain/select.go:284 +0x11a5
main.main()
        cmd/go/main.go:107 +0x4f

What did you expect to see?

$ GOTOOLCHAIN=go1.25rc1 GOEXPERIMENT=greenteagc go1.24.4 version
go version go1.25rc1 linux/amd64

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.FixPendingIssues that have a fix which has not yet been reviewed or submitted.GoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.release-blocker

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions