iOS 13.3 crash at IOSScripting::GetDeferSystemGesturesMode()

Since our last app update (from Unity 2019.1 to 2019.3.11) I start seeing this crash on nearly all devices running iOS 13.3 and 13.3.1. Not a single crash on other iOS versions. Any ideas why? Only thing I can say is that it looks like a Unity bug.

I see in the stack trace UnityViewControllerBase+iOS.mm line 62 which is related to screen edges. And one change I have made since the last update is to disable auto-rotation in the app settings and set the default orientation to “Portrait”, so it may be related.

Would making - (UIRectEdge)preferredScreenEdgesDeferringSystemGestures return UIEdgeRectAll be a valid workaround until this gets fixed?

Native StackTrace:

Thread 0 (crashed)
0   UnityFramework                     0x0000000102ebe69c IOSScripting::GetDeferSystemGesturesMode() (PlayerSettings.h:0)
1   UnityFramework                     0x0000000102fdacd4 UnityGetDeferSystemGesturesTopEdge (TrampolineGlue.mm:52)
2   UnityFramework                     0x000000010281e4d8 -[UnityViewControllerBase(iOS) preferredScreenEdgesDeferringSystemGestures] (UnityViewControllerBase+iOS.mm:62)
3   UIKitCore                          0x00000001b992b0f8 -[_UISystemAppearanceManager updateScreenEdgesDeferringSystemGestures]
4   UIKitCore                          0x5a46cf81b9b636f8 __70-[UIViewController setNeedsUpdateOfScreenEdgesDeferringSystemGestures]_block_invoke_2
5   UIKitCore                          0xe7175381b9b43210 -[UIViewController _updateSystemAppearanceWithRecursionBlock:action:]
6   UIKitCore                          0xae507c81b9b63314 -[UIViewController _setPresentedStatusBarViewController:]
7   UIKitCore                          0x6c01f901b9b59538 -[UIViewController _dismissViewControllerWithAnimationController:interactionController:completion:]
8   UIKitCore                          0xad2ac881ba62ed54 +[UIView(Animation) performWithoutAnimation:]
9   UIKitCore                          0x4b320401b9b5918c -[UIViewController _dismissViewControllerWithTransition:from:completion:]
10  UIKitCore                          0xd7500581b9b5884c -[UIViewController dismissViewControllerWithTransition:completion:]
11  UIKitCore                          0x6b0ac681b9b58270 -[UIViewController _performCoordinatedPresentOrDismiss:animated:]
12  UIKitCore                          0x6b5db601b9b5aaf0 -[UIViewController dismissViewControllerAnimated:completion:]
13  UIKitCore                          0x3f567201ba1c29f8 __68-[UIWindow _removeAllViewControllersFromWindowHierarchyFromDealloc:]_block_invoke
14  UIKitCore                          0xb3514901b9b52500 +[UIViewController _performWithoutDeferringTransitionsAllowingAnimation:actions:]
15  UIKitCore                          0x73218901ba1c2678 -[UIWindow _removeAllViewControllersFromWindowHierarchyFromDealloc:]
16  UIKitCore                          0x8d0d3701ba1c2bb4 -[UIWindow setRootViewController:]
17  UnityFramework                     0xe136b501028134dc GC_init_time
18  UnityFramework                     0x0000000102814324 -[UnityAppController applicationWillTerminate:] (UnityAppController.mm:480)
19  UIKitCore                          0x00000001ba18ebc0 -[UIApplication _terminateWithStatus:]
20  UIKitCore                          0x0e6d3381b99202d0 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]
21  UIKitCore                          0x69214481b991ff2c -[_UISceneLifecycleMultiplexer forceExitWithTransitionContext:scene:]
22  UIKitCore                          0x004bb281ba184dd4 -[UIApplication workspaceShouldExit:withTransitionContext:]
23  FrontBoardServices                 0x216b9881bb27698c -[FBSUIApplicationWorkspaceShim workspaceShouldExit:withTransitionContext:]
24  FrontBoardServices                 0xcd2ff381bb2a4264 __83-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:withAcknowledgement:]_block_invoke_2
25  FrontBoardServices                 0xbf592a81bb288ef4 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:]
26  FrontBoardServices                 0x2d166b81bb2a41f0 __83-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:withAcknowledgement:]_block_invoke
27  libdispatch.dylib                  0xe95e5881b5d2dfd8 _dispatch_client_callout
28  libdispatch.dylib                  0x8e7e4301b5d30d1c _dispatch_block_invoke_direct
29  FrontBoardServices                 0x78619c01bb2cb254 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__
30  FrontBoardServices                 0xcf5ef201bb2caf00 -[FBSSerialQueue _queue_performNextIfPossible]
31  FrontBoardServices                 0x0d781d01bb2cb46c -[FBSSerialQueue _performNextFromRunLoopSource]
32  CoreFoundation                     0xaf17bf81b6004108 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
33  CoreFoundation                     0x590e5881b600405c __CFRunLoopDoSource0
34  CoreFoundation                     0xb5510c01b6003818 __CFRunLoopDoSources0
35  CoreFoundation                     0xab1a2b81b5ffe694 __CFRunLoopRun
36  CoreFoundation                     0xbb4abf81b5ffdf40 CFRunLoopRunSpecific
37  GraphicsServices                   0xd009c901c028e534 GSEventRunModal
38  UIKitCore                          0x03169381ba189580 UIApplicationMain
39  UnityFramework                     0xfd75b601028187fc GC_init_time
40  WordSearch                         0x0000000100f4be1c main (main.mm:28)
41  libdyld.dylib                      0x00000001b5e7ce18 start

I don’t know why the stack trace doesn’t appear in the post above, here it is:

We also have another huge amount of crashes that may be related (again dealing with screen measurements) with this stack trace:

We’re experiencing countless of crashes with this as well, did you manage to find a solution?

ohffs apple! both stacktraces are coming from ios poking unity view/viewcontroller upon exit (sure enough it is close to impossible to catch by chance as they are usually dependent on ios version, device, showing presentation controller (ads), etc.
the one about ViewInf:eyes:nDisplayCutoutsChanged - was fixed very recently (not yet released)
UnityGetDeferSystemGesturesTopEdge - i see for the first time - can you please file a bug report (stacktrace would be enough)

We are seeing these crashes as well. iOS 13.4.1 - 13.5.1

Native StackTrace:

Thread 0 (crashed)
0   UnityFramework                     0x00000001066d2d5c IOSScripting::GetDeferSystemGesturesMode() (PlayerSettings.h:0)
1   UnityFramework                     0x0000000106894354 UnityGetDeferSystemGesturesTopEdge (TrampolineGlue.mm:52)
2   UnityFramework                     0x000000010601f854 -[UnityViewControllerBase(iOS) preferredScreenEdgesDeferringSystemGestures] (UnityViewControllerBase+iOS.mm:62)
3   UIKitCore                          0x00000001c45098dc <system symbols missing>
4   UIKitCore                          0x00000001c4736c84 <system symbols missing>
5   UIKitCore                          0x00000001c4717764 <system symbols missing>
6   UIKitCore                          0x00000001c47368cc <system symbols missing>
7   UIKitCore                          0x00000001c472d0b0 <system symbols missing>
8   UIKitCore                          0x00000001c52031cc <system symbols missing>
9   UIKitCore                          0x00000001c472cd24 <system symbols missing>
10  UIKitCore                          0x00000001c472c3fc <system symbols missing>
11  UIKitCore                          0x00000001c472be64 <system symbols missing>
12  UIKitCore                          0x00000001c472e56c <system symbols missing>
13  UIKitCore                          0x00000001c4d94bb0 <system symbols missing>
14  UIKitCore                          0x00000001c4726320 <system symbols missing>
15  UIKitCore                          0x00000001c4d94850 <system symbols missing>
16  UIKitCore                          0x00000001c4d94d5c <system symbols missing>
17  UnityFramework                     0x0000000106014880 UnityCleanupTrampoline (UnityAppController.mm:174)
18  UnityFramework                     0x00000001060156c8 -[UnityAppController applicationWillTerminate:] (UnityAppController.mm:486)
19  UIKitCore                          0x00000001c4d61a04 <system symbols missing>
20  UIKitCore                          0x00000001c44ff218 <system symbols missing>
21  UIKitCore                          0x00000001c44feea0 <system symbols missing>
22  UIKitCore                          0x00000001c4d57ba4 <system symbols missing>
23  FrontBoardServices                 0x00000001c5e258a0 <system symbols missing>
24  FrontBoardServices                 0x00000001c5e509bc <system symbols missing>
25  FrontBoardServices                 0x00000001c5e36bfc <system symbols missing>
26  FrontBoardServices                 0x00000001c5e5094c <system symbols missing>
27  libdispatch.dylib                  0x00000001c097b524 <system symbols missing>
28  libdispatch.dylib                  0x00000001c0955808 <system symbols missing>
29  FrontBoardServices                 0x00000001c5e75850 <system symbols missing>
30  FrontBoardServices                 0x00000001c5e7551c <system symbols missing>
31  FrontBoardServices                 0x00000001c5e75a44 <system symbols missing>
32  CoreFoundation                     0x00000001c0c33c18 <system symbols missing>
33  CoreFoundation                     0x00000001c0c33b70 <system symbols missing>
34  CoreFoundation                     0x00000001c0c332f8 <system symbols missing>
35  CoreFoundation                     0x00000001c0c2e328 <system symbols missing>
36  CoreFoundation                     0x00000001c0c2dce8 <system symbols missing>
37  GraphicsServices                   0x00000001cad7838c <system symbols missing>
38  UIKitCore                          0x00000001c4d5c444 <system symbols missing>
39  UnityFramework                     0x0000000106019b94 -[UnityFramework runUIApplicationMainWithArgc:argv:] (main.mm:96)
40  interstellarplutocracy             0x0000000102c5fe1c main (main.mm:28)
41  libdyld.dylib                      0x00000001c0ab58f0 <system symbols missing>

Same here, we’re observing countless crash reports!

As a workaround we update the preferredScreenEdgesDeferringSystemGestures in
UnityViewControllerBase+iOS.mm with a PostProcessBuild method. After that we experience crashes with prefersHomeIndicatorAutoHidden which we also updated.

Thread 0 (crashed)
0   UnityFramework                     0x00000001066e7934 IOSScripting::GetHideHomeButton() (PlayerSettings.h:0)
1   UnityFramework                     0x00000001068a9144 UnityGetHideHomeButton (TrampolineGlue.mm:72)
2   UnityFramework                     0x0000000106034324 -[UnityViewControllerBase(iOS) prefersHomeIndicatorAutoHidden] (UnityViewControllerBase+iOS.mm:66)
3   UIKitCore                          0x000000019273171c <system symbols missing>
4   UIKitCore                          0x000000019295ee10 <system symbols missing>
5   UIKitCore                          0x000000019293f764 <system symbols missing>
6   UIKitCore                          0x000000019295e8dc <system symbols missing>
7   UIKitCore                          0x00000001929550b0 <system symbols missing>
8   UIKitCore                          0x000000019342b1cc <system symbols missing>
9   UIKitCore                          0x0000000192954d24 <system symbols missing>
10  UIKitCore                          0x00000001929543fc <system symbols missing>
11  UIKitCore                          0x0000000192953e64 <system symbols missing>
12  UIKitCore                          0x000000019295656c <system symbols missing>
13  UIKitCore                          0x0000000192fbcbb0 <system symbols missing>
14  UIKitCore                          0x000000019294e320 <system symbols missing>
15  UIKitCore                          0x0000000192fbc850 <system symbols missing>
16  UIKitCore                          0x0000000192fbcd5c <system symbols missing>
17  UnityFramework                     0x0000000106029330 UnityCleanupTrampoline (UnityAppController.mm:174)
18  UnityFramework                     0x000000010602a1d0 -[UnityAppController applicationWillTerminate:] (UnityAppController.mm:493)
19  UIKitCore                          0x0000000192f89a04 <system symbols missing>
20  UIKitCore                          0x0000000192727218 <system symbols missing>
21  UIKitCore                          0x0000000192726ea0 <system symbols missing>
22  UIKitCore                          0x0000000192f7fba4 <system symbols missing>
23  FrontBoardServices                 0x000000019404d8a0 <system symbols missing>
24  FrontBoardServices                 0x00000001940789bc <system symbols missing>
25  FrontBoardServices                 0x000000019405ebfc <system symbols missing>
26  FrontBoardServices                 0x000000019407894c <system symbols missing>
27  libdispatch.dylib                  0x000000018eba3524 <system symbols missing>
28  libdispatch.dylib                  0x000000018eb7d808 <system symbols missing>
29  FrontBoardServices                 0x000000019409d850 <system symbols missing>
30  FrontBoardServices                 0x000000019409d51c <system symbols missing>
31  FrontBoardServices                 0x000000019409da44 <system symbols missing>
32  CoreFoundation                     0x000000018ee5bc18 <system symbols missing>
33  CoreFoundation                     0x000000018ee5bb70 <system symbols missing>
34  CoreFoundation                     0x000000018ee5b2f8 <system symbols missing>
35  CoreFoundation                     0x000000018ee56328 <system symbols missing>
36  CoreFoundation                     0x000000018ee55ce8 <system symbols missing>
37  GraphicsServices                   0x0000000198fa038c <system symbols missing>
38  UIKitCore                          0x0000000192f84444 <system symbols missing>
39  UnityFramework                     0x000000010602e660 -[UnityFramework runUIApplicationMainWithArgc:argv:] (main.mm:96)
40  interstellarplutocracy             0x00000001042e3e1c main (main.mm:28)
41  libdyld.dylib                      0x000000018ecdd8f0 <system symbols missing>

We also upgraded to Unity 2019.4.1

i did a fix for both IOSScripting::GetHideHomeButton() and IOSScripting::GetDeferSystemGesturesMode() crashes (can i whine that i didnt see the bugs reported?) and it should trickle down to LTS versions soonish

1 Like

@Alexey I’m getting the bug mentioned earlier where you get crash on exit in ViewInfo OnDisplayCutoutsChanged

…this is with the latest LTS, Unity2019.3.4, so I’m guessing the fix still hasn’t been released?

Can we get a bug number/link, so we can know which release has the fix if it’s still pending?

Also, AFAICT, there is no patch release of 2019 LTS with this fix?

this is with the latest LTS, Unity2019.3.4, so I’m guessing the fix still hasn’t been released?
it landed week ago, so yes, most likely not yet released
it should be out with 2019.4.5f1

1 Like

Hi all!

So is this issue related to iOS API breaking change?