Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Bug [IN-35599] MultiThreaded Rendering crash AR Foundation when enable/disable AR Session

Discussion in 'AR' started by ROBYER1, Mar 17, 2023.

  1. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,455
    Working on a simple AR app recently using Unity as a library (UAAL) to embed Unity inside a native app using AR Foundation 5.0.5 in Unity 2022.2.10 for Android and iOS. At first I thought the crashes were due to UAAL, so I did some builds of the Unity app on its own to iOS/Android devices. I noticed when I disabled/enabled the AR Session component and the AR Camera gameobject with Multithreaded Rendering enabled, the app would crash sometimes when doing this.

    As soon as I disabled Multithreaded Rendering in player settings, the crashes stopped happening.

    I found this issue here but nobody logged a bug for this and multiple users mentioned disabling multi-threaded rendering fixed their crash issue as it did for me. There are quite a few issues on github where people mentioned this too but not a single one of them bothered to file a Unity bug and report back! https://github.com/Unity-Technologies/arfoundation-samples/issues/95#issuecomment-1132424075

    I get the following error from Xcode:
    Code (CSharp):
    1. libc++abi: terminating with uncaught exception of type NSException
    2. *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ARFrame storageMode]: unrecognized selector sent to instance 0x1514753f0'
    3. terminating with uncaught exception of type NSException
    Reported to Unity with Bug: IN-35599 - [AR Foundation] MultiThreaded Rendering crash AR Foundation when enable/disable AR Session on iOS+Android
     
    Last edited: Mar 17, 2023
    newguy123 likes this.
  2. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,281
    @ROBYER1 I suspect I'm getting similar issues

    I have a couple of users in my beta in Testflight, and I can see they are also getting crashes on iOS and they mention that the crash happen only when refreshing the scene, basically resetting/unloading/loading AR session etc

    How can I see this error in XCode as you describe, so I may possibly confirm if my issues is same as yours?
     
  3. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,455
    You possibly can, not sure what else I can say to this other than give it a try
     
  4. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,178
    Thanks for this report @ROBYER1. We don't read comments on closed GitHub issues so this is the first I've heard of it. I've bookmarked this to try to reproduce. In the meantime if you'd like to open a new GitHub issue that links to the old one (the old one was closed as fixed in ARF 3.1), you are welcome to.
     
  5. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,455
    andyb-unity likes this.
  6. CiaranWills

    CiaranWills

    Unity Technologies

    Joined:
    Apr 24, 2020
    Posts:
    199
    Hi @ROBYER1 - it was reported to us through customer QA that you consider this resolved now - is that correct?
     
  7. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,455
    I don't recall telling them that it was resolved - I can see QA told me they could reproduce it on iOS but not Android, which suggests there is a reproducible issue to be fixed.