public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Simon Frost <simon.frost@realvnc.com>
To: "libffi-discuss@sourceware.org" <libffi-discuss@sourceware.org>
Subject: Crash when using closures on iOS+arm64
Date: Thu, 14 May 2015 17:27:00 -0000	[thread overview]
Message-ID: <82D490AB-0441-44F8-93D8-E22F7BEF3F89@realvnc.com> (raw)

Hi,

I’ve been attempting to use closures across 32-bit, 64-bit and simulator builds of an iOS project but I consistently see a crash on the arm64 build when the closure is executed. This can be reproduced in a stripped down Xcode project by simply copying the code from the “closure_simple.c” unit test into the iOS application’s main.m file. I’ve seen this issue on both the latest code from master and the v3.2.1 tagged release.

Specifically I see an EXC_BAD_ACCESS exception when trying to call the executable address pointer populated by ffi_closure_alloc. Somewhat interestingly I see that the executable address (out param) and the writeable address (return value) are set to the same value after calling ffi_closure_alloc on arm64, whereas they have different values on armv7. This may be a red herring though, as I also noticed they also have the same value when running in the i386 simulator where the code works correctly.

All other libffi functionality appears to work fine on arm64, the only issue appears to be calling closures. Can anyone shed any light on this, or give me any pointers as to how this could be resolved? Unfortunately I’m not well enough versed in the lower levels of libffi to look into fixing this myself.

Thanks in advance,
Simon


             reply	other threads:[~2015-05-14 17:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 17:27 Simon Frost [this message]
2015-05-15  1:08 ` Russell Keith-Magee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=82D490AB-0441-44F8-93D8-E22F7BEF3F89@realvnc.com \
    --to=simon.frost@realvnc.com \
    --cc=libffi-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).