Bug 141538 - WKActionSheetAssistant crashes with a Bad Access when the view it's initialized with is no longer in memory
Summary: WKActionSheetAssistant crashes with a Bad Access when the view it's initializ...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: iPhone / iPad iOS 8.1
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-02-12 14:38 PST by McLaren Stanley
Modified: 2022-02-11 14:45 PST (History)
4 users (show)

See Also:


Attachments
This Sample App shows one way this bug manifests (36.62 KB, application/zip)
2015-02-12 14:38 PST, McLaren Stanley
no flags Details
Production crash log. (2.96 KB, application/octet-stream)
2015-02-12 14:47 PST, McLaren Stanley
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description McLaren Stanley 2015-02-12 14:38:01 PST
Created attachment 246475 [details]
This Sample App shows one way this bug manifests

Overview:
 WKActionSheetAssistent.mm holds an unsafe pointer to a UIView called "_view".
 However since WKActionSheet.mm is retained by the window's rootViewController and it's
 UIAlertActions retain the WKActionSheetAssistent.mm, the assistent can easily outlive
 the _view it's pointing to. As a result this example will crash with a BAD ACCESS. The most
 common stack trace that that exposes this issue for us is via the "willRotate" method on WKActionSheet.mm.

 I will attach a crash log with that particular trace along with the bug that I file.

 For the record, we don't dump the webview on a memory warning in our production app, but the views that
 are being deallococated in the real app are internal subviews of WKWebView that we can't access, (not necessarily
 memory pressure)

Reproduction Steps:
 1. Run the attached sample app
 2. Long-press the web link
 3. Leave ActionSheet open
 4. Send App Memory Warning
 5. Close ActionSheet

Actual Result:
 The App Crashes with Bad Access

Expected Result:
 The App shouldn't crash

Platform: 
 iOS 8.1.3
Comment 1 McLaren Stanley 2015-02-12 14:47:19 PST
Created attachment 246477 [details]
Production crash log.
Comment 2 Radar WebKit Bug Importer 2015-02-13 12:07:35 PST
<rdar://problem/19830665>