Bug 24672 - ASSERTION FAILURE: !m_purgeableData in WebCore::CachedResource::data() saving a WebArchive
Summary: ASSERTION FAILURE: !m_purgeableData in WebCore::CachedResource::data() saving...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Darin Adler
URL: http://www.mingpaonews.com/20090318/g...
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2009-03-18 07:57 PDT by David Kilzer (:ddkilzer)
Modified: 2009-03-29 19:43 PDT (History)
2 users (show)

See Also:


Attachments
patch (3.39 KB, patch)
2009-03-29 17:17 PDT, Darin Adler
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2009-03-18 07:57:19 PDT
* SUMMARY
When saving a WebArchive of some pages with a Debug build of WebKit, an assertion failure occurs.  Noted in Bug 22931 Comment #4.

* STEPS TO REPRODUCE
1. Launch Debug build of WebKit.
2. Open URL:  <http://www.mingpaonews.com/20090318/gba1.htm>
3. Save As...WebArchive.

* RESULTS
Crash due to assertion failure.

* REGRESSION
This is a regression from builds of WebKit before the cache was purgeable.

* NOTES
Console output of crash:

ERROR: Failed to archive subresource for http://www.mingpaonews.com/image/jflow_normal.gif
(/Volumes/Data/WebKit.git/WebCore/loader/archive/cf/LegacyWebArchive.cpp:545 static WTF::PassRefPtr<WebCore::LegacyWebArchive> WebCore::LegacyWebArchive::create(const WebCore::String&, WebCore::Frame*, WTF::Vector<WebCore::Node*, 0ul>&))
ERROR: Failed to archive subresource for http://www.mingpaonews.com/image/jflow_selected.gif
(/Volumes/Data/WebKit.git/WebCore/loader/archive/cf/LegacyWebArchive.cpp:545 static WTF::PassRefPtr<WebCore::LegacyWebArchive> WebCore::LegacyWebArchive::create(const WebCore::String&, WebCore::Frame*, WTF::Vector<WebCore::Node*, 0ul>&))
ERROR: Failed to archive subresource for http://www.mingpaonews.com/image/jflow_multibox_bkg_460.jpg
(/Volumes/Data/WebKit.git/WebCore/loader/archive/cf/LegacyWebArchive.cpp:545 static WTF::PassRefPtr<WebCore::LegacyWebArchive> WebCore::LegacyWebArchive::create(const WebCore::String&, WebCore::Frame*, WTF::Vector<WebCore::Node*, 0ul>&))
ASSERTION FAILED: !m_purgeableData
(/Volumes/Data/WebKit.git/WebCore/loader/CachedResource.h:137 WebCore::SharedBuffer* WebCore::CachedResource::data() const)
Comment 1 David Kilzer (:ddkilzer) 2009-03-18 07:57:43 PDT
<rdar://problem/6574263>
Comment 2 Cameron Zwarich (cpst) 2009-03-19 01:12:58 PDT
I know how to fix this.
Comment 3 Cameron Zwarich (cpst) 2009-03-29 15:54:59 PDT
The fix should really be doing something along these lines, except for WebCore::LegacyWebArchive::create():

http://trac.webkit.org/changeset/39517

Unfortunately, this can't just be done where cachedResource->data() is used, because an earlier call to DocumentLoader::subresource() also uses the cached resource's data. The right thing to do is probably to make DocumentLoader::subResource() do something along the lines of r39517, but I wanted to ask somebody who knows the code.

I'll unassign this in case someone else wants to take a stab at it.
Comment 4 Darin Adler 2009-03-29 17:17:33 PDT
Created attachment 29051 [details]
patch
Comment 5 Darin Adler 2009-03-29 18:59:53 PDT
http://trac.webkit.org/changeset/42095
Comment 6 David Kilzer (:ddkilzer) 2009-03-29 19:43:35 PDT
Comment on attachment 29051 [details]
patch

>+        I couldn't create a test case for this. In fact, the case in the bug doesn't exist any more,
>+        but there is an Apple-internal website I was able to use to reproduce and fix.

Any news story on the mingpaonews.com site reproduces this issue.