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

cmd/compile: panic: log2 of 0 on arm64 #38946

Closed
ALTree opened this issue May 8, 2020 · 2 comments
Closed

cmd/compile: panic: log2 of 0 on arm64 #38946

ALTree opened this issue May 8, 2020 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@ALTree
Copy link
Member

ALTree commented May 8, 2020

$ gotip version
go version devel +176481990f Thu May 7 07:06:11 2020 +0000 linux/amd64
go version go1.14.2 linux/amd64
go version go1.13.10 linux/amd64

This program:

package p

func f() {
	var r rune
	var b bool

	g := func() bool {
		b = b
		return ('0' & 'る') < (*&r)&^(r&^r)
	}

	b = g() || b
}

Crashes the Go1.13.10, the Go1.14.2, and the tip compilers, when built for arm64, with the following error:

$ GOARCH=arm64 gotip build crash.go 

# command-line-arguments
panic: log2 of 0

goroutine 50 [running]:
cmd/internal/obj/arm64.log2(...)
	/home/alberto/go/src/cmd/internal/obj/arm64/asm7.go:1456
cmd/internal/obj/arm64.bitconEncode(0xffffffffffffffff, 0x20, 0x4b9802923)
	/home/alberto/go/src/cmd/internal/obj/arm64/asm7.go:1436 +0x2ef
cmd/internal/obj/arm64.(*ctxt7).asmout(0xc0003fdd50, 0xc0001fa5d0, 0x108a34c, 0xc0003fdca8, 0x6, 0x6)
	/home/alberto/go/src/cmd/internal/obj/arm64/asm7.go:3910 +0x4954
cmd/internal/obj/arm64.span7(0xc00016f6c0, 0xc0005bc900, 0xc000044d20)
	/home/alberto/go/src/cmd/internal/obj/arm64/asm7.go:1062 +0xb26
cmd/internal/obj.Flushplist(0xc00016f6c0, 0xc0003fdea8, 0xc000044d20, 0x7ffeba1d52c3, 0x16)
	/home/alberto/go/src/cmd/internal/obj/plist.go:107 +0x76d
cmd/compile/internal/gc.(*Progs).Flush(0xc0003f2500)
	/home/alberto/go/src/cmd/compile/internal/gc/gsubr.go:98 +0xbd
cmd/compile/internal/gc.compileSSA(0xc0001362c0, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:321 +0x68e
cmd/compile/internal/gc.compileFunctions.func2(0xc000589440, 0xc00058a240, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:361 +0x4d
created by cmd/compile/internal/gc.compileFunctions
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:359 +0x129

Tentatively marking as a release blocker since it's a compiler crasher in a First Class Port, but leaving for others to decide if this is fine (it's not a tip regression).

cc @randall77

@ALTree ALTree added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels May 8, 2020
@ALTree ALTree added this to the Go1.15 milestone May 8, 2020
@mariecurried
Copy link

According to bisection, the culprit seems to be 86ce1cb

@gopherbot
Copy link

Change https://golang.org/cl/232984 mentions this issue: cmd/internal/obj/arm64: fix 32-bit BITCON test

@golang golang locked and limited conversation to collaborators May 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants