* 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)
<rdar://problem/6574263>
I know how to fix this.
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.
Created attachment 29051 [details] patch
http://trac.webkit.org/changeset/42095
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.