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...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Networking: Cache (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla12
Assigned To: :Gijs Kruitbosch (away 26-29 incl.)
:
Mentors:
http://mxr.mozilla.org/mozilla-centra...
Depends on: 720212
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-04 03:58 PST by :Gijs Kruitbosch (away 26-29 incl.)
Modified: 2012-01-28 18:52 PST (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


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

Description :Gijs Kruitbosch (away 26-29 incl.) 2012-01-04 03:58:14 PST
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.
Comment 1 :Gijs Kruitbosch (away 26-29 incl.) 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 :Gijs Kruitbosch (away 26-29 incl.) 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 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 :Gijs Kruitbosch (away 26-29 incl.) 2012-01-28 07:15:09 PST
Pushed to inbound: http://hg.mozilla.org/integration/mozilla-inbound/rev/2c215e31b7d0
Comment 5 Joe Drew (not getting mail) 2012-01-28 18:52:10 PST
https://hg.mozilla.org/mozilla-central/rev/2c215e31b7d0

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