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: suspicious symbol generation for args_stackmap #31615

Closed
mdempsky opened this issue Apr 22, 2019 · 3 comments
Closed

cmd/compile: suspicious symbol generation for args_stackmap #31615

mdempsky opened this issue Apr 22, 2019 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mdempsky
Copy link
Member

In CL 171464, @randall77 fixed a lookup(fmt.Sprintf(...)) call in pgen.go, but we noticed another similarly suspicious line of code for generating args_stackmap symbols. However, Keith reports that applying the same fix didn't work: https://go-review.googlesource.com/c/go/+/171464/1/src/cmd/compile/internal/gc/pgen.go#39

Seems worth looking into and understanding whether the existing code is safe.

@mdempsky mdempsky added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 22, 2019
@mdempsky mdempsky added this to the Unplanned milestone Apr 22, 2019
@cuonglm
Copy link
Member

cuonglm commented Feb 7, 2020

@randall77 Can you elaborate what is exactly the same fix?

Does it mean:

lsym := Ctxt.Lookup(fn.Func.lsym.Name + ".args_stackmap")

or:

lsym := Ctxt.Lookup(fn.funcname()+ ".args_stackmap")

@cuonglm
Copy link
Member

cuonglm commented Mar 12, 2020

Seems worth looking into and understanding whether the existing code is safe.

@mdempsky it seems to be safe.

Method without body can only occur via //go:linkname (method via assembly won't happen in Go 1 #4978) and //go:linkname already has full path. So something like this:

package d

import _ "unsafe"

//go:linkname a a.IndexController.M
func a() {}

//go:linkname b b.IndexController.M
func b() {}

will work.

@gopherbot
Copy link

Change https://golang.org/cl/223238 mentions this issue: cmd/compile: skip generating args_stackmap for "pulled" funcs

@golang golang locked and limited conversation to collaborators Mar 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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