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

Comments

Projects
None yet
3 participants
@josharian
Copy link
Contributor

commented Jul 11, 2016

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

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2016

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

@josharian

This comment has been minimized.

Copy link
Contributor Author

commented Jul 11, 2016

I'm delighted for the help. :)

@gopherbot

This comment has been minimized.

Copy link

commented Jul 12, 2016

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

@gopherbot gopherbot closed this in b30814b Jul 12, 2016

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