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

runtime: cgocallback signature mismatch #16326

Closed
josharian opened this issue Jul 11, 2016 · 3 comments
Closed

runtime: cgocallback signature mismatch #16326

josharian opened this issue Jul 11, 2016 · 3 comments
Milestone

Comments

@josharian
Copy link
Contributor

While working on #11041, I encountered the following mismatch:

runtime/asm_amd64.s:

// cgocallback(void (*fn)(void*), void *frame, uintptr framesize, uintptr ctxt)
TEXT runtime·cgocallback(SB),NOSPLIT,$32-32

runtime/stubs.go:

func cgocallback(fn, frame unsafe.Pointer, framesize uintptr)

The assembly implementation uses the ctxt parameter. However, there are other pure Go callers (in runtime/signal*.go) that call cgocallback directly, which means that there's junk in the ctxt parameter.

It appears that the right fix is to add ctxt to the prototype and add a ctxt parameter to the Go callers. Is this right? What value should ctxt have in those calls? Guidance appreciated.

cc @ianlancetaylor

@josharian josharian self-assigned this Jul 11, 2016
@ianlancetaylor ianlancetaylor added this to the Go1.7 milestone Jul 11, 2016
@ianlancetaylor
Copy link
Contributor

@josharian I just saw that you self-assigned this; I already sent out a CL (https://golang.org/cl/24848).

@josharian
Copy link
Contributor Author

I'm delighted for the help. :)

@gopherbot
Copy link

CL https://golang.org/cl/24848 mentions this issue.

@golang golang locked and limited conversation to collaborators Jul 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants