iOS builtin-virtual-keyboards leak memory and crash the app

Originator:raise.rescue
Number:rdar://25217203 Date Originated:17-Mar-2016 04:38 PM
Status:Open Resolved:
Product:iOS Product Version:9.3b7
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
The virtual-keyboards leak memory, some of them more, some of them less. When they leaked too much, the app crashes due to low memory.

Steps to Reproduce:
1. Open the attached project
2. Perform it on an iPad, preferably on an iPad 3 (on Retina Devices it leaks more memory than on non-Retina devices, and the iPad 3 only has 512MB Ram) 
3. Tap on the textfield
4. To crash the app the fastest way, select the “Chinese (Simplified) - Handwriting”-keyboard. I didn’t try all the keyboards, Emoji seemed fine on the first look.
5. Rotate the iPad until it crashes

You may use the “testCrash”-UI-test that is contained inside the app that rotates the iPad constantly.
I also attached a screenshot of instruments, as the keyboard has eaten up 3GB inside our app until the App crashed.

Expected Results:
Virtual keyboards should not leak memory. It is fine that they cash their appearance once, but it is no ok that they don’t release old memory.

Actual Results:
Over the time, they eat more and more space until they may crash your app.

Regression:
-

Notes:
-

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!