Changeset 249690 in webkit
- Timestamp:
- Sep 9, 2019, 8:19:35 PM (7 years ago)
- Location:
- branches/safari-608-branch/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/API/Cocoa/WKWebView.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-608-branch/Source/WebKit/ChangeLog
r249550 r249690 1 2019-09-09 Kocsen Chung <kocsen_chung@apple.com> 2 3 Cherry-pick r249444. rdar://problem/55093558 4 5 Null deref under -[WKWebView _addUpdateVisibleContentRectPreCommitHandler]'s handler block 6 https://bugs.webkit.org/show_bug.cgi?id=201436 7 <rdar://problem/40640475> 8 9 Reviewed by Simon Fraser. 10 11 * UIProcess/API/Cocoa/WKWebView.mm: 12 (-[WKWebView dealloc]): 13 (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]): 14 We crash sending a message to a deallocated WKWebView inside the handler block 15 passed to +[CATransaction addCommitHandler:]. This seems impossible, because 16 we carefully retain it, but it's possible that it could be the result of 17 the handler block being installed under -dealloc (in which case retaining 18 the WKWebView wouldn't actually extend its lifetime). -[WKWebView dealloc] 19 is fairly sizable, and it's hard to follow all paths from it, so instead 20 add a RELEASE_LOG_FAULT, so we'll get simulated crash logs, and bail, 21 so we'll stop actually crashing (if this is the cause). 22 23 This is just a speculative fix, but a hopeful one, since intentionally calling 24 -_addUpdateVisibleContentRectPreCommitHandler: from dealloc yields a similar-looking 25 crash under the handler block. 26 27 28 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249444 268f45cc-cd09-0410-ab3c-d52691b4dbfc 29 30 2019-09-03 Tim Horton <timothy_horton@apple.com> 31 32 Null deref under -[WKWebView _addUpdateVisibleContentRectPreCommitHandler]'s handler block 33 https://bugs.webkit.org/show_bug.cgi?id=201436 34 <rdar://problem/40640475> 35 36 Reviewed by Simon Fraser. 37 38 * UIProcess/API/Cocoa/WKWebView.mm: 39 (-[WKWebView dealloc]): 40 (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]): 41 We crash sending a message to a deallocated WKWebView inside the handler block 42 passed to +[CATransaction addCommitHandler:]. This seems impossible, because 43 we carefully retain it, but it's possible that it could be the result of 44 the handler block being installed under -dealloc (in which case retaining 45 the WKWebView wouldn't actually extend its lifetime). -[WKWebView dealloc] 46 is fairly sizable, and it's hard to follow all paths from it, so instead 47 add a RELEASE_LOG_FAULT, so we'll get simulated crash logs, and bail, 48 so we'll stop actually crashing (if this is the cause). 49 50 This is just a speculative fix, but a hopeful one, since intentionally calling 51 -_addUpdateVisibleContentRectPreCommitHandler: from dealloc yields a similar-looking 52 crash under the handler block. 53 1 54 2019-09-05 Kocsen Chung <kocsen_chung@apple.com> 2 55 -
branches/safari-608-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r249475 r249690 375 375 NSUInteger _focusPreservationCount; 376 376 NSUInteger _activeFocusedStateRetainCount; 377 378 BOOL _hasEnteredDealloc; 377 379 #endif 378 380 #if PLATFORM(MAC) … … 875 877 876 878 #if PLATFORM(IOS_FAMILY) 879 _hasEnteredDealloc = YES; 880 877 881 [_contentView _webViewDestroyed]; 878 882 … … 3012 3016 - (void)_addUpdateVisibleContentRectPreCommitHandler 3013 3017 { 3018 if (_hasEnteredDealloc) { 3019 RELEASE_LOG_FAULT(ViewState, "-[WKWebView %p _addUpdateVisibleContentRectPreCommitHandler]: Attempted to add pre-commit handler under -dealloc. Bailing.", self); 3020 return; 3021 } 3022 3014 3023 auto retainedSelf = retainPtr(self); 3015 3024 [CATransaction addCommitHandler:[retainedSelf] {
Note:
See TracChangeset
for help on using the changeset viewer.