Open Bug 1667966 Opened 1 year ago Updated 10 months ago

C-C TB xpcshell test: Main Thread] WARNING: NS_ENSURE_TRUE(Preferences::InitStaticMembers()) failed: file .../mozilla/modules/libpref/Preferences.cpp, line 4287

Categories

(Thunderbird :: General, defect)

x86_64
Linux
defect

Tracking

(Not tracked)

People

(Reporter: ishikawa, Unassigned)

Details

During local xpcshell-test run with FULL DEBUG version of TB, I noticed the following errors.
(I run tests under Debian GNU/linux, but I suspect the bug appears on all the platform.)
These errors are only visible when you add --verbose flag to |mach xpcshell-test| command because the error/warning message IS NOT REPORTED to unsuspecting tryserver submitters. (and better still with --sequential so that the test results won't get mixed with parallel execution of subtests.)

620: Main Thread] WARNING: NS_ENSURE_TRUE(Preferences::InitStaticMembers()) failed: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/modules/libpref/Preferences.cpp, line 4287 

The number 620 at the beginning of the line above is the frequency of appearances. I summarized the errors/warnings and I took the above line from the summary.
620 is rather many.

These error were not visible in June. So they are relatively new.
(I have not had a chance to test xpcshell test for a while due to some issues
related to runtime error caused by OS version string issue which has
been fixed lately. So I run xpcshell-test for the first time in a long time.)

The code in question is as follows.:"
https://searchfox.org/comm-central/source/mozilla/modules/libpref/Preferences.cpp#4287


// These preference getter wrappers allow us to look up the value for static
// preferences based on their native types, rather than manually mapping them to
// the appropriate Preferences::Get* functions.
// We define these methods in a struct which is made friend of Preferences in
// order to access private members.
struct Internals {
  template <typename T>
  static nsresult GetPrefValue(const char* aPrefName, T&& aResult,
                               PrefValueKind aKind) {
    nsresult rv = NS_ERROR_UNEXPECTED;
    NS_ENSURE_TRUE(Preferences::InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);   <=== THIS LINE

    if (Maybe<PrefWrapper> pref = pref_Lookup(aPrefName)) {
      rv = pref->GetValue(aKind, std::forward<T>(aResult));

#ifdef MOZ_GECKO_PROFILER
      if (profiler_feature_active(ProfilerFeature::PreferenceReads)) {
        PROFILER_ADD_MARKER_WITH_PAYLOAD(
            "PreferenceRead", OTHER_PreferenceRead, PrefMarkerPayload,
            (aPrefName, Some(aKind), Some(pref->Type()),
             PrefValueToString(aResult), TimeStamp::Now()));
      }
#endif
    }

    return rv;
  }

I am a bit perplexed what goes on. Maybe we are trying to reinvoke the initialization after it has already been done???

TIA

Are you still seeing this?

Flags: needinfo?(ishikawa)

(In reply to Wayne Mery (:wsmwk) from comment #1)

Are you still seeing this?

Yes, I do.
Well, this is from a week old log.

My local script summarizes the error/warning messages.

The most frequent warning is this "NS_ENSURE_TRUE(Preferences::InitStaticMembers()) failed" message.

    ========================================
    Other than /libeditor/
    ========================================

673: Main Thread] WARNING: NS_ENSURE_TRUE(Preferences::InitStaticMembers()) failed: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/modules/libpref/Preferences.cpp:4381
672: Main Thread] WARNING: Extra shutdown CC: 'i < NORMAL_SHUTDOWN_COLLECTIONS', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/xpcom/base/nsCycleCollector.cpp:3365
460: Main Thread] WARNING: NS_ENSURE_SUCCESS_VOID(rv) failed with result 0x80070057 (NS_ERROR_ILLEGAL_VALUE): file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/extensions/permissions/PermissionManager.cpp:1450
282: Main Thread] WARNING: NS_ENSURE_TRUE(identity) failed: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/base/src/nsMsgIncomingServer.cpp:1814
205: Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, kKnownEsrVersion) failed with result 0x80004002 (NS_NOINTERFACE): file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/toolkit/components/resistfingerprinting/nsRFPService.cpp:553
170: Main Thread] WARNING: EnsureInit: No settings: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/widget/gtk/nsLookAndFeel.cpp:1094
122: Main Thread] WARNING: NS_ENSURE_TRUE(parentDOMWindow) failed: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/base/src/nsMsgProgress.cpp:47
93: Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80040111 (NS_ERROR_NOT_AVAILABLE): file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/intl/nsCharsetConverterManager.cpp:111
...

I think I found new warnings and probably should report them elsewhere...

Flags: needinfo?(ishikawa)
You need to log in before you can comment on or make changes to this bug.