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

gccgo: internal compiler error for interface with cyclic result types #25851

Open
griesemer opened this issue Jun 12, 2018 · 1 comment
Open
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@griesemer
Copy link
Contributor

With

gccgo (google-gccgo-261288) 9.0.0 20180607 (experimental)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

the following program

$ cat x.go
package main

func main() {
}

type I interface {
	M1() interface {
		I
	}
	M2() interface {
		I
	}
}

type S struct{}

func (S) M1() interface{ I } {
	return nil
}

func (S) M2() interface{ I } {
	return nil
}

crashes the compiler:

$ gccgo x.go
gccgo: internal compiler error: Segmentation fault signal terminated program go1
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://go.ext.google.com/go/> for instructions.

The program compiles (somewhat surprisingly) without error if the struct definition is absent:

$ cat x.go
package main

func main() {
}

type I interface {
	M1() interface {
		I
	}
	M2() interface {
		I
	}
}

For the reference:

cc: @thanm

@griesemer griesemer added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 12, 2018
@griesemer griesemer added this to the Gccgo milestone Jun 12, 2018
@thanm thanm assigned thanm and unassigned ianlancetaylor Jun 13, 2018
@thanm
Copy link
Contributor

thanm commented Jun 13, 2018

This bug has the same failure mode as 25302 -- recursive cycle involving Interface_type::finish_backend_methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants