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 · 10 comments
Open

cmd/compile: internal compiler error: name too long #27256

elagergren-spideroak opened this issue Aug 27, 2018 · 10 comments
Assignees
Milestone

Comments

@elagergren-spideroak
Copy link

@elagergren-spideroak 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
Copy link
Author

@elagergren-spideroak elagergren-spideroak commented Aug 27, 2018

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

@josharian
Copy link
Contributor

@josharian josharian commented Aug 27, 2018

@griesemer
Copy link
Contributor

@griesemer 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
Copy link
Contributor

@griesemer griesemer commented Aug 28, 2018

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

@griesemer
Copy link
Contributor

@griesemer griesemer commented Dec 5, 2018

Too late for 1.12.

@griesemer griesemer modified the milestones: Go1.12, Go1.13 Dec 5, 2018
@elagergren-spideroak
Copy link
Author

@elagergren-spideroak 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:
@yagotome
Copy link

@yagotome yagotome commented Apr 29, 2020

Is there any update on this issue? I'm facing the same error for large nested struct types definition on go version go1.14.2 linux/amd64.

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Apr 29, 2020

No updates other than what's been commented here. Anonymous, cyclic interfaces continue to be troublesome.

@randall77
Copy link
Contributor

@randall77 randall77 commented Apr 29, 2020

This might have been fixed with CL 214239.
I believe that CL made it into 1.14. 1.14 fixes the OP's example for me.

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Apr 29, 2020

@randall77 Thanks, I missed that CL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants
You can’t perform that action at this time.