RESOLVED FIXED 67983
CRASH under WebCore::ArchiveResourceCollection::addAllResources loading WebArchive
https://bugs.webkit.org/show_bug.cgi?id=67983
Summary CRASH under WebCore::ArchiveResourceCollection::addAllResources loading WebAr...
Joseph Pecoraro
Reported 2011-09-12 21:08:50 PDT
I was seeing reproducible crashes loading a WebArchive which had a subresource with a null mime type. I have a fix to follow with a test.
Attachments
[TEST] Test WebArchive (12.05 KB, application/x-webarchive)
2011-09-12 21:19 PDT, Joseph Pecoraro
no flags
[PATCH] Proposed Fix (17.61 KB, patch)
2011-09-12 21:19 PDT, Joseph Pecoraro
darin: review+
webkit.review.bot: commit-queue-
[PATCH] Patch to Land - EWS Bot Test (19.18 KB, patch)
2011-09-13 10:50 PDT, Joseph Pecoraro
no flags
Joseph Pecoraro
Comment 1 2011-09-12 21:19:19 PDT
Created attachment 107137 [details] [TEST] Test WebArchive
Joseph Pecoraro
Comment 2 2011-09-12 21:19:40 PDT
Created attachment 107138 [details] [PATCH] Proposed Fix
Joseph Pecoraro
Comment 3 2011-09-12 21:28:26 PDT
This fix assumes that it is okay for a sub resource to have a null mime type. Using another tool for working with webarchives seems to assume that the mime type always exists for a valid webarchive.
Joseph Pecoraro
Comment 4 2011-09-12 21:35:47 PDT
WebKit Review Bot
Comment 5 2011-09-12 21:44:53 PDT
Comment on attachment 107138 [details] [PATCH] Proposed Fix Attachment 107138 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/9650091 New failing tests: loader/test-loading-archive-subresource-null-mimetype.html
Darin Adler
Comment 6 2011-09-13 08:40:11 PDT
Comment on attachment 107138 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=107138&action=review r=me but I think the test needs to be put in a different directory or somehow otherwise skipped for non-webarchive platforms > LayoutTests/ChangeLog:11 > + * loader/test-loading-archive-subresource-null-mimetype.html: Added. This test needs to be skipped on the many platforms that do not support CoreFoundation property list web archives. You should look for other similar tests and see how that works. I’m guessing that the tests normally go inside webarchive/loading rather than in loader to make sure they get skipped on platforms that do not have web archives. > Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp:331 > + LOG(Archives, "LegacyWebArchive - Main Resource MIME Type is required, but was null."); The words Resource and Type should not be capitalized here. > Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp:351 > + RefPtr<ArchiveResource> subresource = createResource(subresourceDict); > + if (subresource) > + addSubresource(subresource.release()); It would be nicer to define this variable inside the if.
Joseph Pecoraro
Comment 7 2011-09-13 10:33:35 PDT
Arg uploaded the patch with the test in wrong directory. I'll upload a new patch with the results which should be fine on the bots.
Joseph Pecoraro
Comment 8 2011-09-13 10:50:38 PDT
Created attachment 107195 [details] [PATCH] Patch to Land - EWS Bot Test This is for the bots. I addressed Darin's comments and fixed the test directory.
Joseph Pecoraro
Comment 9 2011-09-13 12:24:42 PDT
Note You need to log in before you can comment on or make changes to this bug.