Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] iOS 17 + iPhone 15 Pro - Random Crashes #1111

Open
dganzella opened this issue Oct 9, 2023 · 10 comments
Open

[Bug] iOS 17 + iPhone 15 Pro - Random Crashes #1111

dganzella opened this issue Oct 9, 2023 · 10 comments
Labels
bug A bug in an ARFoundation-related package fixpending

Comments

@dganzella
Copy link

dganzella commented Oct 9, 2023

Describe the bug

iPhone 15 Pro and 15 Pro Max on ios 17 will randomly crash when using ARKIT

image

image

To Reproduce
Steps to reproduce the behavior:
Use any arkit sample for little while, with iphone 15 pro on ios 17, then lock the phone and open it again multiple times

the iphone will crash eventually/randomly

Expected behavior
No random crashes

Actual behavior
Crashes

Smartphone (please complete the following information):

  • Device: Iphone 15 PRO, Iphone 15 PRO max
  • OS: ios 17+
  • 2023.1.10f
  • ARFoundation version: 5.1.0
@dganzella dganzella added the bug A bug in an ARFoundation-related package label Oct 9, 2023
@dganzella
Copy link
Author

PS. happens even with MT rendering off

@dganzella
Copy link
Author

It seems it happens when coming back from the device being locked. It crashes right after opening the application again.

@dganzella
Copy link
Author

seems I was able to elimate it. here is the thing:

I found this line of code inside ARKIT:

static readonly bool k_MultithreadedRenderingEnabled =
                k_RenderingThreadingMode is RenderingThreadingMode.MultiThreaded or RenderingThreadingMode.NativeGraphicsJobs;

so you have to disable both MultiThreaded and NativeGraphicsJobs in order to really disable multithreaded rendering.

previously, our app was with k_MultithreadedRenderingEnabled disabled but NativeGraphicsJobs enabled

disabling BOTH seem to have fixed the crashes

@andyb-unity andyb-unity added the needsinvestigation Requires further investigation by Unity label Oct 11, 2023
@andyb-unity
Copy link
Collaborator

andyb-unity commented Oct 11, 2023

Thanks @dganzella for this detailed report.

@dganzella
Copy link
Author

hmmm @andyb-unity still crashing

image

even with MT rendering and graphics jobs OFF, but random this time

@dganzella
Copy link
Author

I noticed that after updatign to 17.1 all the crashes went away

we have not had a single crash instance of 17.1. No crashes from the past 10 days

@NJMnm
Copy link

NJMnm commented Nov 6, 2023

@dganzella
Did it work for you with k_MultithreadedRenderingEnabled/NativeGraphicsJobs on or both off?
Thanks ins advance!

@andyb-unity
Copy link
Collaborator

andyb-unity commented Nov 6, 2023

@dganzella interesting. I suspect that the iOS 17.1 "fix" may just change something about the thread scheduling that hides the underlying race condition. Our investigation so far has shown that the issue is in Unity's Metal texture implementation, and XR is working with the Graphics team to get them everything they need to implement a fix.

Edit: oh I misread your earlier post and thought that you had claimed that iOS 17.1 fixed the multithreaded rendering issues. As I noted here, we believe the multithreaded crash on lock/unlock is a Unity Graphics issue.

@dganzella
Copy link
Author

@NJMnm I tested only with both k_MultithreadedRenderingEnabled/NativeGraphicsJobs off. Im kinda afraid to turn them on :(

@andyb-unity andyb-unity added editor An issue in Unity Editor code that cannot be fixed in the AR Foundation package and removed needsinvestigation Requires further investigation by Unity labels Nov 6, 2023
@andyb-unity andyb-unity added fixpending and removed editor An issue in Unity Editor code that cannot be fixed in the AR Foundation package labels Dec 11, 2023
@andyb-unity
Copy link
Collaborator

We have fixed one possible cause of this crash. This fix is in the following versions:

4.2.10
5.1.2 (release pending)
6.0.0 (release pending)

Review the ARKit changelog in these versions, should you choose to upgrade. The fix also requires specific minimum patch versions of Unity.

We are also investigating a similar report of this crash for scenes that use Occlusion, specifically. Our fix thus far has only touched the Camera subsystem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in an ARFoundation-related package fixpending
Projects
None yet
Development

No branches or pull requests

3 participants