1

One of my apps crashes only on iOS 14 real device (simulator works just fine) when UITextField is touched or becomeFirstResponder, even touch on UISearchBar text area result in a crash.

Only happens on the Real device (no simulator) Only happens with the OS keyboard. Tried Grammarly keyboard. It works fine. Build on Xcode 11.* versions also make the app crash on iOS14 devices Tried building the app with different computers. Did not work. Tried connecting an external keyboard. Did not work

The stack trace does not help. Finally, I was able to get this message printed on the console.

*** Assertion failure in -[UIKBCacheToken stringForConstruction:], UIKBCacheToken.m:204

The above message gets printed recursively.

The crash log below does not help either. I have tried symbolic breakpoints, All sorts of debugging techniques, and restarting the device, even resetting device setting, also tried creating a completely new view controller with one UITextField.

Exception Subtype: KERN_PROTECTION_FAILURE at 0x000000016d6a3ff0
VM Region Info: 0x16d6a3ff0 is in 0x16d6a0000-0x16d6a4000;  bytes after start: 16368  bytes before end: 15
      REGION TYPE                      START - END             [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      mapped file                   11b8b8000-11bb00000        [ 2336K] r--/r-- SM=PRV  ...ct_id=598bee3
      GAP OF 0x51ba0000 BYTES
--->  STACK GUARD                   16d6a0000-16d6a4000        [   16K] ---/rwx SM=NUL  ... for thread 0
      Stack                         16d6a4000-16d7a0000        [ 1008K] rw-/rwx SM=COW  thread 0

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [1013]
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_notify.dylib          0x0000000189b42b20 notify_check + 8
1   libsystem_c.dylib               0x00000001879cda78 notify_check_tz + 40
2   libsystem_c.dylib               0x00000001879cd61c tzsetwall_basic + 76
3   libsystem_c.dylib               0x00000001879cf640 localtime_r + 52
4   libsystem_trace.dylib           0x00000001879364c8 _os_activity_stream_reflect + 348
5   libsystem_trace.dylib           0x0000000187942530 _os_log_impl_stream + 456
6   libsystem_trace.dylib           0x0000000187942034 _os_log_impl_flatten_and_send + 7084
7   libsystem_trace.dylib           0x00000001879436f0 _os_log_with_args_impl + 388
8   CoreFoundation                  0x0000000187d4a2a8 _CFLogvEx3 + 188
9   Foundation                      0x000000018819e894 _NSLogv + 124
10  Foundation                      0x000000018819e8e4 NSLog + 56
11  Foundation                      0x00000001880e45ec -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 84
12  UIKitCore                       0x000000018c124a20 0x18b92e000 + 8350240
13  UIKitCore                       0x000000018c124aac 0x18b92e000 + 8350380
14  UIKitCore                       0x000000018c1250b0 0x18b92e000 + 8351920
15  CoreFoundation                  0x0000000187c6b93c -[NSObject+ 153916 (NSObject) _copyDescription] + 48
16  CoreFoundation                  0x0000000187d08ab0 __CFStringAppendFormatCore + 12640
17  CoreFoundation                  0x0000000187d09738 _CFStringCreateWithFormatAndArgumentsReturningMetadata + 164
18  CoreFoundation                  0x0000000187c706f4 +[NSException raise:format:arguments:] + 64
19  Foundation                      0x00000001880e461c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 132
20  UIKitCore                       0x000000018c124a20 0x18b92e000 + 8350240
21  UIKitCore                       0x000000018c124aac 0x18b92e000 + 8350380
22  UIKitCore                       0x000000018c1250b0 0x18b92e000 + 8351920
23  CoreFoundation                  0x0000000187c6b93c -[NSObject+ 153916 (NSObject) _copyDescription] + 48
24  CoreFoundation                  0x0000000187d08ab0 __CFStringAppendFormatCore + 12640
25  CoreFoundation                  0x0000000187d09738 _CFStringCreateWithFormatAndArgumentsReturningMetadata + 164
26  CoreFoundation                  0x0000000187c706f4 +[NSException raise:format:arguments:] + 64
27  Foundation                      0x00000001880e461c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 132
28  UIKitCore                       0x000000018c124a20 0x18b92e000 + 8350240
29  UIKitCore                       0x000000018c124aac 0x18b92e000 + 8350380
30  UIKitCore                       0x000000018c1250b0 0x18b92e000 + 8351920
31  CoreFoundation                  0x0000000187c6b93c -[NSObject+ 153916 (NSObject) _copyDescription] + 48
32  CoreFoundation                  0x0000000187d08ab0 __CFStringAppendFormatCore + 12640
33  CoreFoundation                  0x0000000187d09738 _CFStringCreateWithFormatAndArgumentsReturningMetadata + 164
34  CoreFoundation                  0x0000000187c706f4 +[NSException raise:format:arguments:] + 64
35  Foundation                      0x00000001880e461c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 132
36  UIKitCore                       0x000000018c124a20 0x18b92e000 + 8350240
37  UIKitCore                       0x000000018c124aac 0x18b92e000 + 8350380
38  UIKitCore                       0x000000018c1250b0 0x18b92e000 + 8351920
39  CoreFoundation                  0x0000000187c6b93c -[NSObject+ 153916 (NSObject) _copyDescription] + 48
40  CoreFoundation                  0x0000000187d08ab0 __CFStringAppendFormatCore + 12640
41  CoreFoundation                  0x0000000187d09738 _CFStringCreateWithFormatAndArgumentsReturningMetadata + 164
42  CoreFoundation                  0x0000000187c706f4 +[NSException raise:format:arguments:] + 64

enter image description here

Chamira Fernando
  • 6,836
  • 3
  • 23
  • 23
  • did u resolve the issue? – ZAFAR007 Nov 05 '20 at 12:59
  • Yes. back in the day to quick fix 32 to 64 transition I did something like this+ (NSNumber *)numberWithInt:(long)value { return [self numberWithInteger:value]; } which override some internal of the iOS keyboard cause the issues. after I removed it it work all goo. If you have same kind of issues it could be something thing like it. – Chamira Fernando Nov 06 '20 at 13:43

0 Answers0