Bug 148685 - [iOS8/9] WKProcess crashes leaving WKWebView instance blank
Summary: [iOS8/9] WKProcess crashes leaving WKWebView instance blank
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: Other
Hardware: iPhone / iPad iOS 8.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-01 12:13 PDT by Stephan Leroux
Modified: 2023-01-27 12:43 PST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Leroux 2015-09-01 12:13:59 PDT
Hey WebKit team,

I've been combing through the issues on here to see if this issue I'm seeing manifests itself in one of the bugs already filed but couldn't find an exact mapping so I figured I would post what I'm seeing and maybe get some help as to what the cause could be related to and a potential workaround.

Our app creates a WKWebView for each 'tab' a user has open where each contains a url and content the user has navigated to. After the app has sat in the background for ~1 hour, when the user returns to the app, there is a chance that one of the WKWebViews becomes blank and the url is gone with no way to recover. Some research has concluded that the WKProcess probably gets terminated in some way and the UIProcess WKWebView instance can't recover from it which leaves our WKWebView in this blank state. I've created a sample project and attached a more formal STR:

Sample project: https://github.com/sleroux/WKWebViewTest

STR:

1. Launch sample app
2. Navigate to any url for each of the segmented WKWebViews
3. Leave the app in the background for >= 1 hour
4. Return to the app

Expected:

WKWebView content should reload and display previously shown content

Actual:

WKWebView blanks out content and it's URL becomes nil with no way to recover

Notes:

1. Strangely, we've only been able to reproduce this on our TestFlight builds but not our distribution/enterprise or dev builds. The only thing I could think of that would be different is the difference in permissions between a TestFlight/App Store app and a dev/Ad Hoc build
2. Not sure if it's a coincidence but this seems to happen more frequently on older devices (5/5s) than newer ones (6/6+)

Lastly, we've tried some workarounds to this issue but haven't found anything that sticks. Additional discussion regarding the workarounds and this bug can be found here: https://bugzilla.mozilla.org/show_bug.cgi?id=1194726

Thanks for the help in advance! We'd really love to at least find a workaround for this.
Comment 1 Stefan Arentz 2015-09-04 18:45:17 PDT
More people struggling with this: http://stackoverflow.com/questions/31994919/how-to-determine-why-wkwebview-is-crashing