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

Comments

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Apr 22, 2019

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 this to the Unplanned milestone Apr 22, 2019
@cuonglm
Copy link
Contributor

@cuonglm 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
Contributor

@cuonglm 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

@gopherbot gopherbot commented Mar 12, 2020

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

@gopherbot gopherbot closed this in bb929b7 Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.