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: name too long #27256

Open
elagergren-spideroak opened this Issue Aug 27, 2018 · 6 comments

Comments

Projects
None yet
5 participants
@elagergren-spideroak
Copy link

elagergren-spideroak commented Aug 27, 2018

Please answer these questions before submitting your issue. Thanks!

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

1.11, darwin/amd64

What did you do?

https://play.golang.org/p/WNDetHOIGt3

$ cat x.go
package tmp

type Q interface {
	Foo()
	Bar()
	Baz()
}

type B interface {
	B() Q
}

type O interface {
	O() interface {
		O
		B
		Q
	}
}

type W interface {
	W() interface {
		O
		B
		Q
	}
}

type S interface {
	S() interface {
		S
		W
		Q
	}
}
# _/tmp
<autogenerated>:1: internal compiler error: name too long: *interface { Bar(); Baz(); Foo(); S() interface { Bar(); Baz(); Foo(); S() interface { Bar(); Baz(); 
[ ... ]
Baz(); Foo(); O() interface { B() tmp.Q; Bar(); Baz(); Foo(); O() interface { B() tmp.Q; Bar(); Baz(); Foo(); O() interface { B<...>; Bar<...>; Baz<...>; Foo<...>; O<...> } } } } } } } } 
[ ... ]

Please file a bug report including a short program that triggers the error.
https://golang.org/issue/new

If you remove S, it compiles just fine.

Related, if only tangentially, to #26863.

@ianlancetaylor ianlancetaylor added this to the Go1.12 milestone Aug 27, 2018

@elagergren-spideroak

This comment has been minimized.

Copy link
Author

elagergren-spideroak commented Aug 27, 2018

Doesn't seem to be a regression from 1.10.3 or 1.9.7.

@josharian

This comment has been minimized.

Copy link
Contributor

josharian commented Aug 27, 2018

@griesemer

This comment has been minimized.

Copy link
Contributor

griesemer commented Aug 28, 2018

A typical case of infinite interface expansion when creating the type name during object file generation. Not related to exports. Related to #26863 only insofar that in both cases an recursive algorithm stack-overflows (but the code is completely unrelated).

@griesemer

This comment has been minimized.

Copy link
Contributor

griesemer commented Aug 28, 2018

@mdempsky Added you only in case you feel so inclined.

@griesemer

This comment has been minimized.

Copy link
Contributor

griesemer commented Dec 5, 2018

Too late for 1.12.

@griesemer griesemer modified the milestones: Go1.12, Go1.13 Dec 5, 2018

@elagergren-spideroak

This comment has been minimized.

Copy link
Author

elagergren-spideroak commented Feb 26, 2019

FWIW, the original (proprietary) code that triggered this problem can't be reproduced on 1.11.5, but the code in the playground link can.

$ go1.11.5 test -failfast -v ./...
$ go test -failfast -v ./... # 1.12
# [redacted]
<autogenerated>:1: internal compiler error: name too long:
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.