BabylonNative iOS AR crash

hi, im coming across a frequent crash when running BabylonNative on iOS with AR enabled.
Apps/Playground/Scripts/experience.js
var ar = true;

happens approx 1 in 3 launches.
only when the AR camera becomes initialized after the 5s timeout.

Babylon Native (v7.12.0)
iPhone 15 Pro Max (iOS 17.5.1)

crash detailed in the screenshots below:



then every other time, I get a different crash:



1 Like

also to add, this is running in Debug
but when running in Release, it seems to be more stable

@ryantrem might know something about this

I know you said this is only happening in debug, but does it also only happen when the debugger is attached? If you run a debug build without the debugger attached do you hit the same error?

hi @ryantrem, im assuming you mean un-ticking Debug executable option
it is still crashing after doing that.

It looks like 2 issues:

  • 1 Metal validation layer. that will not show up in release or with Validation Layer disabled
  • 1 assert in object delete_reference. This one should not pop up in release as well.

I’ll try to repro asap

3 Likes

No sorry I meant starting the debug build of the app directly on your iPhone, not launching it through xcode. Just trying to understand if this is a debugging only issue.

ah got it, sorry misunderstood.
when launching the debug app from home screen, it still crashes but less frequently.
im seeing around 1 in 10 launches will crash when moving to AR screen.

1 Like

I do not repro any of these 2 bugs. Launching from Xcode or the dashboard. Metal validation is on. iPhone 11 with up to date iOS and bjs 7.12.0. This is annoying.
The difference I see is using an iPhone 15.
Can you make a quick try @docEdub and @srzerbetto if you have a more recent iPhone?

i have a bunch of different iphones for testing and can try these tomorrow.

testing on a couple other iOS devices, im getting some different crashes which happen on every app run. this on app launch, not during AR initialization. same behaviour for both Debug and Release.

iPhone X (15.7.1)
iPhone Xs Max (15.2)



1 Like

I guess it doesn’t happen when running without metal validation or directly running from the dashboard ?

All I have is an iPhone 12.

Do you get a crash?

No crash on my machine when debugging on iPhone 12.

1 Like

that is really strange that no one else can replicate the issue.
could it be something specific with my system?

confirming my details:
Babylon Native (v7.12.0)
Macbook Pro, Apple M1 Max chip, MacOS 14.5
XCode 15.4
Python 3.12.2
and building with:

cmake -B build/iOS -G Xcode -D IOS=ON

only thing im changing in the XCode project is:
Apps/Playground/Scripts/experience.js - var ar = true;

I’m using same Xcode, bjs and MacOS versions.
Except the CPU (Intel CPU for me) and iPhone model, I don’t see a difference.
@srzerbetto Did you have the chance to test it on your iPhone?

I will give it a try today.

1 Like

I’m able to repro it using an Iphone 12 with iOS 17.0.2

1 Like

Can you please test if this PR works for you ? iOS AR Metal Validation Error by CedricGuillemet · Pull Request #1403 · BabylonJS/BabylonNative · GitHub