Crash in callbacks on iOS 5.1

  • From: Fjölnir Ásgeirsson <fjolnir@xxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 8 Jun 2012 18:05:57 +0900

Good evening,

Callbacks seem to be broken on iOS 5.1.
even a simple test like:

void test(void (*arg)())
    dynamo_log("Lua callback ptr: %p", arg);

ffi.cdef[[extern void test(void (*arg)());]]
        print("Hello from callback")

Causes the app to crash with a SIGKILL. However, this ONLY happens when running 
the app on device, and not attached to a debugger. Everything goes fine when 
running inside gdb. I've tested this on both an iPhone 4&4S.
Again, when I run this on 5.0 or in the iOS Simulator (i386 & iOS 5.1) 
everything works.

The Crash is in lj_vm_ffi_call:

Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread:  0

Thread 0 name:  Dispatch queue:
Thread 0 Crashed:
0   ???                                 0x03f2d020 0 + 66244640
1   NanameDrum                          0x0007e6b0 lj_vm_ffi_call 

– Fjölnir

Other related posts: