Bug 129753 - ASSERT(newestManifest) fails in WebCore::ApplicationCacheGroup::didFinishLoadingManifest()
Summary: ASSERT(newestManifest) fails in WebCore::ApplicationCacheGroup::didFinishLoad...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All Unspecified
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
: 129608 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-03-05 12:46 PST by Daniel Bates
Modified: 2014-03-12 10:02 PDT (History)
9 users (show)

See Also:


Attachments
Patch (8.82 KB, patch)
2014-03-05 15:11 PST, Daniel Bates
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***