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: missing wrapper function for call of literal method expression #22444

Closed
griesemer opened this issue Oct 25, 2017 · 8 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@griesemer
Copy link
Contributor

https://play.golang.org/p/CE9RBX_L4Z results in:

go.struct { main.T }.m2·f: relocation target go.struct { main.T }.m2 not defined
go.struct { main.T }.m2·f: undefined: "go.struct { main.T }.m2"

See also #9060 .

@mdempsky
Copy link
Member

Looking at the compile -S output, it looks like we're not emitting a TEXT symbol for struct { main.T }.m2. Reclassifying as a cmd/compile bug.

@mdempsky mdempsky changed the title cmd/link: missing relocation info for call of literal method expression cmd/compile: missing wrapper function for call of literal method expression Oct 26, 2017
@bradfitz bradfitz modified the milestones: Unreleased, Go1.10 Nov 13, 2017
@bradfitz bradfitz added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 13, 2017
@mdempsky mdempsky modified the milestones: Go1.10, Go1.11 Nov 29, 2017
@mdempsky
Copy link
Member

Bumping to Go 1.11. This is a long-standing issue that is only now technically an issue because we relaxed the Go spec in #9060.

@randall77
Copy link
Contributor

This is breaking the noopt builder, though. We should probably do something for that in 1.10.

@bradfitz bradfitz modified the milestones: Go1.11, Go1.10 Dec 4, 2017
@gopherbot
Copy link

Change https://golang.org/cl/81775 mentions this issue: test: disable broken test for 1.10

gopherbot pushed a commit that referenced this issue Dec 4, 2017
This test was added recently as a regress test for the spec relaxation
in #9060, but doesn't work correctly yet. Disable for now to fix noopt
builders.

Updates #22444.

Change-Id: I45c521ae0da7ffb0c6859d6f7220c59828ac6149
Reviewed-on: https://go-review.googlesource.com/81775
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@ianlancetaylor
Copy link
Contributor

@randall77 @mdempsky Is there anything else to do this on this issue for 1.10?

@mdempsky mdempsky modified the milestones: Go1.10, Go1.11 Dec 6, 2017
@mdempsky
Copy link
Member

mdempsky commented Dec 6, 2017

@ianlancetaylor Oops, no.

@gopherbot
Copy link

Change https://golang.org/cl/105044 mentions this issue: cmd/compile: fix method expressions with anonymous receivers

@mdempsky
Copy link
Member

mdempsky commented Apr 6, 2018

Just for the record, one of the interesting things about this issue is the particular repro case here only affects go run and the Go playground (presumably because it uses go run). It does not affect go build.

The difference is that go run compiles with -dwarf=false. Normally, we only produce type descriptors for package-scope declared types, and any other types as they're needed (e.g., types that are allocated on the heap). In the test case, struct { T } only appears on the stack, so it doesn't need a runtime type descriptor. But enabling DWARF means we write out DWARF descriptors of all named stack variables, and DWARF descriptors cross-reference the underlying Go type descriptor.

@golang golang locked and limited conversation to collaborators Apr 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

6 participants