NEW93554
Don't put blob: urls in caches
https://bugs.webkit.org/show_bug.cgi?id=93554
Summary Don't put blob: urls in caches
Scott Graham
Reported 2012-08-08 16:54:17 PDT
Don't put blob: urls in caches
Attachments
Patch (2.72 KB, patch)
2012-08-08 16:56 PDT, Scott Graham
no flags
Patch (2.32 KB, patch)
2012-08-09 08:58 PDT, Scott Graham
no flags
Test case that causes slow space leak (2.81 KB, text/html)
2012-08-09 12:03 PDT, Scott Graham
no flags
Patch (2.35 KB, patch)
2012-08-09 12:06 PDT, Scott Graham
no flags
Patch (7.53 KB, patch)
2012-08-16 11:25 PDT, Scott Graham
no flags
Archive of layout-test-results from gce-cr-linux-03 (547.95 KB, application/zip)
2012-08-16 12:13 PDT, WebKit Review Bot
no flags
tweak to avoid timeout (7.53 KB, patch)
2012-08-16 12:34 PDT, Scott Graham
webkit.review.bot: commit-queue-
Archive of layout-test-results from gce-cr-linux-04 (552.50 KB, application/zip)
2012-08-16 13:14 PDT, WebKit Review Bot
no flags
Scott Graham
Comment 1 2012-08-08 16:56:00 PDT
Scott Graham
Comment 2 2012-08-08 16:57:22 PDT
(Is including BlobURL.h ok here? Is there a better way to check for blob-ness?)
Gyuyoung Kim
Comment 3 2012-08-08 17:19:07 PDT
Build Bot
Comment 4 2012-08-08 17:21:00 PDT
Scott Graham
Comment 5 2012-08-08 18:13:14 PDT
Evidently not OK to include.
Build Bot
Comment 6 2012-08-08 19:16:37 PDT
Scott Graham
Comment 7 2012-08-09 08:58:18 PDT
Alexey Proskuryakov
Comment 8 2012-08-09 10:34:00 PDT
Comment on attachment 157460 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=157460&action=review > Source/WebCore/ChangeLog:9 > + Avoids space leaks when content generates many blob: urls. See > + http://crbug.com/114570 for downstream bug report and repro. It is not good form to reference external systems in bug reports. Making everyone open an additional tab and scan through relevant and irrelevant comments takes time from multiple people. Please post all relevant information to Bugzilla. > Source/WebCore/ChangeLog:12 > + No new tests, as there's no way to track not-leaked-but-growing memory > + usage. There has been work done recently on memory tracking for performance tests, perhaps that helps here. > Source/WebCore/loader/DocumentLoader.h:230 > if (protocolIs(url, "data")) > return; > + // Don't include potentially large unique blob urls here. > + if (url.startsWith("blob:")) Why are these checks different (protocolIs vs. startsWith)? > Source/WebCore/loader/cache/CachedResourceLoader.cpp:508 > + if (!request.url().protocolIsData() && !request.url().string().startsWith("blob:")) Ditto. Not sure if this case is affected, but there is often a subtle difference introduced by using URL string for checks. Namely, that does the wrong thing for invalid URLs.
Scott Graham
Comment 9 2012-08-09 12:03:33 PDT
Created attachment 157508 [details] Test case that causes slow space leak
Scott Graham
Comment 10 2012-08-09 12:06:33 PDT
Scott Graham
Comment 11 2012-08-09 12:22:21 PDT
(In reply to comment #8) > (From update of attachment 157460 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=157460&action=review > > > Source/WebCore/ChangeLog:9 > > + Avoids space leaks when content generates many blob: urls. See > > + http://crbug.com/114570 for downstream bug report and repro. > > It is not good form to reference external systems in bug reports. Making everyone open an additional tab and scan through relevant and irrelevant comments takes time from multiple people. Please post all relevant information to Bugzilla. > > > Source/WebCore/ChangeLog:12 > > + No new tests, as there's no way to track not-leaked-but-growing memory > > + usage. > > There has been work done recently on memory tracking for performance tests, perhaps that helps here. > > > Source/WebCore/loader/DocumentLoader.h:230 > > if (protocolIs(url, "data")) > > return; > > + // Don't include potentially large unique blob urls here. > > + if (url.startsWith("blob:")) > > Why are these checks different (protocolIs vs. startsWith)? > > > Source/WebCore/loader/cache/CachedResourceLoader.cpp:508 > > + if (!request.url().protocolIsData() && !request.url().string().startsWith("blob:")) > > Ditto. > > Not sure if this case is affected, but there is often a subtle difference introduced by using URL string for checks. Namely, that does the wrong thing for invalid URLs. Thanks for your review. I've uploaded the test case here, and fixed the issues you pointed out in the code. So far, I've only found reportMemoryUsage which appears to track DOM node memory usage, but wouldn't catch this growth of internal caches. Do you happen to know if there's another way to track overall memory usage, currently?
Scott Graham
Comment 12 2012-08-16 11:25:28 PDT
Build Bot
Comment 13 2012-08-16 11:46:30 PDT
WebKit Review Bot
Comment 14 2012-08-16 12:13:19 PDT
Comment on attachment 158860 [details] Patch Attachment 158860 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13514487 New failing tests: fast/files/blob-cache-leak.html
WebKit Review Bot
Comment 15 2012-08-16 12:13:25 PDT
Created attachment 158872 [details] Archive of layout-test-results from gce-cr-linux-03 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: gce-cr-linux-03 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Build Bot
Comment 16 2012-08-16 12:33:53 PDT
Scott Graham
Comment 17 2012-08-16 12:34:59 PDT
Created attachment 158876 [details] tweak to avoid timeout
WebKit Review Bot
Comment 18 2012-08-16 13:14:29 PDT
Comment on attachment 158876 [details] tweak to avoid timeout Attachment 158876 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13515516 New failing tests: fast/files/blob-cache-leak.html
WebKit Review Bot
Comment 19 2012-08-16 13:14:34 PDT
Created attachment 158883 [details] Archive of layout-test-results from gce-cr-linux-04 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: gce-cr-linux-04 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Build Bot
Comment 20 2012-08-16 13:54:47 PDT
Comment on attachment 158876 [details] tweak to avoid timeout Attachment 158876 [details] did not pass win-ews (win): Output: http://queues.webkit.org/results/13510739
Build Bot
Comment 21 2012-08-16 14:50:41 PDT
Comment on attachment 158876 [details] tweak to avoid timeout Attachment 158876 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/13512620
Andreas Kling
Comment 22 2014-02-05 10:52:54 PST
Comment on attachment 158876 [details] tweak to avoid timeout Clearing review flag on patches from before 2014. If this patch is still relevant, please reset the r? flag.
Note You need to log in before you can comment on or make changes to this bug.