Skip to content

cmd/compile: internal compiler error: panic during expand calls [on ARM and other 32bit archs] #63462

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

Closed
ALTree opened this issue Oct 9, 2023 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@ALTree
Copy link
Member

ALTree commented Oct 9, 2023

$ gotip version
go version devel go1.22-2744155 Sun Oct 8 23:15:25 2023 +0000 linux/amd64
package main

import "strings"

func main() {
        for b := "" < strings.Join([]string{}, "") && true; ; {
                _ = b
        }
}
$ GOARCH=arm gotip build crash.go

# command-line-arguments
./crash.go:6:45: internal compiler error: 'main': panic during expand calls while compiling main:

runtime error: invalid memory address or nil pointer dereference

goroutine 9 [running]:
cmd/compile/internal/ssa.Compile.func1()
        ./gotip/src/cmd/compile/internal/ssa/compile.go:49 +0x6c
panic({0xd31300?, 0x140e500?})
        ./gotip/src/runtime/panic.go:765 +0x132
cmd/compile/internal/ssa.(*Value).AddArgs(...)
        ./gotip/src/cmd/compile/internal/ssa/value.go:313
cmd/compile/internal/ssa.(*expandState).rewriteSelectOrArg.func1(0xc000422780?, 0x0?, {0xc000447158?, 0x2, 0x0?})
        ./gotip/src/cmd/compile/internal/ssa/expand_calls.go:488 +0x13e
cmd/compile/internal/ssa.(*expandState).rewriteSelectOrArg(0xc000447c60, {0x2, 0x61c0}, 0xc00059f3e0, 0xc000568f40, 0x0, 0x0, 0xc000422780, {0xc000569170, 0x0, ...})
        ./gotip/src/cmd/compile/internal/ssa/expand_calls.go:681 +0x17cd

...

cc @golang/compiler

@ALTree ALTree added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. compiler/runtime Issues related to the Go compiler and/or runtime. labels Oct 9, 2023
@cuonglm
Copy link
Member

cuonglm commented Oct 9, 2023

A simple reproducer:

package p

func f() {
	for b := "" < join([]string{}, "") && true; ; {
		_ = b
	}
}

//go:noinline
func join(elems []string, sep string) string {
	return ""
}

@cuonglm
Copy link
Member

cuonglm commented Oct 9, 2023

Related #63433

cc @dr2chase

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/533795 mentions this issue: cmd/compile: fix wrong argument of OpSelectN during expand_calls

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Oct 9, 2023
@dmitshur dmitshur added this to the Go1.22 milestone Oct 9, 2023
yunginnanet pushed a commit to yunginnanet/go that referenced this issue Oct 20, 2023
Fixes golang#63462

Change-Id: I5ddf831eab630e23156f8f27a079b4ca4bb3a261
Reviewed-on: https://go-review.googlesource.com/c/go/+/533795
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
@golang golang locked and limited conversation to collaborators Oct 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants