Since iPadOS 26 we have been seeing a crash inside the system keyboard. It happens while the system keyboard renders key images. Our code is not on the crashing stack.
Crash
The app is terminated by an uncaught NSInvalidArgumentException. The NSXPC encoder fails to allocate a very large buffer while a keyboard image cache item is being encoded:
NSInvalidArgumentException: *** NSAllocateMemoryPages(60003072) failedRequested sizes seen across reports: 60,003,072 / 60,558,656 / 78,724,160 / 240,001,920 / 933,149,952 bytes.
Xcode Organizer groups these reports under the signature TextInput: -[TIImageCacheItem encodeWithCoder:] + 276. Relevant frames (main thread, simplified):
objc_exception_throw
NSAllocateMemoryPages
NSXPCEncoder (encoding)
-[TIImageCacheItem encodeWithCoder:] + 276 (TextInput)
TIDispatchSync
TIImageCacheClient
UIKeyboardCache
-[UIKBKeyView displayLayer:]
...
UIApplicationMainScope (about 3 months of data)
327 crashes from 43 users.
iPad only. iPadOS 26.1 – 26.7.1. No crashes on iPhone and none on iPadOS 18 or earlier.
No single iPadOS 26 minor version stands out.
The first occurrence did not line up with any release of our app. Our keyboard-related code did not change at that time.
Free memory at crash time ranges from 33 MB to 4.8 GB. Some crashes happen within 40 seconds of launch. This looks like an abnormally large encode request, not memory pressure or a leak in the app.
All affected users use the zh_CN locale.
Context
The screen has a plain UITextField, the standard system keyboard, and no custom inputView. It also has a UIIndirectScribbleInteraction for Apple Pencil handwriting.
The crash happens shortly after the keyboard appears. Breadcrumbs show UICompatibilityInputViewController, UISystemInputAssistantViewController and UIPredictionViewController being set up just before the crash.
Many crashes happen when the app window is not full screen (Split View / Stage Manager). For example, a 629.5 pt wide app window on a 1180 pt screen, or 936×954 on 1373×954. Some devices were rotating frequently.
In a few cases there was a rapid burst of multi-tap gestures about 20 ms apart just before the crash (Pencil/Scribble-like input).
What we tried
We could not reproduce it on our own iPads running iPadOS 26. Memory stays flat and there is no crash.
Questions
Is this a known issue in the iPadOS 26 keyboard image cache (TIImageCacheItem)?
Is there a recommended workaround on the app side, for example avoiding certain input view reloads or trait changes while the keyboard is visible?
1
0
25