Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler: infinite loop and closure assertion failed #69062

Closed
nikandfor opened this issue Aug 25, 2024 · 1 comment
Closed

compiler: infinite loop and closure assertion failed #69062

nikandfor opened this issue Aug 25, 2024 · 1 comment

Comments

@nikandfor
Copy link

nikandfor commented Aug 25, 2024

Go version

go version go1.23.0 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN='/Users/nik/.go/bin'
GOCACHE='/Users/nik/Library/Caches/go-build'
GOENV='/Users/nik/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/nik/.go/pkg/mod'
GONOPROXY=',***,***'
GONOSUMDB=',***,***'
GOOS='darwin'
GOPATH='/Users/nik/.go'
GOPRIVATE=',***,***'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.1'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/nik/nikandfor/jq/go.mod'
GOWORK='off'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/sh/j5dr0gmd1v50tsb0pk8yrd440000gn/T/go-build1942867075=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

Made a closure.

https://go.dev/play/p/iHDHusD_Lqa

package main

func main() {
        f()
}

func f() {
        back := func() {
                return
        }

back:
        for {
                back()

                continue back
        }
}

Running

$ /usr/local/go1.23/bin/go version
go version go1.23.0 darwin/arm64
$ /usr/local/go1.23/bin/go run ./closure.go # blocks here, eats 100% of a CPU core
^Csignal: interrupt

 /usr/local/go1.22/bin/go version
go version go1.22.6 darwin/arm64
$ /usr/local/go1.22/bin/go run ./closure.go # block here as well
^Csignal: interrupt

What did you see happen?

described above ^

What did you expect to see?

Expected both snippets to compile successfully with both latest go versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants