Skip to content

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

Closed

Description

@ALTree
$ 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

Activity

  1. added
    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.
    on Oct 9, 2023
  2. cuonglm commented on Oct 9, 2023

    @cuonglm
    Member

    A simple reproducer:

    package p
    
    func f() {
    	for b := "" < join([]string{}, "") && true; ; {
    		_ = b
    	}
    }
    
    //go:noinline
    func join(elems []string, sep string) string {
    	return ""
    }
    
  3. cuonglm commented on Oct 9, 2023

    @cuonglm
    Member

    Related #63433

    cc @dr2chase

  4. gopherbot commented on Oct 9, 2023

    @gopherbot
    Contributor

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

  5. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    and removed
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on Oct 9, 2023
  6. added this to the Go1.22 milestone on Oct 9, 2023
  7. added a commit that references this issue on Oct 20, 2023
    82ed7ed
  8. locked and limited conversation to collaborators on Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions