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: stack overflow on invalid map key type #21657

Closed
yaegashi opened this issue Aug 28, 2017 · 5 comments

Comments

Projects
None yet
5 participants
@yaegashi
Copy link

commented Aug 28, 2017

What version of Go are you using (go version)?

go version go1.9 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/yaegashi/go"
GORACE=""
GOROOT="/usr/local/go1.9"
GOTOOLDIR="/usr/local/go1.9/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build483553475=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

Attempt to build the following program:

$ cat a.go
package pkg

type A struct{ A }
type X map[A]int

$ go build -v a.go

What did you expect to see?

go build should report something like recursive type errors, then terminate with exit code 1 without panic.

What did you see instead?

$ go build -v a.go
command-line-arguments
# command-line-arguments
runtime: goroutine stack exceeds 1000000000-byte limit
fatal error: stack overflow

runtime stack:
runtime.throw(0xb5d565, 0xe)
	/usr/local/go/src/runtime/panic.go:605 +0x95
runtime.newstack(0x0)
	/usr/local/go/src/runtime/stack.go:1050 +0x6e1
runtime.morestack()
	/usr/local/go/src/runtime/asm_amd64.s:415 +0x86

goroutine 1 [running]:
cmd/compile/internal/types.(*Type).FieldSlice(0xc4202f57a0, 0x0, 0x0, 0x0)
	/usr/local/go/src/cmd/compile/internal/types/type.go:832 +0x6a fp=0xc4402f0348 sp=0xc4402f0340 pc=0x4d79ea
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:157 +0x30f fp=0xc4402f03c0 sp=0xc4402f0348 pc=0x92cd1f
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0438 sp=0xc4402f03c0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f04b0 sp=0xc4402f0438 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0528 sp=0xc4402f04b0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f05a0 sp=0xc4402f0528 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0618 sp=0xc4402f05a0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0690 sp=0xc4402f0618 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0708 sp=0xc4402f0690 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0780 sp=0xc4402f0708 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f07f8 sp=0xc4402f0780 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0870 sp=0xc4402f07f8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f08e8 sp=0xc4402f0870 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0960 sp=0xc4402f08e8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f09d8 sp=0xc4402f0960 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0a50 sp=0xc4402f09d8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0ac8 sp=0xc4402f0a50 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0b40 sp=0xc4402f0ac8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0bb8 sp=0xc4402f0b40 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0c30 sp=0xc4402f0bb8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0ca8 sp=0xc4402f0c30 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0d20 sp=0xc4402f0ca8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0d98 sp=0xc4402f0d20 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0e10 sp=0xc4402f0d98 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0e88 sp=0xc4402f0e10 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0f00 sp=0xc4402f0e88 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0f78 sp=0xc4402f0f00 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f0ff0 sp=0xc4402f0f78 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1068 sp=0xc4402f0ff0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f10e0 sp=0xc4402f1068 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1158 sp=0xc4402f10e0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f11d0 sp=0xc4402f1158 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1248 sp=0xc4402f11d0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f12c0 sp=0xc4402f1248 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1338 sp=0xc4402f12c0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f13b0 sp=0xc4402f1338 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1428 sp=0xc4402f13b0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f14a0 sp=0xc4402f1428 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1518 sp=0xc4402f14a0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1590 sp=0xc4402f1518 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1608 sp=0xc4402f1590 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1680 sp=0xc4402f1608 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f16f8 sp=0xc4402f1680 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1770 sp=0xc4402f16f8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f17e8 sp=0xc4402f1770 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1860 sp=0xc4402f17e8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f18d8 sp=0xc4402f1860 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1950 sp=0xc4402f18d8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f19c8 sp=0xc4402f1950 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1a40 sp=0xc4402f19c8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1ab8 sp=0xc4402f1a40 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1b30 sp=0xc4402f1ab8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1ba8 sp=0xc4402f1b30 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1c20 sp=0xc4402f1ba8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1c98 sp=0xc4402f1c20 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1d10 sp=0xc4402f1c98 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1d88 sp=0xc4402f1d10 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1e00 sp=0xc4402f1d88 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1e78 sp=0xc4402f1e00 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1ef0 sp=0xc4402f1e78 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1f68 sp=0xc4402f1ef0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f1fe0 sp=0xc4402f1f68 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2058 sp=0xc4402f1fe0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f20d0 sp=0xc4402f2058 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2148 sp=0xc4402f20d0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f21c0 sp=0xc4402f2148 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2238 sp=0xc4402f21c0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f22b0 sp=0xc4402f2238 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2328 sp=0xc4402f22b0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f23a0 sp=0xc4402f2328 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2418 sp=0xc4402f23a0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2490 sp=0xc4402f2418 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2508 sp=0xc4402f2490 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2580 sp=0xc4402f2508 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f25f8 sp=0xc4402f2580 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2670 sp=0xc4402f25f8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f26e8 sp=0xc4402f2670 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2760 sp=0xc4402f26e8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f27d8 sp=0xc4402f2760 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2850 sp=0xc4402f27d8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f28c8 sp=0xc4402f2850 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2940 sp=0xc4402f28c8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f29b8 sp=0xc4402f2940 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2a30 sp=0xc4402f29b8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2aa8 sp=0xc4402f2a30 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2b20 sp=0xc4402f2aa8 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2b98 sp=0xc4402f2b20 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2c10 sp=0xc4402f2b98 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2c88 sp=0xc4402f2c10 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2d00 sp=0xc4402f2c88 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2d78 sp=0xc4402f2d00 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2df0 sp=0xc4402f2d78 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2e68 sp=0xc4402f2df0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2ee0 sp=0xc4402f2e68 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2f58 sp=0xc4402f2ee0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f2fd0 sp=0xc4402f2f58 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f3048 sp=0xc4402f2fd0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f30c0 sp=0xc4402f3048 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f3138 sp=0xc4402f30c0 pc=0x92ce79
cmd/compile/internal/gc.algtype1(0xc4202f57a0, 0xc42000c528, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/alg.go:161 +0x469 fp=0xc4402f31b0 sp=0xc4402f3138 pc=0x92ce79
...additional frames elided...
@dsnet

This comment has been minimized.

Copy link
Member

commented Aug 28, 2017

This stack overflows since Go1.5, and seems to infinite loop on Go1.0 to Go1.4.

@dsnet dsnet added the NeedsFix label Aug 28, 2017

@dsnet dsnet added this to the Go1.10 milestone Aug 28, 2017

@dsnet

This comment has been minimized.

Copy link
Member

commented Aug 28, 2017

@josharian

This comment has been minimized.

Copy link
Contributor

commented Aug 28, 2017

@mdempsky mdempsky self-assigned this Sep 19, 2017

@mdempsky

This comment has been minimized.

Copy link
Member

commented Sep 19, 2017

Generally, this would be handled by dowidth setting Broke on invalid recursive struct types. Also, algtype checks for Broke.

The problem is we're calling algtype to validate map key types during typechecking before we've called dowidth on those key types, and before it's even safe to do so.

We have some logic for deferring map key type validation until it's safe. I think the solution is to extend that to defer validation more often, maybe even all the time.

@gopherbot

This comment has been minimized.

Copy link

commented Nov 2, 2017

Change https://golang.org/cl/75310 mentions this issue: cmd/compile: avoid spurious errors for invalid map key types

@gopherbot gopherbot closed this in 25159d3 Nov 2, 2017

@golang golang locked and limited conversation to collaborators Nov 2, 2018

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.