Changeset 249444 in webkit
- Timestamp:
- Sep 3, 2019 4:21:38 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r249436 r249444 1 2019-09-03 Tim Horton <timothy_horton@apple.com> 2 3 Null deref under -[WKWebView _addUpdateVisibleContentRectPreCommitHandler]'s handler block 4 https://bugs.webkit.org/show_bug.cgi?id=201436 5 <rdar://problem/40640475> 6 7 Reviewed by Simon Fraser. 8 9 * UIProcess/API/Cocoa/WKWebView.mm: 10 (-[WKWebView dealloc]): 11 (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]): 12 We crash sending a message to a deallocated WKWebView inside the handler block 13 passed to +[CATransaction addCommitHandler:]. This seems impossible, because 14 we carefully retain it, but it's possible that it could be the result of 15 the handler block being installed under -dealloc (in which case retaining 16 the WKWebView wouldn't actually extend its lifetime). -[WKWebView dealloc] 17 is fairly sizable, and it's hard to follow all paths from it, so instead 18 add a RELEASE_LOG_FAULT, so we'll get simulated crash logs, and bail, 19 so we'll stop actually crashing (if this is the cause). 20 21 This is just a speculative fix, but a hopeful one, since intentionally calling 22 -_addUpdateVisibleContentRectPreCommitHandler: from dealloc yields a similar-looking 23 crash under the handler block. 24 1 25 2019-09-03 Jiewen Tan <jiewen_tan@apple.com> 2 26 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r249368 r249444 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.