5.5 - NSInternalInconsistencyException crash on resume?

Is anyone else seeing a crash trying to resume their app in 5.5?

Edit: - Also happens on 5.4.3p4. Seems related to Application.TargetFramerate=60. Which has caused previous issues when building with XCode 8?

I’ve got a crash that seems to be happening 100% if I lock the device while the Unity app is running, then unlock it returning focus to the app. I don’t think I’ve got any OnApplicationPause code anywhere, but I do use rendertextures and dynamically updated meshes.

I seem to be seeing at least two variations of it - this one:

*** Assertion failure in void _prepareForCAFlush(UIApplication *__strong)(), /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3600.6.22/UIApplication.m:2377
2016-12-26 14:07:02.107537 jump[1379:535252] Uncaught exception: NSInternalInconsistencyException: unexpected start state

and also this one:

*** Assertion failure in -[UIApplicationSceneSettingsDiffInspector inspectDiff:withContext:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/FrontBoardServices/FrontBoard-388.8.6/FrontBoardServices/FBSSettingsDiffInspector.m:35
2016-12-26 14:05:07.901874 jump[1357:533470] Uncaught exception: NSInternalInconsistencyException: can’t start iterating in the middle of an iteration

Running on an iPhone 6s, using Metal, currently on 5.5.0p3, but only updated to the patch release after seeing the crashes on 5.5.0

2897978–213275–crashlog_1.txt (5.81 KB)
2897978–213276–crashlog_2.txt (6.15 KB)

After a bit more experimentation, the crash goes away if I remove Application.TargetFramerate=60 and let it chug along at 30fps.

So is 60fps still problematic when building with XCode 8?

Ok… it looks like I can reproduce this using an empty scene.

Just created a new scene, added a script that sets Application.targetFrameRate = 60; on Start().

Run it, lock device, unlock device… crash…

Edit: hmmm, but when trying an empty scene in a completely new project, I’m not getting the crash…)

Edit2: Have managed to repro it in an empty project after setting the screen auto-rotation settings to match the crashing project. Added a comment to the XCode 8 thread here

Appears to be related to this crash:

I’m getting this too, in latest patch release (5.5.1p2)

Yep seeing this too. @bluescrn has a bug report been sent? Are Unity aware of it?

From the thread linked above:

Claimed fixed in 5.6.0 (but apparently seen in 5.6.0b2?) Anyone tried it in the latest beta?