You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A function that calls out into native and calls back into Go should be able to have its
stack unwound by gentraceback. This works on 386 and amd64 but does not work on arm.
There appear to be 2 problems with the arm that make unwinding impossible.
The first is that the runtime.cgocallback_gofunc does not abide by the function linkage
convention for the arm. While the convention expects the return address for a frame to
be stored on the top of the stack, this function stores its return address following the
386 and amd64 convention which stores the return address between the locals and the
args. When the unwind reaches runtime.cgocallback_gofunc it will find junk on the stack
and terminates prematurely.
The second is that some frames seem to have the wrong size preventing the unwind from
finding the procedure linkage. One such example is runtime.cgocall. When the unwind
reaches runtime.cgocall it will miss the word with linkage information by 4 bytes.
I will be adding a test named TestCallbackCallers to the cgo test suite that
demonstrates this issue.
The text was updated successfully, but these errors were encountered:
This CL fixes first part of the ARM issues and added the unwind test.
R=golang-dev, bradfitz, minux.ma, cshapiro, rsc
CC=golang-dev
https://golang.org/cl/7728045
The text was updated successfully, but these errors were encountered: