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: obscure initialization loop error message due to inlining #21750

Open
dvyukov opened this issue Sep 3, 2017 · 3 comments
Open
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Sep 3, 2017

go version devel +0a4913b2d4 Wed Aug 23 11:09:11 2017 +0200 linux/amd64

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

Produces obscure:

tmp/sandbox278346721/main.go:3:5: initialization loop:
	prog.go:3:5 A refers to
	prog.go:3:5 A

If compiled with -l produces understandable error message:

/tmp/test.go:3:5: initialization loop:
	/tmp/test.go:3:5 A refers to
	/tmp/test.go:7:10 B refers to
	/tmp/test.go:11:10 C refers to
	/tmp/test.go:15:10 D refers to
	/tmp/test.go:3:5 A

In real scenario this is spread across files and intermixed with other code.

@odeke-em
Copy link
Member

odeke-em commented Sep 3, 2017

Looks somewhat like an extension of #16503, but here we get the proper message only with -l. /cc @griesemer and @rsc

@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 29, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone Mar 29, 2018
@griesemer griesemer modified the milestones: Go1.11, Go1.12 Jun 27, 2018
@odeke-em odeke-em self-assigned this Oct 18, 2018
@odeke-em
Copy link
Member

Thank you @dvyukov for filing this bug, it'll be fixed along with #21752

@griesemer
Copy link
Contributor

Moving to 1.13 like #21752.

@griesemer griesemer modified the milestones: Go1.12, Go1.13 Dec 5, 2018
@andybons andybons modified the milestones: Go1.13, Go1.14 Jul 8, 2019
@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Projects
Status: Triage Backlog
Development

No branches or pull requests

7 participants