Closed Bug 661046 Opened 13 years ago Closed 13 years ago

Spammed 40x when quitting debug build: "WARNING: NS_ENSURE_TRUE(InitStaticMembers()) failed: file mozilla/modules/libpref/src/Preferences.cpp, line 1311"

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 660640

People

(Reporter: dholbert, Unassigned)

References

()

Details

STEPS TO REPRODUCE: 1. Quit an up-to-date debug mozilla-central build. ACTUAL RESULTS: 40 copies of this line are spammed to your terminal as Firefox quits: { WARNING: NS_ENSURE_TRUE(InitStaticMembers()) failed: mozilla/modules/libpref/src/Preferences.cpp, line 1311 } Referenced code: 1306 // static 1307 nsresult 1308 Preferences::RemoveObserver(nsIObserver* aObserver, 1309 const char* aPref) 1310 { 1311 NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE); 1312 return sPreferences->mRootBranch->RemoveObserver(aPref, aObserver); 1313 } http://mxr.mozilla.org/mozilla-central/source/modules/libpref/src/Preferences.cpp#1311 This code was added 2 days ago in bug 660121.
Just as a sanity "not just me" check - this shows up in tinderbox logs, too, like in this OS X debug crashtest run from earlier today: http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1306880660.1306881181.22282.gz
OS: Linux → All
Hardware: x86_64 → All
Summary: Spammed 40x when quitting debug build: WARNING: NS_ENSURE_TRUE(InitStaticMembers()) failed: file mozilla/modules/libpref/src/Preferences.cpp, line 1311 → Spammed 40x when quitting debug build: "WARNING: NS_ENSURE_TRUE(InitStaticMembers()) failed: file mozilla/modules/libpref/src/Preferences.cpp, line 1311"
Probably, this shows some hidden bugs. If callers try to remove pref observers after pref module is shutdown, you can see the assertions. It's important to know who are the callers. In other words, if the callers call RemoveObserver() or RemoveObservers() at shutting down, we should find another trigger for removing the observers or they don't need to call them.
I was going to mark this as being a DUP of bug 660640, but I'll wait to see if there's some other resolution. I was going to check in the patch which would silence all of this.
(Ah - I did search for dups before filing, but I guess wasn't thorough enough in my searching. I queried for bugs mentioning 'InitStaticMembers' and glanced at the list of bugs blocking bug 660121, & found nothing.)
dup to bug 660640. If you can still see similar warning, it means the caller has actual bug.
No longer blocks: 660121
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.