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: internal compiler error: expected successors of write barrier block to be plain #26024

Closed
ALTree opened this issue Jun 23, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@ALTree
Copy link
Member

commented Jun 23, 2018

$ gotip version
go version devel +d6a27e8edc Sat Jun 23 00:16:14 2018 +0000 linux/amd64

The following program:

package p

func f() {
	var i int
	var s string
	for len(s) < len(s) {
		i++
		s = "a"
	}

	var b bool
	var sa []string
	for true {
		sa = []string{""}
		for b || i == 0 {
		}
		b = !b
		_ = sa
	}
}

Crashes the tip compiler with an expected successors of write barrier block to be plain error:

$ gotip build crash.go
# command-line-arguments
<unknown line number>: internal compiler error: expected successors of write barrier block b10 to be plain

goroutine 7 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/home/alberto/go/src/runtime/debug/stack.go:24 +0xa7
cmd/compile/internal/gc.Fatalf(0xcc877e, 0x39, 0xc0004e2210, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/subr.go:182 +0x1f7
cmd/compile/internal/gc.(*ssafn).Fatalf(0xc0004d6000, 0x0, 0xcc877e, 0x39, 0xc0004e2210, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:5583 +0x67
cmd/compile/internal/ssa.(*Func).Fatalf(0xc0004d8000, 0xcc877e, 0x39, 0xc0004e2210, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/ssa/func.go:562 +0x73
cmd/compile/internal/gc.(*Liveness).markUnsafePoints(0xc0004d8160)
	/home/alberto/go/src/cmd/compile/internal/gc/plive.go:696 +0x63b
cmd/compile/internal/gc.newliveness(0xc00035a000, 0xc0004d8000, 0x0, 0x0, 0x0, 0xc0004d6a20, 0x0, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/plive.go:554 +0x9eb
cmd/compile/internal/gc.liveness(0xc0004d6000, 0xc0004d8000, 0x0, 0x0, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/plive.go:1685 +0x95
cmd/compile/internal/gc.genssa(0xc0004d8000, 0xc0004ee230)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:4820 +0xbe
cmd/compile/internal/gc.compileSSA(0xc00035a000, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:269 +0x1bc
cmd/compile/internal/gc.compileFunctions.func2(0xc0004cc360, 0xc000016740, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:323 +0x49
created by cmd/compile/internal/gc.compileFunctions
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:321 +0x11a

The program compiles fine on go1.10.

@ALTree

This comment has been minimized.

Copy link
Member Author

commented Jun 23, 2018

git bisect points to a367f44 (cmd/compile: enable stack maps everywhere except unsafe points) as the first bad commit.

cc @aclements

@aclements aclements self-assigned this Jun 25, 2018

@gopherbot

This comment has been minimized.

Copy link

commented Jun 27, 2018

Change https://golang.org/cl/121155 mentions this issue: cmd/compile: detect and remove pointless conditionals

@gopherbot

This comment has been minimized.

Copy link

commented Jul 12, 2018

Change https://golang.org/cl/123655 mentions this issue: cmd/compile: handle degenerate write barrier case

@gopherbot gopherbot closed this in 85cfa4d Jul 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.