Title: [288259] releases/WebKitGTK/webkit-2.34
- Revision
- 288259
- Author
- [email protected]
- Date
- 2022-01-19 17:34:57 -0800 (Wed, 19 Jan 2022)
Log Message
Merge r285877 - Crash under WebKit::WebPageProxy::commitProvisionalPage()
https://bugs.webkit.org/show_bug.cgi?id=233199
<rdar://57659921>
Reviewed by Youenn Fablet.
Source/WebKit:
In the event where the committed WebProcess would crash while a cross-site provisional load
is going on in a provisional page / WebProcess, we would do a null dereference of the page's
drawing area when trying to commit the provisional page later on. We would also hit various
assertions in debug since the page's state gets completely reset when its WebProcess crashes.
To address the issue, we now clear the provisional page if the page's WebProcess crashes.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetStateAfterProcessExited):
Tools:
Add API test coverage.
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.34/Source/WebKit/ChangeLog (288258 => 288259)
--- releases/WebKitGTK/webkit-2.34/Source/WebKit/ChangeLog 2022-01-20 01:27:25 UTC (rev 288258)
+++ releases/WebKitGTK/webkit-2.34/Source/WebKit/ChangeLog 2022-01-20 01:34:57 UTC (rev 288259)
@@ -1,3 +1,21 @@
+2021-11-16 Chris Dumez <[email protected]>
+
+ Crash under WebKit::WebPageProxy::commitProvisionalPage()
+ https://bugs.webkit.org/show_bug.cgi?id=233199
+ <rdar://57659921>
+
+ Reviewed by Youenn Fablet.
+
+ In the event where the committed WebProcess would crash while a cross-site provisional load
+ is going on in a provisional page / WebProcess, we would do a null dereference of the page's
+ drawing area when trying to commit the provisional page later on. We would also hit various
+ assertions in debug since the page's state gets completely reset when its WebProcess crashes.
+
+ To address the issue, we now clear the provisional page if the page's WebProcess crashes.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::resetStateAfterProcessExited):
+
2021-09-29 Chris Dumez <[email protected]>
[ iOS Debug ] http/tests/xmlhttprequest/access-control-preflight-credential-sync.html is a flaky crash
Modified: releases/WebKitGTK/webkit-2.34/Source/WebKit/UIProcess/WebPageProxy.cpp (288258 => 288259)
--- releases/WebKitGTK/webkit-2.34/Source/WebKit/UIProcess/WebPageProxy.cpp 2022-01-20 01:27:25 UTC (rev 288258)
+++ releases/WebKitGTK/webkit-2.34/Source/WebKit/UIProcess/WebPageProxy.cpp 2022-01-20 01:34:57 UTC (rev 288259)
@@ -7966,6 +7966,9 @@
m_editorState = EditorState();
m_cachedFontAttributesAtSelectionStart.reset();
+ if (terminationReason != ProcessTerminationReason::NavigationSwap)
+ m_provisionalPage = nullptr;
+
if (terminationReason == ProcessTerminationReason::NavigationSwap)
pageClient().processWillSwap();
else
Modified: releases/WebKitGTK/webkit-2.34/Tools/ChangeLog (288258 => 288259)
--- releases/WebKitGTK/webkit-2.34/Tools/ChangeLog 2022-01-20 01:27:25 UTC (rev 288258)
+++ releases/WebKitGTK/webkit-2.34/Tools/ChangeLog 2022-01-20 01:34:57 UTC (rev 288259)
@@ -1,3 +1,15 @@
+2021-11-16 Chris Dumez <[email protected]>
+
+ Crash under WebKit::WebPageProxy::commitProvisionalPage()
+ https://bugs.webkit.org/show_bug.cgi?id=233199
+ <rdar://57659921>
+
+ Reviewed by Youenn Fablet.
+
+ Add API test coverage.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+
2022-01-15 Frédéric Wang <[email protected]>
Bug 234910 - jsc_fuz/wktr: crash with exotic settings
Modified: releases/WebKitGTK/webkit-2.34/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm (288258 => 288259)
--- releases/WebKitGTK/webkit-2.34/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm 2022-01-20 01:27:25 UTC (rev 288258)
+++ releases/WebKitGTK/webkit-2.34/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm 2022-01-20 01:34:57 UTC (rev 288259)
@@ -5484,6 +5484,48 @@
EXPECT_NE(pid3, pid4);
}
+TEST(ProcessSwap, CommittedProcessCrashDuringCrossSiteNavigation)
+{
+ auto processPoolConfiguration = psonProcessPoolConfiguration();
+ auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]);
+
+ auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
+ [webViewConfiguration setProcessPool:processPool.get()];
+ auto handler = adoptNS([[PSONScheme alloc] init]);
+ [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"PSON"];
+
+ auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]);
+ auto navigationDelegate = adoptNS([[PSONNavigationDelegate alloc] init]);
+ [webView setNavigationDelegate:navigationDelegate.get()];
+
+ done = false;
+ NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]];
+ [webView loadRequest:request];
+
+ TestWebKitAPI::Util::run(&done);
+ done = false;
+
+ auto pid1 = [webView _webProcessIdentifier];
+
+ static bool didKill = false;
+ navigationDelegate->decidePolicyForNavigationAction = ^(WKNavigationAction *, void (^decisionHandler)(WKNavigationActionPolicy)) {
+ decisionHandler(WKNavigationActionPolicyAllow); // Will ask the load to proceed in a new provisional WebProcess since the navigation is cross-site.
+
+ // Simulate a crash of the committed WebProcess while the provisional navigation starts in the new provisional WebProcess.
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
+ kill(pid1, 9);
+ didKill = true;
+ });
+ };
+
+ request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.apple.com/main.html"]];
+ [webView loadRequest:request];
+
+ TestWebKitAPI::Util::run(&didKill);
+
+ TestWebKitAPI::Util::sleep(0.5);
+}
+
TEST(ProcessSwap, NavigateBackAndForth)
{
auto processPoolConfiguration = psonProcessPoolConfiguration();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes