Bug 129753

Summary: ASSERT(newestManifest) fails in WebCore::ApplicationCacheGroup::didFinishLoadingManifest()
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebCore Misc.Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, ap, beidson, commit-queue, ddkilzer, japhet, jeffrey+webkit, joepeck, t.tom
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: Unspecified   
Attachments:
Description Flags
Patch ap: review+

Description Daniel Bates 2014-03-05 12:46:25 PST
For some reasons an app cache for a web site W may only be partially written to disk such that only a cached group entry is written. That is, no cached resources, including the manifest resource, are written to disk. Subsequently visiting W after loading the app cache from disk (say, by closing Safari and launching it again) will cause an assertion failure in WebCore::ApplicationCacheGroup::didFinishLoadingManifest() (ASSERT(newestManifest)) because the manifest resource for the latest completed app cache (newestManifest) is null.
Comment 1 Daniel Bates 2014-03-05 13:04:12 PST
<rdar://problem/12069835>
Comment 2 Daniel Bates 2014-03-05 15:11:57 PST
Created attachment 225919 [details]
Patch
Comment 3 Alexey Proskuryakov 2014-03-05 15:55:02 PST
Comment on attachment 225919 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=225919&action=review

> Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp:1186
> +        LOG_ERROR("No manifest resource was in the cache");

I'd say: "Could not load application cache, because there was no manifest resource".

> Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp:1476
> +        if (!deleteCacheGroupRecord(manifestURL)) {
>              LOG_ERROR("Could not load cache group id, error \"%s\"", m_database.lastErrorMsg());

This log message doesn't look right now.
Comment 4 Daniel Bates 2014-03-05 16:53:11 PST
(In reply to comment #3)
> (From update of attachment 225919 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=225919&action=review
> 
> > Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp:1186
> > +        LOG_ERROR("No manifest resource was in the cache");
> 
> I'd say: "Could not load application cache, because there was no manifest resource".

Will change error message string to read:

"Could not load application cache because there was no manifest resource"

> 
> > Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp:1476
> > +        if (!deleteCacheGroupRecord(manifestURL)) {
> >              LOG_ERROR("Could not load cache group id, error \"%s\"", m_database.lastErrorMsg());
> 
> This log message doesn't look right now.

Will change error message string to read:

"Could not delete cache group record, error \"%s\""
Comment 5 Daniel Bates 2014-03-05 16:57:08 PST
Committed r165145: <http://trac.webkit.org/changeset/165145>
Comment 6 Daniel Bates 2014-03-12 10:02:53 PDT
*** Bug 129608 has been marked as a duplicate of this bug. ***