Closed
Bug 1141555
Opened 9 years ago
Closed 9 years ago
HTTP cache v2 generates corrupted entries
Categories
(Core :: Networking: Cache, defect)
Core
Networking: Cache
Tracking
()
RESOLVED
FIXED
mozilla39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: michal, Assigned: michal)
Details
Attachments
(1 file)
15.89 KB,
patch
|
jduell.mcbugs
:
review+
|
Details | Diff | Splinter Review |
Analyzing of logs generated for bug 1139014 showed that we failed to read about 3.6% of entries that were previously written during the same session. Parsing failed with "Metadata hash mismatch" or "Invalid realOffset" error. This happens when an existing entry is updated and the new metadata is smaller. The file is not truncated and the excessive part of the old metadata makes the entry invalid. We also don't truncate the file when parsing of the entry fails, so we're unable to write a new correct entry if it is smaller than the invalid one.
Assignee | ||
Comment 1•9 years ago
|
||
Changes made by this patch: - TruncFile() now takes int64_t - CacheFileIOManager::Write() has new argument aTruncate, so CacheFileMetadata can truncate the file correctly - entry file is truncated when parsing of the entry fails and we're creating a new entry - CacheFileIOManager::TruncateSeekSetEOFInternal() now respects browser.cache.disk.free_space_hard_limit - CacheFileIOManager::TruncateSeekSetEOFInternal() updates entry's size in index
Attachment #8575331 -
Flags: review?(honzab.moz)
Assignee | ||
Comment 2•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=af3301a4f125
Assignee | ||
Updated•9 years ago
|
Attachment #8575331 -
Flags: review?(honzab.moz) → review?(jduell.mcbugs)
Comment 3•9 years ago
|
||
Comment on attachment 8575331 [details] [diff] [review] patch v1 Review of attachment 8575331 [details] [diff] [review]: ----------------------------------------------------------------- Looks good.
Attachment #8575331 -
Flags: review?(jduell.mcbugs) → review+
Comment 4•9 years ago
|
||
Comment on attachment 8575331 [details] [diff] [review] patch v1 Review of attachment 8575331 [details] [diff] [review]: ----------------------------------------------------------------- ::: netwerk/cache2/CacheFileIOManager.cpp @@ +1902,5 @@ > + NS_ERROR("SetEndOfFile failed"); > + return NS_ERROR_FAILURE; > + } > +#else > + MOZ_ASSERT(false, "Not implemented!"); Shouldn't we STATIC_ASSERT here?
Assignee | ||
Comment 5•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/1b374964865c
Assignee | ||
Comment 6•9 years ago
|
||
(In reply to Honza Bambas (:mayhemer) from comment #4) > > +#else > > + MOZ_ASSERT(false, "Not implemented!"); > > Shouldn't we STATIC_ASSERT here? I've added return NS_ERROR_NOT_IMPLEMENTED here so the function fails in a release build.
Comment 7•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/1b374964865c
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in
before you can comment on or make changes to this bug.
Description
•