Search Unity

Resolved iOS crashes when loading AR scene

Discussion in 'Unity MARS' started by Ricardotlpz, Oct 25, 2021.

  1. Ricardotlpz

    Ricardotlpz

    Joined:
    May 17, 2021
    Posts:
    63
    Hey there!

    I've been facing this issue where I change from a QR code scanner to a MARS AR session and after the assets have been unloaded ("Unloading 6 Unused Serialized files (Serialized files now loaded: 0)"), I get the following error:

    Code (CSharp):
    1. Oct 25 12:30:10.134 RemoteConsole <stderr>: SIGSEGV received (segmentation violation) -- WHOA! I did something nasty. Dumping the stack trace:
    2. Oct 25 12:30:10.167 RemoteConsole <stderr>: 0   EpixAR                             0x00000001026f2d28 __sig_handler + 216
    3. Oct 25 12:30:10.167 RemoteConsole <stderr>: 1   libsystem_platform.dylib           0x00000001f0371c18 9B829BD8-A5BA-3CD7-8E93-13538DCD12B2 + 7192
    4. Oct 25 12:30:10.167 RemoteConsole <stderr>: 2   UnityFramework                     0x0000000120019b94 ar2VideoCloseiPhone + 48
    5. Oct 25 12:30:10.167 RemoteConsole <stderr>: 3  UnityFramework                      0x0000000120018468 CameraVideoController::Release() + 144
    6. Oct 25 12:30:10.167 RemoteConsole <stderr>: 4   UnityFramework                     0x0000000120017a3c Release + 32
    7. Oct 25 12:30:10.167 RemoteConsole <stderr>: 5  UnityFramework                      0x000000011a406668 NativePluginStatic_Release_mBA905530BE2946CE4E402C0C1925C15B0E8B9C9A + 20
    8. Oct 25 12:30:10.167 RemoteConsole <stderr>: 6  UnityFramework                      0x000000011a40db28 EasyWebCamiOS_Release_m419C624A06646C0E9E1CB157ADF6BBC69DE67F0E + 472
    9. Oct 25 12:30:10.167 RemoteConsole <stderr>: 7  UnityFramework                      0x000000011a3f75b4 InterfaceActionInvoker0::Invoke(unsigned short, Il2CppClass*, Il2CppObject*) + 280
    10. Oct 25 12:30:10.167 RemoteConsole <stderr>: 8   UnityFramework                     0x000000011a3f9e64 EasyWebCam_OnRelease_m7F7BDCB0155D0A57B9613FBC619044A711E1744A + 780
    11. Oct 25 12:30:10.167 RemoteConsole <stderr>: 9  UnityFramework                      0x000000011a3fc6d8 EasyWebCam_OnDestroy_mDD5F16ABF8F5FA07BFA25DFC22EA102A9262E963 + 304
    12. Oct 25 12:30:10.167 RemoteConsole <stderr>: 10 UnityFramework                     0x000000011be861f0 RuntimeInvoker_TrueVoid_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5(void (*)(), MethodInfo const*, void*, void**) + 44
    13. Oct 25 12:30:10.167 RemoteConsole <stderr>: 11  UnityFramework                      0x000000011ffcda4c DllCanUnloadNow + 95548
    14. Oct 25 12:30:10.167 RemoteConsole <stderr>: 12  UnityFramework                      0x000000011f77d114 operator delete[](void*, std::nothrow_t const&) + 6273788
    15. Oct 25 12:30:10.167 RemoteConsole <stderr>: 13 UnityFramework                     0x000000011f78c4bc operator delete[](void*, std::nothrow_t const&) + 6336164
    16. Oct 25 12:30:10.167 RemoteConsole <stderr>: 14 UnityFramework                     0x000000011f78ed08 operator delete[](void*, std::nothrow_t const&) + 6346480
    17. Oct 25 12:30:10.167 RemoteConsole <stderr>: 15 UnityFramework                     0x000000011f7d06c4 operator delete[](void*, std::nothrow_t const&) + 6615212
    18. Oct 25 12:30:10.167 RemoteConsole <stderr>: 16 UnityFramework                     0x000000011f1cb190 operator delete[](void*, std::nothrow_t const&) + 301944
    19. Oct 25 12:30:10.168 RemoteConsole <stderr>: 17  UnityFramework                      0x000000011f4b819c operator delete[](void*, std::nothrow_t const&) + 3369860
    20. Oct 25 12:30:10.168 RemoteConsole <stderr>: 18  UnityFramework                      0x000000011f4b89cc operator delete[](void*, std::nothrow_t const&) + 3371956
    21. Oct 25 12:30:10.168 RemoteConsole <stderr>: 19  UnityFramework                      0x000000011f4b8be8 operator delete[](void*, std::nothrow_t const&) + 3372496
    22. Oct 25 12:30:10.168 RemoteConsole <stderr>: 20  UnityFramework                      0x000000011f4b9980 operator delete[](void*, std::nothrow_t const&) + 3375976
    23. Oct 25 12:30:10.168 RemoteConsole <stderr>: 21  UnityFramework                      0x000000011f4e6b14 operator delete[](void*, std::nothrow_t const&) + 3560700
    24. Oct 25 12:30:10.168 RemoteConsole <stderr>: 22  UnityFramework                      0x000000011f4e6754 operator delete[](void*, std::nothrow_t const&) + 3559740
    25. Oct 25 12:30:10.168 RemoteConsole <stderr>: 23  UnityFramework                      0x000000011f4e7e70 operator delete[](void*, std::nothrow_t const&) + 3565656
    26. Oct 25 12:30:10.168 RemoteConsole <stderr>: 24  UnityFramework                      0x000000011f4e86a0 operator delete[](void*, std::nothrow_t const&) + 3567752
    27. Oct 25 12:30:10.168 RemoteConsole <stderr>: 25  UnityFramework                      0x000000011f4e88f0 operator delete[](void*, std::nothrow_t const&) + 3568344
    28. Oct 25 12:30:10.168 RemoteConsole <stderr>: 26 UnityFramework                     0x000000011f4d2b24 operator delete[](void*, std::nothrow_t const&) + 3478796
    29. Oct 25 12:30:10.168 RemoteConsole <stderr>: 27 UnityFramework                     0x000000011f4ca1ac operator delete[](void*, std::nothrow_t const&) + 3443604
    30. Oct 25 12:30:10.168 RemoteConsole <stderr>: 28 UnityFramework                     0x000000011f4ca210 operator delete[](void*, std::nothrow_t const&) + 3443704
    31. Oct 25 12:30:10.168 RemoteConsole <stderr>: 29 UnityFramework                     0x000000011f4ca540 operator delete[](void*, std::nothrow_t const&) + 3444520
    32. Oct 25 12:30:10.168 RemoteConsole <stderr>: 30 UnityFramework                     0x000000011fb52cec MetalHeap::AliasResources() + 124508
    33. Oct 25 12:30:10.168 RemoteConsole <stderr>: 31  UnityFramework                      0x000000011a3c8548 UnityRepaint + 28
    34. Oct 25 12:30:10.168 RemoteConsole <stderr>: 32  UnityFramework                      0x000000011a3c8520 UnityOnDemandResourcesGetResourcePath + 1108
    35. Oct 25 12:30:10.168 RemoteConsole <stderr>: 33 UnityFramework                     0x000000011a3c846c UnityOnDemandResourcesGetResourcePath + 928
    36. Oct 25 12:30:10.168 RemoteConsole <stderr>: 34 QuartzCore                         0x000000018450020c 8AB30EEB-FB15-36CB-9C27-918ED68500EE + 66060
    37. Oct 25 12:30:10.168 RemoteConsole <stderr>: 35  QuartzCore                          0x0000000184506b60 8AB30EEB-FB15-36CB-9C27-918ED68500EE + 93024
    38. Oct 25 12:30:10.168 RemoteConsole <stderr>: 36 CoreFoundation                     0x00000001807a93a0 6174789A-E88C-3F5C-BA39-DE2E9EDC0750 + 45984
    39. Oct 25 12:30:10.168 RemoteConsole <stderr>: 37  CoreFoundation                      0x00000001807ec734 6174789A-E88C-3F5C-BA39-DE2E9EDC0750 + 321332
    40. Oct 25 12:30:10.168 RemoteConsole <stderr>: 38  CoreFoundation                      0x00000001807eff40 6174789A-E88C-3F5C-BA39-DE2E9EDC0750 + 335680
    41. Oct 25 12:30:10.168 RemoteConsole <stderr>: 39  CoreFoundation                      0x00000001807a9e1c 6174789A-E88C-3F5C-BA39-DE2E9EDC0750 + 48668
    42. Oct 25 12:30:10.168 RemoteConsole <stderr>: 40 CoreFoundation                     0x00000001807bd3c8 CFRunLoopRunSpecific + 600
    43. Oct 25 12:30:10.168 RemoteConsole <stderr>: 41  GraphicsServices                    0x000000019bfce38c GSEventRunModal + 164
    44. Oct 25 12:30:10.168 RemoteConsole <stderr>: 42  UIKitCore                          0x0000000183163060 C46A087A-E13A-3AED-A8A1-D4CC4AC9948A + 5353568
    45. Oct 25 12:30:10.168 RemoteConsole <stderr>: 43 UIKitCore                           0x0000000182ee0b8c UIApplicationMain + 2124
    46. Oct 25 12:30:10.168 RemoteConsole <stderr>: 44  UnityFramework                      0x000000011a3c7bfc ComputeSafeArea(UIView*) + 1880
    47. Oct 25 12:30:10.168 RemoteConsole <stderr>: 45  EpixAR                              0x00000001026f1e00 _rdc_main(int, char**) + 68
    48. Oct 25 12:30:10.168 RemoteConsole <stderr>: 46  EpixAR                              0x00000001026f2754 main + 1440
    49. Oct 25 12:30:10.168 RemoteConsole <stderr>: 47  dyld                                0x0000000102a41a24 start + 520
    Note that we're passing the QR code value between scenes with a GameObject and a DontDestroyOnLoad(). I've coded some debug logs and verified that writing the data onto the GameObject isn't the cause of the SIGSEGV.

    Also, I've succesfully compiled and run the AR scene as a standalone app, but when using this QR code and AR session scenes and making the transition, it crashes.
     
  2. mtschoen

    mtschoen

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    194
    Hi there! Sorry to hear you're having trouble.

    Unfortunately, there doesn't seem to be much we can do with the information provided. The stack trace points to an exception within the native plugin in the QR code scanner library, or so it seems.

    Can you submit the project in a bug report? Otherwise, I would recommend that you try replicate the issue in an isolation project where you start and stop the QR Code scanner in the same way as you're doing it here. It seems like maybe you've already tried this but is it going through the whole flow?

    Does this include stopping/destroying the QR Code scanner? It seems to be happening in some destroy/teardown method.
     
  3. Ricardotlpz

    Ricardotlpz

    Joined:
    May 17, 2021
    Posts:
    63
    Thank you! I have digged a bit deeper and discovered it's not an AR problem but the scene that contains the QR scanner is giving me issues.
     
    mtschoen likes this.