UIWebView crashes when its background colour is a pattern
| Originator: | dj | ||
| Number: | rdar://10980261 | Date Originated: | 04-Mar-2012 02:25 PM |
| Status: | open | Resolved: | |
| Product: | iPhone/iPod Touch | Product Version: | iOS 5.0.1 (9A405) |
| Classification: | Crash | Reproducible: | Always |
Summary:
Setting certain pattern backgrounds on a UIWebView and then loading certain URLs seems to result in massive memory usage, resulting in a crash.
Steps to Reproduce:
1) Create a project that uses a UIWebView.
2) In the code or .xib, set the backgroundColor to [UIColor viewFlipsideBackgroundColor].
3) In the code, load the following URL into the UIWebView: http://pandodaily.com/2012/02/26/steve-jobs-was-right-dropbox-is-a-feature-not-a-product/
4) Build for the iPhone and run on the device.
Expected Results:
The page should load normally.
Actual Results:
The page loads, and then after a few second the whole app crashes.
Regression:
Tested on a 16GB iPhone 4 and on a 16GB iPhone 4S.
Notes:
For your convenience I have modified the TransWeb sample app to show the bug. Just build and run that project, after replacing MyViewController.m with the version uploaded.
>>>>>
- (void)viewDidLoad
{
webView.backgroundColor = [UIColor viewFlipsideBackgroundColor];
NSURLRequest *requestObject = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://pandodaily.com/2012/02/26/steve-jobs-was-right-dropbox-is-a-feature-not-a-product/"]];
// Also crashes when using the following URL:
// NSURLRequest *requestObject = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://venturebeat.com/2012/02/24/flickr-pinterest-pin/"]];
[webView loadRequest:requestObject];
}
<<<<<
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!
I have seen this same issue, but only on iPod touch 4th Gen (5.0.1), not iPhone 4S (5.0.1)
(Apple asked for a crash report: I responded)
It appears that iOS is jettisoning the app because it is using too much memory; I have enclosed a low memory log. Also, the main URL (http://pandodaily.com/2012/02/26/steve-jobs-was-right-dropbox-is-a-feature-not-a-product/) is jettisoned consistently only when run from the Xcode debugger. The alternative URL (http://venturebeat.com/2012/02/24/flickr-pinterest-pin/) is jettisoned even when launched directly from SpringBoard; I will upload the altered .m file later. BTW The low memory log is from compiling with the alternative URL for iOS 5.0 Debug for an iPhone 4 device, and launching from SpringBoard. >>>>> ... Free pages: 971 Wired pages: 15654 Purgeable pages: 72 Largest process: TransWeb Processes Name UUID Count resident pages ... TransWeb 78099 (jettisoned) (active)
...
<<<<<
>>>>>
- (void)viewDidLoad
{
webView.backgroundColor = [UIColor viewFlipsideBackgroundColor];
NSURLRequest *requestObject = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://pandodaily.com/2012/02/26/steve-jobs-was-right-dropbox-is-a-feature-not-a-product/"]];
// Also crashes when using the following URL:
// NSURLRequest *requestObject = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://venturebeat.com/2012/02/24/flickr-pinterest-pin/"]];
[webView loadRequest:requestObject];
}
<<<<<