Closed Bug 715098 Opened 13 years ago Closed 12 years ago

nsICacheMetadata::visitMetaData blows up in debug mode if the visitor returns false

Categories

(Core :: Networking: Cache, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: Gijs, Assigned: Gijs)

References

()

Details

Attachments

(1 file, 1 obsolete file)

http://mxr.mozilla.org/mozilla-central/source/netwerk/cache/nsCacheMetaData.cpp?rev=e7854b4d29ba#181

181     NS_ABORT_IF_FALSE(data == limit, "Metadata corrupted");

But data != limit whenever the visitor returns false. The documentation doesn't specify when that should happen (just that it returns a boolean).

Firebug currently uses this code and returns false, which crashes debug builds. I don't really know what the original goal of the assert was, but from what I can tell it can be removed.
Attached patch Option 1: Remove the assert (obsolete) — Splinter Review
One thing we could do is nuke the assert...
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Attachment #585705 - Flags: review?(jduell.mcbugs)
Or we could keep the assert and return early.

NB: this returns NS_OK even if the visitor code fails. Whether that's desirable is up to you guys...
Attachment #585706 - Flags: review?(jduell.mcbugs)
Comment on attachment 585705 [details] [diff] [review]
Option 1: Remove the assert

Review of attachment 585705 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for the patches, Gijs!

Michal is a better reviewer for them.
Attachment #585705 - Flags: review?(jduell.mcbugs) → review?(michal.novotny)
Attachment #585706 - Flags: review?(jduell.mcbugs) → review?(michal.novotny)
Attachment #585705 - Flags: review?(michal.novotny)
Attachment #585706 - Flags: review?(michal.novotny) → review+
Keywords: checkin-needed
Depends on: 720212
Attachment #585705 - Attachment is obsolete: true
Attachment #585706 - Flags: checkin+
https://hg.mozilla.org/mozilla-central/rev/2c215e31b7d0
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: