iOS 17.5.1 only: STWebpageController loadView crash due to NSInternalInconsistencyException

Hi there,

We recently released our app and got one production crash that can not be reproduced by our developers.

It happens only on iOS 17.5.1 and the crash seems to be related to STWebpageController init at app start. The crash number is increasing fast but we have no idea about why it happens.

Please help us to check the crash report below:

Role:                Foreground
OS Version:          iPhone OS 17.5.1 (21F90)

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: SIGNAL 6 Abort trap: 6

Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                	0x1a29fcf20 __exceptionPreprocess + 164 (NSException.m:249)
1   APP_NAME                  	0x105e9e344 crashpad::(anonymous namespace)::HANDLE_UNCAUGHT_NSEXCEPTION(objc_object*, char const*) + 700 (exception_processor.mm:306)
2   APP_NAME                  	0x105e9d640 crashpad::(anonymous namespace)::ObjcExceptionPreprocessor(objc_object*) + 2544 (exception_processor.mm:513)
3   libobjc.A.dylib               	0x19a8a6018 objc_exception_throw + 60 (objc-exception.mm:356)
4   Foundation                    	0x1a1f03868 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 188 (NSException.m:252)
5   ScreenTime                    	0x226860b2c __31-[STWebpageController loadView]_block_invoke + 448 (STWebpageController.m:140)
6   UIKitCore                     	0x1a55ae418 __146-[NSExtension(UIViewControllerAdditions) _instantiateViewControllerWithInputItems:asAccessory:traitCollection:listenerEndpoint:connectionHandler:]_block_invoke.29 + 268 (NSExtension_UIKitAdditions.m:96)
7   libdispatch.dylib             	0x1aa8a013c _dispatch_call_block_and_release + 32 (init.c:1530)
8   libdispatch.dylib             	0x1aa8a1dd4 _dispatch_client_callout + 20 (object.m:576)
9   libdispatch.dylib             	0x1aa8b05a4 _dispatch_main_queue_drain + 988 (queue.c:7898)
10  libdispatch.dylib             	0x1aa8b01b8 _dispatch_main_queue_callback_4CF + 44 (queue.c:8058)
11  CoreFoundation                	0x1a29cf710 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1780)
12  CoreFoundation                	0x1a29cc914 __CFRunLoopRun + 1996 (CFRunLoop.c:3149)
13  CoreFoundation                	0x1a29cbcd8 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
14  GraphicsServices              	0x1e787c1a8 GSEventRunModal + 164 (GSEvent.c:2196)
15  UIKitCore                     	0x1a500490c -[UIApplication _run] + 888 (UIApplication.m:3713)
16  UIKitCore                     	0x1a50b89d0 UIApplicationMain + 340 (UIApplication.m:5303)
17  APP_NAME                  	0x104dbc5c0 AppMain + 444 (app_exe_main.mm:128)
18  APP_NAME                  	0x104dbc630 main + 12 (app_exe_main.mm:135)
19  dyld                          	0x1c607de4c start + 2240 (dyldMain.cpp:1298)

Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x00000001ebab742c __pthread_kill + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001ff856c0c pthread_kill + 268 (pthread.c:1721)
2   libsystem_c.dylib             	0x00000001aa95aba0 abort + 180 (abort.c:118)
3   libc++abi.dylib               	0x00000001ff774ca4 abort_message + 132 (abort_message.cpp:78)
4   libc++abi.dylib               	0x00000001ff764e5c demangling_terminate_handler() + 348 (cxa_default_handlers.cpp:77)
5   libobjc.A.dylib               	0x000000019a8c1e2c _objc_terminate() + 144 (objc-exception.mm:496)
6   ourSdk                        	0x0000000108d8bc40 FIRCLSTerminateHandler() + 500 (FIRCLSException.mm:0)
7   libc++abi.dylib               	0x00000001ff774068 std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:59)
8   libc++abi.dylib               	0x00000001ff77400c std::terminate() + 108 (cxa_handlers.cpp:88)
9   libdispatch.dylib             	0x00000001aa8a1de8 _dispatch_client_callout + 40 (object.m:579)
10  libdispatch.dylib             	0x00000001aa8b05a4 _dispatch_main_queue_drain + 988 (queue.c:7898)
11  libdispatch.dylib             	0x00000001aa8b01b8 _dispatch_main_queue_callback_4CF + 44 (queue.c:8058)
12  CoreFoundation                	0x00000001a29cf710 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1780)
13  CoreFoundation                	0x00000001a29cc914 __CFRunLoopRun + 1996 (CFRunLoop.c:3149)
14  CoreFoundation                	0x00000001a29cbcd8 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
15  GraphicsServices              	0x00000001e787c1a8 GSEventRunModal + 164 (GSEvent.c:2196)
16  UIKitCore                     	0x00000001a500490c -[UIApplication _run] + 888 (UIApplication.m:3713)
17  UIKitCore                     	0x00000001a50b89d0 UIApplicationMain + 340 (UIApplication.m:5303)
18  APP_NAME                  	0x0000000104dbc5c0 AppMain + 444 (app_exe_main.mm:128)
19  APP_NAME                  	0x0000000104dbc630 main + 12 (app_exe_main.mm:135)
20  dyld                          	0x00000001c607de4c start + 2240 (dyldMain.cpp:1298)

As the crash number increases, We found 1 crash on iOS 15.8.2 and a few on iOS 17.4.1. But 93% are still happening on iOS 17.5.1.

iOS 17.5.1 only: STWebpageController loadView crash due to NSInternalInconsistencyException
 
 
Q