iOS 9b4 (13A4305g): iOS hangs indefinitely when a UITextView with strange frame gets layouted
| Originator: | raise.rescue | ||
| Number: | rdar://22029215 | Date Originated: | 28-Jul-2015 03:02 PM |
| Status: | Open | Resolved: | |
| Product: | iOS | Product Version: | iOS 9b4 13A4305g |
| Classification: | Crash/Hang/Data Loss | Reproducible: | Always |
Summary: iOS hangs indefinitely when a UITextView with strange frame gets layouted and also allocates indefinitely memory. I’m not sure how our app creates a UITextView with such a frame and i will definitely fix it in our app - although, as nobody can guarantee that all apps in the world will never create such a frame, and it leaves to a rather bad behaviour overall (the app will eat up all memory until it is killed and though iOS might kill some other apps before that happens, the app does no longer respond to user-input and the app-developer can’t catch that case), i think this is a quite critical issue. Steps to Reproduce: 1. Open the attached project 2. Start it on an iOS 9 device or the simulator (works for me on the default iPad 2 / iPad Air / iPad Air 2 and iPad Retina simulator) 3. Nothing should happen in the app - especially, the background of the app will stay white and not turn red If it did turn red, please retry (although it always worked for me so far). Please note that it consumes more and more memory, so don’t leave it open while grabbing a coffee or so. I also recorded a few seconds of the CPU-Usage and Allocations with instruments and added it to the project-folder. Expected Results: Adding a UITextView with a strange frame to the view-hierarchy should at worst show a crippled UITextView. Actual Results: The app hangs and consumes as much memory as it can. Regression: Describe circumstances where the problem occurs or does not occur, such as software versions and/or hardware configurations. Notes: Provide additional information, such as references to related problems, workarounds and relevant attachments.
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!
From my tests it happens due to text length less than 10 characters
Here's a link to a stackoverflow post: http://stackoverflow.com/questions/32611789/uitextview-with-text-less-than-10-characters-hangs-ios-9/32629735#32629735
And a github project that reproduces the issue: https://github.com/7mllm7/UITextViewTenCharsBug
Do you see a similarity?
I uploaded the example-project to https://github.com/Sipeso/UITextViewWithStrangeFrameBug