Last Comment Bug 715098 - nsICacheMetadata::visitMetaData blows up in debug mode if the visitor returns false
: nsICacheMetadata::visitMetaData blows up in debug mode if the visitor returns...
Product: Core
Classification: Components
Component: Networking: Cache (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla12
Assigned To: :Gijs
: Patrick McManus [:mcmanus]
Depends on: 720212
  Show dependency treegraph
Reported: 2012-01-04 03:58 PST by :Gijs
Modified: 2012-01-28 18:52 PST (History)
5 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Option 1: Remove the assert (507 bytes, patch)
2012-01-04 04:40 PST, :Gijs
no flags Details | Diff | Splinter Review
Option 2: Return early (696 bytes, patch)
2012-01-04 04:41 PST, :Gijs
michal.novotny: review+
gijskruitbosch+bugs: checkin+
Details | Diff | Splinter Review

Description User image :Gijs 2012-01-04 03:58:14 PST

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.
Comment 1 User image :Gijs 2012-01-04 04:40:02 PST
Created attachment 585705 [details] [diff] [review]
Option 1: Remove the assert

One thing we could do is nuke the assert...
Comment 2 User image :Gijs 2012-01-04 04:41:03 PST
Created attachment 585706 [details] [diff] [review]
Option 2: Return early

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...
Comment 3 User image Jason Duell [:jduell] (needinfo me) 2012-01-12 20:25:58 PST
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.
Comment 4 User image :Gijs 2012-01-28 07:15:09 PST
Pushed to inbound:
Comment 5 User image Joe Drew (not getting mail) 2012-01-28 18:52:10 PST

Note You need to log in before you can comment on or make changes to this bug.