Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity iOS 64 bit build crash at com.apple.IOAccelerator.BlockFences, Exception Subtype: KERN_INVALID

Discussion in 'iOS and tvOS' started by ImranZahid, Jun 18, 2015.

  1. ImranZahid

    ImranZahid

    Joined:
    Aug 14, 2012
    Posts:
    8
    I am using Unity 4.6.6f2 and made il2cpp build to support 64 bit requirement from apple. I am having strange random crash and in device crash logs, I see these crash reports. It is happening on multiple devices and all of them have this in common: Here's the logs:

    Code (CSharp):
    1. CodeType: ARM-64(Native)ParentProcess: launchd [1]
    2.  
    3. Date/Time:2015-06-1812:06:11.292+0400LaunchTime:2015-06-1811:50:59.940+0400
    4. OS Version: iOS 8.1(12B410)ReportVersion:105
    5.  
    6. ExceptionType: EXC_BAD_ACCESS (SIGSEGV)ExceptionSubtype: KERN_INVALID_ADDRESS at 0x000000000000029cTriggeredbyThread:36
    7.  
    8. Thread36 name:Dispatch queue: com.apple.IOAccelerator.BlockFencesThread36Crashed:0 libobjc.A.dylib 0x0000000194b739f4 objc_disposeClassPair +1921 libobjc.A.dylib 0x0000000194b739bc objc_disposeClassPair +1362 libsystem_blocks.dylib 0x000000019520190c_Block_release+2523IOAccelerator0x000000018d68aca4 ioAccelCommandQueueBlockFenceCallback +604IOKit0x00000001851c58ccIODispatchCalloutFromCFMessage+3725IOKit0x00000001851c596c_IODispatchCalloutWithDispatch+366 libdispatch.dylib 0x00000001951b2a2c dispatch_mig_server +4327 libdispatch.dylib 0x00000001951ad368 _dispatch_client_callout +128 libdispatch.dylib 0x00000001951c20c4 _dispatch_source_latch_and_call +7889 libdispatch.dylib 0x00000001951af4d0 _dispatch_source_invoke +28410 libdispatch.dylib 0x00000001951b72a0 _dispatch_queue_drain +67211 libdispatch.dylib 0x00000001951b0470 _dispatch_queue_invoke +12812 libdispatch.dylib 0x00000001951b9220 _dispatch_root_queue_drain +66013 libdispatch.dylib 0x00000001951ba758 _dispatch_worker_thread3 +10414 libsystem_pthread.dylib 0x00000001953892e0 _pthread_wqthread +81215 libsystem_pthread.dylib 0x0000000195388fa4 start_wqthread +0
     
  2. Ale Moreno

    Ale Moreno

    Joined:
    Jul 31, 2013
    Posts:
    7
    I have the same issue, Fabric (our bug tracker tool) is throwing thousand of that bug


    Thread : Crashed: com.apple.IOAccelerator.BlockFences
    0 libobjc.A.dylib 0x00000001983679f4 objc_disposeClassPair + 192
    1 libsystem_blocks.dylib 0x0000000198a31910 _Block_release + 256
    2 IOAccelerator 0x0000000190709edc ioAccelCommandQueueBlockFenceCallback + 64
    3 IOKit 0x0000000187891470 IODispatchCalloutFromCFMessage + 376
    4 IOKit 0x0000000187891510 _IODispatchCalloutWithDispatch + 40
    5 libdispatch.dylib 0x00000001989df080 dispatch_mig_server + 436
    6 libdispatch.dylib 0x00000001989d9954 _dispatch_client_callout + 16
    7 libdispatch.dylib 0x00000001989f0010 _dispatch_source_latch_and_call + 2052
    8 libdispatch.dylib 0x00000001989dbabc _dispatch_source_invoke + 288
    9 libdispatch.dylib 0x00000001989e42d4 _dispatch_queue_drain + 2008
    10 libdispatch.dylib 0x00000001989dca5c _dispatch_queue_invoke + 132
    11 libdispatch.dylib 0x00000001989e6318 _dispatch_root_queue_drain + 720
    12 libdispatch.dylib 0x00000001989e7c4c _dispatch_worker_thread3 + 108
    13 libsystem_pthread.dylib 0x0000000198bb922c _pthread_wqthread + 816
    14 libsystem_pthread.dylib 0x0000000198bb8ef0 start_wqthread + 4


    Do you anything?

    We built it with latest unity patch and with IL2CPP

    Regards
     
  3. andsee

    andsee

    Joined:
    Mar 20, 2012
    Posts:
    88
    Yep I see the same occasionally at seemingly random points even when Unity's Accelerometer Frequency is set to disabled.

    I'm using Unity 5.1.p3
     
  4. rextr09

    rextr09

    Joined:
    Dec 22, 2011
    Posts:
    416
    I'm glad to see this thread since I'm having the same problem with 64bit IL2CPP builds on latest Unity 4.6.7p1
    Any news on this bug?

    Date/Time: 2015-07-21 12:08:48.029 +0300
    Launch Time: 2015-07-21 12:04:56.725 +0300
    OS Version: iOS 8.4 (12H143)
    Report Version: 105

    Exception Type: EXC_BAD_ACCESS (SIGSEGV)
    Exception Subtype: KERN_INVALID_ADDRESS at 0x00000000000007a0
    Triggered by Thread: 30

    Thread 30 name: Dispatch queue: com.apple.IOAccelerator.BlockFences
    Thread 30 Crashed:
    0 libobjc.A.dylib 0x00000001980379c0 objc_disposeClassPair + 140
    1 libobjc.A.dylib 0x00000001980379bc objc_disposeClassPair + 136
    2 racer 0x00000001016a6a74 0x10004c000 + 23439988
    3 libsystem_blocks.dylib 0x000000019870190c _Block_release + 252
    4 IOAccelerator 0x0000000190379ed8 ioAccelCommandQueueBlockFenceCallback + 60
    5 IOKit 0x000000018750946c IODispatchCalloutFromCFMessage + 372
    6 IOKit 0x000000018750950c _IODispatchCalloutWithDispatch + 36
    7 libdispatch.dylib 0x00000001986af07c dispatch_mig_server + 432
    8 libdispatch.dylib 0x00000001986a9950 _dispatch_client_callout + 12
    9 libdispatch.dylib 0x00000001986c000c _dispatch_source_latch_and_call + 2048
    10 libdispatch.dylib 0x00000001986abab8 _dispatch_source_invoke + 284
    11 libdispatch.dylib 0x00000001986b42d0 _dispatch_queue_drain + 2004
    12 libdispatch.dylib 0x00000001986aca58 _dispatch_queue_invoke + 128
    13 libdispatch.dylib 0x00000001986b6314 _dispatch_root_queue_drain + 716
    14 libdispatch.dylib 0x00000001986b7c48 _dispatch_worker_thread3 + 104
    15 libsystem_pthread.dylib 0x0000000198889228 _pthread_wqthread + 812
    16 libsystem_pthread.dylib 0x0000000198888eec start_wqthread + 0
     
  5. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    I can't find anything Unity specific in this trace..
    Can you reproduce it locally?
     
  6. ray-qzhang

    ray-qzhang

    Joined:
    Oct 29, 2013
    Posts:
    1
  7. amjaliks

    amjaliks

    Joined:
    Jul 11, 2015
    Posts:
    157
    Same issue here. Unity game randomly crashes on iPhone 6 with iOS 8.4. I use (almost) latest Unity 5.1.2f1.

    @ray.qzhang I have added Everyplay. Do you think it's related?
     
  8. rextr09

    rextr09

    Joined:
    Dec 22, 2011
    Posts:
    416
  9. rextr09

    rextr09

    Joined:
    Dec 22, 2011
    Posts:
    416
    I think @ray.qzhang has a point, because ever since I've disabled Everplay, I can't reproduce the crash. Can anyone confirm that it's related with Everyplay?
     
  10. bryan-files

    bryan-files

    Joined:
    Jun 23, 2015
    Posts:
    6
    Still seeing this with Unity 4.6.7p3

    Thread 36Queue : com.apple.IOAccelerator.BlockFences (serial)
    #0 0x000000019639f9c8 in objc_disposeClassPair ()
    #1 0x0000000196a2d910 in _Block_release ()
    #2 0x000000018eeb5f1c in ioAccelCommandQueueBlockFenceCallback ()
    #3 0x00000001869e98d0 in IODispatchCalloutFromCFMessage ()
    #4 0x00000001869e9970 in _IODispatchCalloutWithDispatch ()
    #5 0x0000000104bf68cc in dispatch_mig_server ()
    #6 0x0000000104bf0df0 in _dispatch_client_callout ()
    #7 0x0000000104c06cd4 in _dispatch_source_latch_and_call ()
    #8 0x0000000104bf301c in _dispatch_source_invoke ()
    #9 0x0000000104bfb5bc in _dispatch_queue_drain ()
    #10 0x0000000104bf4120 in _dispatch_queue_invoke ()
    #11 0x0000000104bfd75c in _dispatch_root_queue_drain ()
    #12 0x0000000104bfef18 in _dispatch_worker_thread3 ()
    #13 0x0000000196bb52e4 in _pthread_wqthread ()
     
  11. Manu Sena

    Manu Sena

    Joined:
    Aug 27, 2015
    Posts:
    1
    The bug is still here. I've got a stack trace quite similar than the @bryan.files' one and I've Everyplay enabled, as @ray.qzhang pointed out. My project is of course in IL2CPP too.

    Have any of you guys discovered anything, @rextr09, @amjaliks?
     
  12. bryan-files

    bryan-files

    Joined:
    Jun 23, 2015
    Posts:
    6
    Still happening with Unity 4.6.8
     
  13. amjaliks

    amjaliks

    Joined:
    Jul 11, 2015
    Posts:
    157
    @Manu Sena I have just disabled the accelerometer, and crashes stopped. Fortunately, the accelerometer isn't needed for my game, thus, it is solution for me.
     
    Last edited: Aug 29, 2015
  14. aet

    aet

    Unity Technologies

    Joined:
    Jun 5, 2014
    Posts:
    44
    The _Block_release related crash was an issue few Everyplay releases ago, but I haven't seen it happening since, what is the build you're using? The issue is Metal related and didn't happen with GLES.

    With Unity 5 and Everyplay plugin, there's a known issue where upgrading the plugin might cause
    GUID conflict on some situations, and the new files imported get named as duplicated (Everyplay.framework/Everyplay 2, etc)
     
    Last edited: Aug 31, 2015
  15. amjaliks

    amjaliks

    Joined:
    Jul 11, 2015
    Posts:
    157
    It seems I have been celebrating too early.
    I still get the same crash. It just happens not so often as previously.

    I use Unity 5.1.3f1 and Everyplay 1990-1410.
     
  16. kyubuns

    kyubuns

    Joined:
    Aug 6, 2013
    Posts:
    135
    I have same problem with Unity5.3.1p4 and Everyplay 2110-1530.
    The crash is about per 1 hours.
    Anyone?
     
    Last edited: Feb 6, 2016
  17. Ed-Marty

    Ed-Marty

    Joined:
    Jul 16, 2015
    Posts:
    12
    I have seen this crash happen while attached to the Xcode debugger, With Unity 5.3.4f1, using Everyplay 2110-1530. The stack trace is similarly useless on its own, but I can see the assembly around it, starting in the function that calls objc_disposeClassPair. Of particular possible interest is the reference to EveryplayReleaseEntry. The EXC_BAD_ACCESS is in the call to objc_disposeClassPair at 0x10197a508

    ___entry_alloc_block_invoke_3:
    0x10197a4ac <+0>: stp x20, x19, [sp, #-32]!
    0x10197a4b0 <+4>: stp x29, x30, [sp, #16]
    0x10197a4b4 <+8>: add x29, sp, #16 ; =16
    0x10197a4b8 <+12>: mov x20, x1
    0x10197a4bc <+16>: mov x19, x0
    0x10197a4c0 <+20>: ldr x0, [x19, #40]
    0x10197a4c4 <+24>: cbz x0, 0x10197a4cc ; <+32>
    0x10197a4c8 <+28>: bl 0x101979f20 ; EveryplayReleaseEntry
    0x10197a4cc <+32>: ldr x8, [x19, #48]
    0x10197a4d0 <+36>: cbz x8, 0x10197a4e0 ; <+52>
    0x10197a4d4 <+40>: ldr x1, [x19, #56]
    0x10197a4d8 <+44>: mov x0, x20
    0x10197a4dc <+48>: blr x8
    0x10197a4e0 <+52>: adrp x0, 3083
    0x10197a4e4 <+56>: add x0, x0, #120 ; =120
    0x10197a4e8 <+60>: bl 0x101b60b00 ; symbol stub for: OSSpinLockLock
    0x10197a4ec <+64>: ldr x8, [x19, #32]
    0x10197a4f0 <+68>: ldr x8, [x8, #8]
    0x10197a4f4 <+72>: ldr x0, [x8, #24]
    0x10197a4f8 <+76>: cbz x0, 0x10197a500 ; <+84>
    0x10197a4fc <+80>: bl 0x101b63548 ; symbol stub for: imp_removeBlock
    0x10197a500 <+84>: ldr x0, [x19, #40]
    0x10197a504 <+88>: cbz x0, 0x10197a50c ; <+96>
    0x10197a508 <+92>: bl 0x101b63614 ; symbol stub for: objc_disposeClassPair
    0x10197a50c <+96>: adrp x0, 3083
    0x10197a510 <+100>: add x0, x0, #120 ; =120
    0x10197a514 <+104>: ldp x29, x30, [sp, #16]
    0x10197a518 <+108>: ldp x20, x19, [sp], #32
    0x10197a51c <+112>: b 0x101b60b0c ; symbol stub for: OSSpinLockUnlock
     
  18. andsee

    andsee

    Joined:
    Mar 20, 2012
    Posts:
    88
    We used everyplay too, although we had Metal disabled and GLES2 forced.
     
  19. rrsimon

    rrsimon

    Joined:
    Apr 16, 2012
    Posts:
    27
    Hi, we just got this on Unity 5.3.4p6 on iPhone 6 iOS 9.3.1 when leaving the phone plugged into Xcode for some time idle.

    Stack trace disassembly looks like it's Everyplay related:

     
  20. rrsimon

    rrsimon

    Joined:
    Apr 16, 2012
    Posts:
    27
    Also happening on iPhone 6+ and iPad Mini 4.

    For those interested, our workaround is whitelisting devices without arm64 processors so any unreleased iOS devices won't get this crash either.
     
  21. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    Could you please submit a bug report and attach a small reproduction project? Could you post the id of the new bug here? Thanks.
     
  22. rrsimon

    rrsimon

    Joined:
    Apr 16, 2012
    Posts:
    27
    I'll see what I can do with free time but we ended up removing Everyplay completely from our iOS builds. It was still crashing randomly because native code is initializing it outside of Unity so the "whitelist" workaround did nothing for this issue.

    In case I don't have time I would recommend following these steps:
    1. Make an empty project
    2. Install all of the everyplay plugin
    3. Make a simple test scene that initializes everyplay properly (I think it's initialized when its first static call is done)
    4. Install on an arm64 device. The iPhone 6+ was the first device to reproduce this here but we were also getting it on our iPad mini 4 and iPhone 6.
    EDIT: 5. Wait ~1-2 hours. It can be as little as 20 minutes but the longer the better.
     
    Last edited: Jun 7, 2016
  23. unitysportvision

    unitysportvision

    Joined:
    Aug 30, 2016
    Posts:
    1
    Happens to us too on Unity 552p1. Has anyone created a repro project and submitted it to Unity support?
     
  24. kmedved

    kmedved

    Joined:
    Aug 18, 2016
    Posts:
    187
    I had the similar issue and turned off Strip Code Engine and it helps me.