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

Comments

Projects
None yet
6 participants
@griesemer
Copy link
Contributor

commented Oct 25, 2017

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

This comment has been minimized.

Copy link
Member

commented Oct 26, 2017

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 label Nov 13, 2017

@mdempsky mdempsky modified the milestones: Go1.10, Go1.11 Nov 29, 2017

@mdempsky

This comment has been minimized.

Copy link
Member

commented Nov 29, 2017

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

This comment has been minimized.

Copy link
Contributor

commented Dec 4, 2017

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

This comment has been minimized.

Copy link

commented Dec 4, 2017

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

test: disable broken test for 1.10
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

This comment has been minimized.

Copy link
Contributor

commented Dec 6, 2017

@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

This comment has been minimized.

Copy link
Member

commented Dec 6, 2017

@ianlancetaylor Oops, no.

@gopherbot

This comment has been minimized.

Copy link

commented Apr 6, 2018

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

@gopherbot gopherbot closed this in 950a568 Apr 6, 2018

@mdempsky

This comment has been minimized.

Copy link
Member

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.
You can’t perform that action at this time.