Closed Bug 1067505 Opened 10 years ago Closed 10 years ago

The UnregisterWeakMemoryReporter() call in ~nsCategoryManager always fails

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(1 file)

I was wondering why we were always getting this message on shutdown:
  WARNING: '!compMgr', file /Users/amccreight/mc/xpcom/glue/nsComponentManagerUtils.cpp, line 63

Turns out, ~nsCategoryManager calls UnregisterWeakMemoryReporter(), which calls do_GetService, but the category manager looks like a singleton being destroyed way late in shutdown, so do_GetService fails.  nsCategoryManager needs to either observe some XPCOM shutdown thing and call UnregisterWeakMemoryReporter() then, or just not try to Unregister.  I don't know the consequences of the latter.
Blocks: fx-noise
> or just not try to Unregister.  I don't know the consequences of the latter.

Should be fine, so long as the registration is changed to RegisterStrongReporter. Then the memory reporter manager will free the reporter when it shuts down.
Whiteboard: [MemShrink]
Assignee: nobody → continuation
The nsCategoryManager singleton lives until very late in shutdown, so the unregister always fails.

It is okay to make it a strong reporter because it will always outlive the memory reporter manager anyways.
Comment on attachment 8491836 [details] [diff] [review]
Make nsCategoryManager into a strong memory reporter.

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

Have an r+.
Attachment #8491836 - Flags: review+
Thanks!

https://hg.mozilla.org/integration/mozilla-inbound/rev/f9bfd3909264

green ish try run: https://tbpl.mozilla.org/?tree=Try&rev=ac371ef198ed

I think the oranges are unrelated to this patch.
Backed out for some kind of L64 debug make package failure:
  https://tbpl.mozilla.org/php/getParsedLog.php?id=48475634&tree=Mozilla-Inbound

https://hg.mozilla.org/integration/mozilla-inbound/rev/426bc4161af9

Presumably whatever weird way we're running embedded Gecko during packaging doesn't do something or other with the memory reporter manager in the right way.
Relanded because the leaks seem to be the fault of another push.

https://hg.mozilla.org/integration/mozilla-inbound/rev/f152a52a80e1
https://hg.mozilla.org/mozilla-central/rev/f152a52a80e1
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: