Closed Bug 951483 Opened 11 years ago Closed 11 years ago

Add back nsCycleCollector::ShutdownCollect assertion

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: mccr8, Assigned: wingo)

References

Details

Attachments

(1 file)

The patch that was landed for bug 945813, in contrast to the one I reviewed, removed the shutdown assertion in ShutdownCollect.  That should get added back in.
Ack!  I am terribly sorry for this, it was completely unintentional.  :-(
It seems to be a landing problem.  The patch that was reviewed includes this:

--- a/xpcom/base/nsCycleCollector.cpp	
+++ a/xpcom/base/nsCycleCollector.cpp	
@@ -2687,22 +2687,23 @@ nsCycleCollector::CleanupAfterCollection
     if (mJSRuntime) {
         mJSRuntime->EndCycleCollectionCallback(mResults);
     }
 }
 
 void
 nsCycleCollector::ShutdownCollect()
 {
-    for (uint32_t i = 0; i < DEFAULT_SHUTDOWN_COLLECTIONS; ++i) {
-        NS_ASSERTION(i < NORMAL_SHUTDOWN_COLLECTIONS, "Extra shutdown CC");
+    uint32_t i;
+    for (i = 0; i < DEFAULT_SHUTDOWN_COLLECTIONS; ++i) {
         if (!Collect(ShutdownCC, nullptr)) {
             break;
         }
     }
+    NS_ASSERTION(i < NORMAL_SHUTDOWN_COLLECTIONS, "Extra shutdown CC");
 }
 
 bool
 nsCycleCollector::Collect(ccType aCCType,
                           nsICycleCollectorListener *aManualListener)
 {
     CheckThreadSafety();

I didn't mean to include this change, but it is harmless and has the benefit of knowing in a debug-mode backtrace how many collections it took in the end.  But indeed it seems that the assertion itself didn't make it into https://hg.mozilla.org/integration/mozilla-inbound/rev/815cd189ae2c.

Attached patch adds it back.  I'll kick off a try build.
Assignee: nobody → wingo
Thanks!
Comment on attachment 8349302 [details] [diff] [review]
Add back nsCycleCollector::ShutdownCollect assertion

TBPL had good xpcshell builds, though the debug build timed out with an orange.  Assuming that is unrelated, probably we are good to go here.
Attachment #8349302 - Flags: review?(continuation)
Attachment #8349302 - Flags: review?(continuation) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/1ab3b1938d32
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: