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: runtime error: makeslice: len out of range #20529

Closed
ALTree opened this issue May 30, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@ALTree
Copy link
Member

commented May 30, 2017

Given the following program:

package p

func f() {
	_ = [][]int{1e9: []int{}}
}

go1.8.3 prints

# command-line-arguments
./test.go:3: stack frame too large (>2GB)

On tip, the compiler crashes with an internal error:

# command-line-arguments
panic: runtime error: makeslice: len out of range

goroutine 18 [running]:
cmd/compile/internal/gc.bvalloc(...)
	/home/adonizetti/go/src/cmd/compile/internal/gc/bv.go:21
cmd/compile/internal/gc.livenessemit(0xc4200b4240, 0xc42048c128, 0xc42048c190)
	/home/adonizetti/go/src/cmd/compile/internal/gc/plive.go:1258 +0x167
cmd/compile/internal/gc.liveness(0xc420496000, 0xc420498000, 0x41117d)
	/home/adonizetti/go/src/cmd/compile/internal/gc/plive.go:1302 +0x131
cmd/compile/internal/gc.genssa(0xc420498000, 0xc42007c6e0)
	/home/adonizetti/go/src/cmd/compile/internal/gc/ssa.go:4377 +0xa0
cmd/compile/internal/gc.compileSSA(0xc420314000, 0x1)
	/home/adonizetti/go/src/cmd/compile/internal/gc/pgen.go:240 +0x7e
cmd/compile/internal/gc.compileFunctions.func2(0xc420472780, 0xc42046c0f0, 0x1)
	/home/adonizetti/go/src/cmd/compile/internal/gc/pgen.go:287 +0x49
created by cmd/compile/internal/gc.compileFunctions
	/home/adonizetti/go/src/cmd/compile/internal/gc/pgen.go:285 +0x10e
$ gotip version
go version devel +4c86f7bd49 Tue May 30 01:10:56 2017 +0000 linux/amd64

@ALTree ALTree added this to the Go1.9 milestone May 30, 2017

@dgryski

This comment has been minimized.

Copy link
Contributor

commented May 30, 2017

Should probalby get https://github.com/dvyukov/gosmith working again.

@ALTree

This comment has been minimized.

Copy link
Member Author

commented May 30, 2017

@dgryski It still works, I fuzz the compiler with gosmith fairly regularly (but this one was not found by fuzzing).

@dgryski

This comment has been minimized.

Copy link
Contributor

commented May 30, 2017

Ah, good to know gosmith still works. I wasn't sure where this bug came from, and if it happened from production code, another round of fuzzing might be worth it. Nice to know we're still throwing random stuff at it then :)

@ALTree

This comment has been minimized.

Copy link
Member Author

commented May 30, 2017

Introduced in ca33e10.

cc @josharian

@gopherbot

This comment has been minimized.

Copy link

commented May 30, 2017

CL https://golang.org/cl/44344 mentions this issue.

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