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: crash on assert #66916

Closed
evanphx opened this issue Apr 19, 2024 · 1 comment
Closed

compiler: crash on assert #66916

evanphx opened this issue Apr 19, 2024 · 1 comment

Comments

@evanphx
Copy link
Contributor

evanphx commented Apr 19, 2024

Go version

go version go1.22.1 linux/arm64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/home/evanphx/.cache/go-build'
GOENV='/home/evanphx/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/evanphx/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/evanphx/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/linux_arm64'
GOVCS=''
GOVERSION='go1.22.1'
GCCGO='gccgo'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1917543129=/tmp/go-build -gno-record-gcc-switches'

What did you do?

Was writing a bytecode interpreter and randomly caused this. The following program is a simplification.

package main

func main() {}

type bugs struct {
        insns []*int
}

func runbug(fn *bugs) {
        panic("no")
        c := fn

loop:
        for {
                _ = c.insns[0]
                continue loop
        }
}

What did you see happen?

Go outputs:

# command-line-arguments
CLOSURE [/home/evanphx/tmp/bug.go:15:7:var c *main.bugs]
<unknown line number>: internal compiler error: assertion failed

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

What did you expect to see?

Nothing, the program does nothing.

@cuonglm
Copy link
Member

cuonglm commented Apr 19, 2024

Duplicated of #65593, it was fixed in go1.22.2

@cuonglm cuonglm closed this as completed Apr 19, 2024
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