mapbox/mapbox-vision-ios

Vision crashes on iOS 14 with an unhandled exception when starting VisionManager in Apex

avi-c opened this issue · 4 comments

avi-c commented

If you enable AR Navigation in Apex and attempt to use it by rotating your phone, the app will crash when Vision is starting up.

Configuration

  • Device: iPhone Xs Max
  • OS: 14.0.1
  • Frameworks versions (leave the ones you're using):
    From the Apex Podfile.lock:
  • MapboxVision (0.13.0):
    • MapboxMobileEvents (~> 0.10.2)
    • MapboxVisionNativeAll/Vision (= 0.13.0)
    • ZIPFoundation (~> 0.9.9)
  • MapboxVisionAR (0.13.0):
    • MapboxVision (= 0.13.0)
    • MapboxVisionNativeAll/AR (= 0.13.0)
  • MapboxVisionNativeAll (0.13.0):
    • MapboxVisionNativeAll/AR (= 0.13.0)
    • MapboxVisionNativeAll/Safety (= 0.13.0)
    • MapboxVisionNativeAll/Vision (= 0.13.0)
  • MapboxVisionNativeAll/AR (0.13.0):
    • MapboxVisionNativeAll/Vision
  • MapboxVisionNativeAll/Safety (0.13.0):
    • MapboxVisionNativeAll/Vision
  • MapboxVisionNativeAll/Vision (0.13.0):
    • MapboxAccounts (~> 2.2)
    • OpenCV (~> 2.4.13.6)

Additional context

Backtrace from crash:

  • thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
    frame #0: 0x000000010db958d0 MapboxVisionNativecva::Core::Shutdown() + 56 frame #1: 0x000000010dafdb84 MapboxVisionNativei.2163 + 92
    frame #2: 0x000000010daa264c MapboxVisionNativemapbox::vision::ios::onIssueDetected() + 28 frame #3: 0x000000010db70880 MapboxVisionNativei.2300 + 86928
    frame #4: 0x000000010d7c330c MapboxVision@nonobjc MBVVisionManagerNative.start() at <compiler-generated>:0 frame #5: 0x000000010d7c32d4 MapboxVisionprotocol witness for VisionManagerNativeProtocol.start() in conformance MBVVisionManagerNative at :0
    • frame #6: 0x000000010d7bf610 MapboxVisionVisionManager.resume(self=0x0000000280455e10) at VisionManager.swift:234:29 frame #7: 0x000000010d7bf470 MapboxVisionVisionManager.start(self=0x0000000280455e10) at VisionManager.swift:69:9
      frame #8: 0x0000000104633690 ApexVisionNavigationViewController.startVision(self=0x00000001319107a0) at VisionNavigationViewController.swift:109:55 frame #9: 0x000000010463254c ApexVisionNavigationViewController.viewDidAppear(animated=false, self=0x00000001319107a0) at VisionNavigationViewController.swift:50:9
      frame #10: 0x0000000104632594 Apex@objc VisionNavigationViewController.viewDidAppear(_:) at <compiler-generated>:0 frame #11: 0x0000000190347764 UIKitCore-[UIViewController _setViewAppearState:isAnimating:] + 876
      frame #12: 0x000000019034811c UIKitCore-[UIViewController __viewDidAppear:] + 172 frame #13: 0x0000000190349ca8 UIKitCore__64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 48
      frame #14: 0x0000000190348aa0 UIKitCore-[UIViewController _executeAfterAppearanceBlock] + 96 frame #15: 0x0000000190a4c500 UIKitCore_runAfterCACommitDeferredBlocks + 556
      frame #16: 0x0000000190a3b1bc UIKitCore_cleanUpAfterCAFlushAndRunDeferredBlocks + 204 frame #17: 0x0000000190a6e648 UIKitCore_afterCACommitHandler + 80
      frame #18: 0x000000018e09e444 CoreFoundation__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36 frame #19: 0x000000018e098858 CoreFoundation__CFRunLoopDoObservers + 576
      frame #20: 0x000000018e098e08 CoreFoundation__CFRunLoopRun + 1056 frame #21: 0x000000018e0984bc CoreFoundationCFRunLoopRunSpecific + 600
      frame #22: 0x00000001a4b1d820 GraphicsServicesGSEventRunModal + 164 frame #23: 0x0000000190a3c734 UIKitCore-[UIApplication _run] + 1072
      frame #24: 0x0000000190a41e10 UIKitCoreUIApplicationMain + 168 frame #25: 0x00000001047c0760 Apexmain at AppDelegate.swift:16:7
      frame #26: 0x000000018dd5fe60 libdyld.dylib`start + 4
avi-c commented

So far this happens 100% of the time on my iOS 14 device but works fine on iOS 13. Perhaps related to #334.

Looking at the trace this could be duplicate of this: #334

Taking into account the stack trace above, I have an assumption on what's the reason. Going to check it later tomorrow and report if the fix can be provided soon.

@MarcoCarnevali @avi-c Is this still happening on Xcode 12?