Freeze on iOS Safari when removing meshes

This example freezes on iOS iPhone 12 Safari right after the screen is touched and camera moves a bit:

I have been investigating on this bug for a week now in other setting and have to say this is rather mysterious! Hope someone would have some idea?

The code does not freeze if mesh is not removed or disposed (also it does not freeze on desktop). So, for some reason now there is a rather serious lockup situation on iOS when meshes are disposed nearby the rendering loop…

Edit: Now for a while this worked ok and then after 20 minutes started occuring again like in the video below. :thinking:


Here is a video of what happens:

1 Like

Adding @Cedric

Just reporting that we have noticed this issue too, in particular when we dispose a photodome on iPhone.

Some more info:
Bug seems to occur about 20% of times. It might occur a bit more if url is “added to homescreen” on iOS.

This bug also reminds me a lot of this bug, but that same fix does not fix this: Extremely long freeze on iOS ( bare playground example ) - #19 by br-matt

Some updates:
I am not running Babylon build with these modifications:

in freecamera.ts: line 243

    public attachControl(ignored?: any, noPreventDefault?: boolean): void {
        noPreventDefault = Tools.BackCompatCameraNoPreventDefault(arguments);
        //this.inputs.attachElement(noPreventDefault); // Comment out any input code

in scene.ts: line 1482

        if (DomManagement.IsWindowObjectExist()) {
            //this.attachControl(); // Comment out any input code

…and so far this seems to elimite the lockup. I am not sure yet though, as the bug reproduces at 20% propability anyways…

@gabrieljbaker: I am interested in knowing if the photodome lockup happens everytime? Could that make a good test case as Playground for this?

Sadly I got the freeze in my app again. It was later than used to happen, now that the other freeze is fixed.

Can confirm with @JSa playground in first post of this thread freezes me every time ( not 20% for me )

@br-matt : To be more accurate, it occurs this way for me:

  • At times I can run the example like 4 hours trying every now and then => It works all the time, 0% reproduction rate.
  • Then, next time I try => It freezes for on the first try and no matter what I do it keeps freezing every time! Even if browser is restarted etc.

I even tested if it was somehow linked to iOS’s night time screen mode but no luck there either. :slight_smile:

Right now though, I am developing my app for 6 hours without freeze using the fix mentioned above… I really hope I have found a lead now.

@PolygonalSun could you have a look and double check if there is anything obvious on this one ? as it sounds related to your previous fix or at least pretty close in behavior.

1 Like

I’ll take a look at this and see what I can find.


So I’ve been testing this on iPhone and I was unable to repro this currently (as of 5.0 alpha 28). I can keep trying every so often but I’m not sure what exactly this could be.

I can not repro either, this is weird… :frowning: hope somebody else can try it out ? @Cedric maybe ?

Its crazy, yesterday I could not get the freeze 30x in a row tries ( was going to ping this thread )

Today, first try on the original PG, frozen. Battery at 92%… iPhone 12 pro max
edit: today can get the freeze nearly every attempt

@PolygonalSun as soon as it loads you should be swiping left and right quickly spinning the camera back and forth

I’m still not having any luck. I’ve tried to repro it a bunch of times but no luck. I’m working with an iPhone XR.

I can repro with iPhone 7+

you are our best hope Gary !!!

or maybe @Cedric ???

Can you repro it reliably? If so, tell me your secret

1 Like

Are you guys moving the camera? It doesn’t repro until the camera is moved.