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

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! Persistent crashes on iOS when unloading scene · Issue #95 · Unity-Technologies/arfoundation-samples · GitHub

I get the following error from Xcode:

libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ARFrame storageMode]: unrecognized selector sent to instance 0x1514753f0'
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

1 Like

@ROBYER1_1 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?

You possibly can, not sure what else I can say to this other than give it a try

Thanks for this report @ROBYER1_1 . 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.

Opened one quickly here just to track it: https://github.com/Unity-Technologies/arfoundation-samples/issues/1075

1 Like

Hi @ROBYER1_1 - it was reported to us through customer QA that you consider this resolved now - is that correct?

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.