Search Unity

Bug iPhone 10+ crash in deallocing an ARkit structure

Discussion in 'AR' started by ivoras, Mar 25, 2021.

  1. ivoras

    ivoras

    Joined:
    May 21, 2020
    Posts:
    66
    The code is working on an iPhone7 device, but on iPhone10+, it's crashing with SIGSEGV in "Thread 2" which isn't started by my code:

    Code (CSharp):
    1.  
    2. Thread 2 name:
    3. Thread 2 Crashed:
    4. 0   libobjc.A.dylib                   0x00000001ac268018 objc_release + 8 (NSObject.mm:1822)
    5. 1   CoreFoundation                    0x0000000197290c78 cow_cleanup + 144 (NSCollectionAux.h:48)
    6. 2   CoreFoundation                    0x000000019710d47c -[__NSDictionaryM dealloc] + 160 (NSCopyOnWrite.h:229)
    7. 3   CoreVideo                         0x000000019f889cc4 CVBuffer::finalize() + 56 (CVBufferInternal.cpp:69)
    8. 4   CoreVideo                         0x000000019f88b834 CVPixelBuffer::finalize() + 232 (CVPixelBufferInternal.cpp:309)
    9. 5   CoreFoundation                    0x00000001971ab104 _CFRelease + 248 (CFRuntime.c:2126)
    10. 6   ARKitCore                         0x00000001c2d052a0 -[ARImageData dealloc] + 60 (ARImageData.m:219)
    11. 7   ARKitCore                         0x00000001c2d97960 -[ARFrameContext .cxx_destruct] + 80 (ARFrameContext.m:41)
    12. 8   libobjc.A.dylib                   0x00000001ac248b10 object_cxxDestructFromClass(objc_object*, objc_class*) + 112 (objc-class.mm:455)
    13. 9   libobjc.A.dylib                   0x00000001ac25f840 objc_destructInstance + 80 (objc-class.mm:469)
    14. 10  libobjc.A.dylib                   0x00000001ac26680c _objc_rootDealloc + 80 (objc-runtime-new.mm:8131)
    15. 11  libobjc.A.dylib                   0x00000001ac248b10 object_cxxDestructFromClass(objc_object*, objc_class*) + 112 (objc-class.mm:455)
    16. 12  libobjc.A.dylib                   0x00000001ac25f840 objc_destructInstance + 80 (objc-class.mm:469)
    17. 13  libobjc.A.dylib                   0x00000001ac26680c _objc_rootDealloc + 80 (objc-runtime-new.mm:8131)
    18. 14  libobjc.A.dylib                   0x00000001ac248b10 object_cxxDestructFromClass(objc_object*, objc_class*) + 112 (objc-class.mm:455)
    19. 15  libobjc.A.dylib                   0x00000001ac25f840 objc_destructInstance + 80 (objc-class.mm:469)
    20. 16  libobjc.A.dylib                   0x00000001ac26680c _objc_rootDealloc + 80 (objc-runtime-new.mm:8131)
    21. 17  libobjc.A.dylib                   0x00000001ac248b10 object_cxxDestructFromClass(objc_object*, objc_class*) + 112 (objc-class.mm:455)
    22. 18  libobjc.A.dylib                   0x00000001ac25f840 objc_destructInstance + 80 (objc-class.mm:469)
    23. 19  libobjc.A.dylib                   0x00000001ac26680c _objc_rootDealloc + 80 (objc-runtime-new.mm:8131)
    24. 20  ARKitCore                         0x00000001c2df052c -[ARTechniqueParallelGatherContext captureGatheredData] + 1324 (ARTechniqueGatherContext.m:310)
    25. 21  ARKitCore                         0x00000001c2d76870 -[ARParentTechnique _submitResultsForTimestamp:context:] + 128 (ARParentTechnique.m:534)
    26. 22  libdispatch.dylib                 0x0000000196e21db0 _dispatch_client_callout + 20 (object.m:559)
    27. 23  libdispatch.dylib                 0x0000000196e2512c _dispatch_continuation_pop + 416 (inline_internal.h:2548)
    28. 24  libdispatch.dylib                 0x0000000196e36c08 _dispatch_source_invoke + 1260 (source.c:570)
    29. 25  libdispatch.dylib                 0x0000000196e28fd8 _dispatch_lane_serial_drain + 272 (inline_internal.h:2589)
    30. 26  libdispatch.dylib                 0x0000000196e29c90 _dispatch_lane_invoke + 460 (queue.c:3862)
    31. 27  libdispatch.dylib                 0x0000000196e2ae60 _dispatch_workloop_invoke + 1588 (inline_internal.h:2589)
    32. 28  libdispatch.dylib                 0x0000000196e33d78 _dispatch_workloop_worker_thread + 708 (queue.c:6601)
    33. 29  libsystem_pthread.dylib           0x00000001e2cdd814 _pthread_wqthread + 276 (pthread.c:2211)
    34. 30  libsystem_pthread.dylib           0x00000001e2ce476c start_wqthread + 8
    35.  
    It looks like a double free or a null pointer reference in ARFrameContext or thereabouts.

    This is on Unity 2021.1.0f1, AR Kit and Foundation 4.1.5.

    Is there a better forum I can submit a bug report?
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,820
  3. normus28

    normus28

    Joined:
    Feb 16, 2014
    Posts:
    5
    I have the same problem my app crashes in thread 47

    Code (CSharp):
    1.  
    Here is crash log (sorry for pastern but this forum wouldn't allow me to post it here) : https://pastebin.com/yhjrcuCB

    What is causing it and is there any fix for it?: