WebKit Bugzilla
Attachment 346934 Details for
Bug 188479
: Crash under NetworkResourceLoader::convertToDownload()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188479-20180810153613.patch (text/plain), 8.36 KB, created by
Chris Dumez
on 2018-08-10 15:36:14 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-08-10 15:36:14 PDT
Size:
8.36 KB
patch
obsolete
>Subversion Revision: 234771 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 2dc95c44c961760ddedb03e5bed3b526e7fd9098..879ad8451ef588adfce07d7d7e22d8bcdb0f6819 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,18 @@ >+2018-08-10 Chris Dumez <cdumez@apple.com> >+ >+ Crash under NetworkResourceLoader::convertToDownload() >+ https://bugs.webkit.org/show_bug.cgi?id=188479 >+ <rdar://problem/42201724> >+ >+ Reviewed by Alex Christensen. >+ >+ In NetworkResourceLoader::convertToDownload(), if m_networkLoad is null then we're trying >+ to convert a load that came from the disk cache. Since we do not currently support converting >+ such a load, cancel the current load and start a fresh download. >+ >+ * NetworkProcess/NetworkResourceLoader.cpp: >+ (WebKit::NetworkResourceLoader::convertToDownload): >+ > 2018-08-10 Sihui Liu <sihui_liu@apple.com> > > Incorrect log message in NetworkSession when creating NetworkDataTask >diff --git a/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp b/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >index 77f898903e2d24d14df44b0f0c3cd87e6f3756e4..d97d0394c8480eea535e1c8e55480eafbe3b071f 100644 >--- a/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >@@ -337,7 +337,13 @@ void NetworkResourceLoader::cleanup(LoadResult result) > > void NetworkResourceLoader::convertToDownload(DownloadID downloadID, const ResourceRequest& request, const ResourceResponse& response) > { >- ASSERT(m_networkLoad); >+ // This can happen if the resource came from the disk cache. >+ if (!m_networkLoad) { >+ NetworkProcess::singleton().downloadManager().startDownload(m_connection.ptr(), m_parameters.sessionID, downloadID, request); >+ abort(); >+ return; >+ } >+ > NetworkProcess::singleton().downloadManager().convertNetworkLoadToDownload(downloadID, std::exchange(m_networkLoad, nullptr), WTFMove(m_fileReferences), request, response); > } > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 7fed73bf6ab1a0fa6cf139f6c4b6fba1f6742486..e730ade07acf3c2fd84cc5cce7d6f70455538938 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,19 @@ >+2018-08-10 Chris Dumez <cdumez@apple.com> >+ >+ Crash under NetworkResourceLoader::convertToDownload() >+ https://bugs.webkit.org/show_bug.cgi?id=188479 >+ <rdar://problem/42201724> >+ >+ Reviewed by Alex Christensen. >+ >+ Add layout test coverage which reproduces the crash by: >+ 1. Loading a cacheable plugin while plugins are enabled so that the plugin goes into the disk cache >+ 2. Load the plugin again with plugins disabled so that we try to convert the load to a download >+ >+ * http/tests/download/convert-cached-load-to-download-expected.txt: Added. >+ * http/tests/download/convert-cached-load-to-download.html: Added. >+ * http/tests/plugins/resources/mock-plugin-cacheable.pl: Added. >+ > 2018-08-10 Ross Kirsling <ross.kirsling@sony.com> > > [WinCairo] More unreviewed gardening. >diff --git a/LayoutTests/http/tests/download/convert-cached-load-to-download-expected.txt b/LayoutTests/http/tests/download/convert-cached-load-to-download-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..5eb39e42b7c91d6d4a27f8c93cdf6df2aec9d067 >--- /dev/null >+++ b/LayoutTests/http/tests/download/convert-cached-load-to-download-expected.txt >@@ -0,0 +1,6 @@ >+Download started. >+Downloading URL with suggested filename "mock-plugin-cacheable.pl" >+Download completed. >+The download should succeed. >+ >+Download plugin >diff --git a/LayoutTests/http/tests/download/convert-cached-load-to-download.html b/LayoutTests/http/tests/download/convert-cached-load-to-download.html >new file mode 100644 >index 0000000000000000000000000000000000000000..bf9deaceb98567379f7ada07ccced1d6f4ce64da >--- /dev/null >+++ b/LayoutTests/http/tests/download/convert-cached-load-to-download.html >@@ -0,0 +1,54 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script> >+if (window.testRunner) { >+ testRunner.dumpAsText(); >+ testRunner.setShouldLogDownloadCallbacks(true); >+ testRunner.waitUntilDownloadFinished(); >+ testRunner.setShouldDownloadUndisplayableMIMETypes(true); >+} >+</script> >+</head> >+<body> >+<p>The download should succeed.</p> >+<a id="testLink">Download plugin</a> >+<script> >+const testURL = "/plugins/resources/mock-plugin-cacheable.pl"; >+ >+function click(elmt) >+{ >+ if (!window.eventSender) { >+ alert('Click the link to run the test.'); >+ return; >+ } >+ eventSender.mouseMoveTo(elmt.offsetLeft + 5, elmt.offsetTop + 5); >+ eventSender.mouseDown(); >+ eventSender.mouseUp(); >+} >+ >+function cacheTestResource(then) >+{ >+ let frame = document.createElement("iframe"); >+ frame.src = testURL; >+ frame.onload = then; >+ document.body.appendChild(frame); >+} >+ >+function runTest() >+{ >+ cacheTestResource(function() { >+ if (window.testRunner) >+ testRunner.setPluginsEnabled(false); >+ if (window.internals) >+ internals.clearMemoryCache(); >+ >+ let link = document.getElementById("testLink"); >+ testLink.href = testURL; >+ click(link); >+ }); >+} >+runTest(); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/http/tests/plugins/resources/mock-plugin-cacheable.pl b/LayoutTests/http/tests/plugins/resources/mock-plugin-cacheable.pl >new file mode 100755 >index 0000000000000000000000000000000000000000..c6cb8c43f2a570fe7e621d55479e33ec1d34dbda >--- /dev/null >+++ b/LayoutTests/http/tests/plugins/resources/mock-plugin-cacheable.pl >@@ -0,0 +1,6 @@ >+#!/usr/bin/perl -wT >+use strict; >+ >+print "Cache-Control: max-age=3600\n"; >+print "Content-Type: application/x-webkit-test-netscape\n\n"; >+print "This is a mock plugin. It does pretty much nothing."; >diff --git a/LayoutTests/platform/ios-wk1/TestExpectations b/LayoutTests/platform/ios-wk1/TestExpectations >index 13fa39bd788b528cfec02ef8446ec0a5969c6963..489d48e2ec83c1534ab8dc4821abda07421481a2 100644 >--- a/LayoutTests/platform/ios-wk1/TestExpectations >+++ b/LayoutTests/platform/ios-wk1/TestExpectations >@@ -1382,6 +1382,7 @@ webkit.org/b/156069 http/tests/download/anchor-download-no-value.html [ Skip ] > # testRunner.setShouldDownloadUndisplayableMIMETypes() is not supported on WK1. > fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download.html [ Skip ] > fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-async-delegate.html [ Skip ] >+http/tests/download/convert-cached-load-to-download.html [ Skip ] > > webkit.org/b/137572 scrollbars/scrollbar-iframe-click-does-not-blur-content.html [ Failure ] > >diff --git a/LayoutTests/platform/ios-wk2/TestExpectations b/LayoutTests/platform/ios-wk2/TestExpectations >index 2ce2b8c34b13c169fb534bc3bbd8537fb40ab5fc..85066688812550ecc5e3a63ac9190f8da9803ff1 100644 >--- a/LayoutTests/platform/ios-wk2/TestExpectations >+++ b/LayoutTests/platform/ios-wk2/TestExpectations >@@ -1175,6 +1175,7 @@ webkit.org/b/156067 http/tests/security/anchor-download-allow-data.html [ Skip ] > webkit.org/b/156067 http/tests/security/anchor-download-allow-sameorigin.html [ Skip ] > webkit.org/b/156067 http/tests/security/anchor-download-block-crossorigin.html [ Skip ] > webkit.org/b/156067 http/tests/download/anchor-download-no-value.html [ Skip ] >+webkit.org/b/156067 http/tests/download/convert-cached-load-to-download.html [ Skip ] > > webkit.org/b/149087 http/tests/cache/disk-cache/disk-cache-vary.html [ Pass Timeout ] > webkit.org/b/149087 http/tests/cache/disk-cache/disk-cache-vary-no-body.html [ Pass Timeout ] >diff --git a/LayoutTests/platform/mac-wk1/TestExpectations b/LayoutTests/platform/mac-wk1/TestExpectations >index 69c6ab1cf9fc366e5c72899e832498b32ccdd529..729b5774823f706400b5208e0f0fe7c0a2a2a2b0 100644 >--- a/LayoutTests/platform/mac-wk1/TestExpectations >+++ b/LayoutTests/platform/mac-wk1/TestExpectations >@@ -331,6 +331,7 @@ imported/w3c/web-platform-tests/html/browsers/history/the-history-interface/hist > # testRunner.setShouldDownloadUndisplayableMIMETypes() is not supported on WK1. > fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download.html [ Skip ] > fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-async-delegate.html [ Skip ] >+http/tests/download/convert-cached-load-to-download.html [ Skip ] > > webkit.org/b/156629 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html [ Pass Failure ] >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188479
:
346922
|
346930
| 346934