Open
Bug 413100
Opened 17 years ago
Updated 2 years ago
Warning when trying to get profile dir (NS_ENSURE_TRUE(compMgr) failed: file nsComponentManagerUtils.cpp)
Categories
(Toolkit :: Startup and Profile System, defect)
Tracking
()
NEW
People
(Reporter: matt, Unassigned)
References
Details
(Keywords: testcase)
When starting up the profile manager I get this warning:
WARNING: NS_ENSURE_TRUE(compMgr) failed: file nsComponentManagerUtils.cpp, line 90
The stack trace at that point is:
#0 NS_DebugBreak_P (aSeverity=0,
aStr=0xb7e059bc "NS_ENSURE_TRUE(compMgr) failed", aExpr=0x0,
aFile=0xb7e059a0 "nsComponentManagerUtils.cpp", aLine=90)
at ../../../xpcom/base/nsDebugImpl.cpp:261
#1 0xb7d78b3f in CallGetService (
aContractID=0xb7f23812 "@mozilla.org/file/directory_service;1",
aIID=@0xb7f24e30, aResult=0xbfba1960) at nsComponentManagerUtils.cpp:90
#2 0xb7d78b6b in nsGetServiceByContractIDWithError::operator() (
this=0xbfba19b8, aIID=Variable "aIID" is not available.
) at nsComponentManagerUtils.cpp:288
#3 0xb7f0145a in nsCOMPtr<nsIProperties>::assign_from_gs_contractid_with_error
(this=0xbfba19c0, gs=@0xbfba19b8, aIID=@0xb7f24e30)
at ../../dist/include/xpcom/nsCOMPtr.h:1325
#4 0xb7f014a3 in nsCOMPtr (this=0xbfba19c0, gs=@0xbfba19b8)
at ../../dist/include/xpcom/nsCOMPtr.h:685
#5 0xb7f014f0 in NS_GetSpecialDirectory (specialDirName=0xb7f22c36 "ProfD",
result=0xbfba1bb0) at ../../dist/include/xpcom/nsDirectoryServiceUtils.h:53
#6 0xb7f029cb in nsXREDirProvider::GetProfileDir (this=0xbfba24c8,
aResult=0xbfba1bb0) at ../../../toolkit/xre/nsXREDirProvider.cpp:1000
#7 0xb7f047b8 in nsXREDirProvider::GetFile (this=0xbfba24c8,
aProperty=0xb7e0a3ad "ComsD", aPersistent=0xbfba1cd0, aFile=0xbfba1ccc)
at ../../../toolkit/xre/nsXREDirProvider.cpp:348
#8 0xb7da89cb in FindProviderFile (aElement=0xbfba24c8, aData=0xbfba1cc8)
at ../../../xpcom/io/nsDirectoryService.cpp:601
#9 0xb7d96acd in nsSupportsArray::EnumerateBackwards (this=0x808a510,
aFunc=0xb7da87da <FindProviderFile>, aData=0xbfba1cc8)
at ../../../xpcom/ds/nsSupportsArray.cpp:639
#10 0xb7da8bc4 in nsDirectoryService::Get (this=0x8089788,
prop=0xb7e0a3ad "ComsD", uuid=@0xb7e07758, result=0x808bbc4)
at ../../../xpcom/io/nsDirectoryService.cpp:633
#11 0xb7dd0107 in GetLocationFromDirectoryService (prop=0xb7e0a3ad "ComsD",
aDirectory=0x808bbc4)
at ../../../xpcom/components/nsComponentManager.cpp:582
#12 0xb7dd021a in nsComponentManagerImpl::Init (this=0x808bb10,
aStaticModules=0xb7f29988, aStaticModuleCount=1)
at ../../../xpcom/components/nsComponentManager.cpp:660
#13 0xb7d86882 in NS_InitXPCOM3_P (result=0xbfba1fd8, binDirectory=0x8051288,
appFileLocationProvider=0xbfba24c8, staticComponents=0xb7f29988,
componentCount=1) at ../../../xpcom/build/nsXPComInit.cpp:577
#14 0xb7ef7fb3 in ScopedXPCOMStartup::Initialize (this=0xbfba1fd8)
at ../../../toolkit/xre/nsAppRunner.cpp:949
#15 0xb7ef8288 in ShowProfileManager (aProfileSvc=0x807df10, aNative=0x805a3b8)
at ../../../toolkit/xre/nsAppRunner.cpp:1759
#16 0xb7ef9ad5 in SelectProfile (aResult=0xbfba267c, aNative=0x805a3b8,
aStartOffline=Variable "aStartOffline" is not available.
) at ../../../toolkit/xre/nsAppRunner.cpp:2123
#17 0xb7efb821 in XRE_main (argc=2, argv=0xbfba2804, aAppData=0x8051108)
at ../../../toolkit/xre/nsAppRunner.cpp:2931
#18 0x08048c08 in main (argc=2, argv=0xc)
at ../../../browser/app/nsBrowserApp.cpp:158
===============================================================
#0 NS_DebugBreak_P (aSeverity=1,
aStr=0xb67a14e0 "Content type should be known by now.",
aExpr=0xb67a14c8 "!mContentType.IsEmpty()",
aFile=0xb67a1318 "../../../../netwerk/streamconv/converters/nsUnknownDecoder.cpp", aLine=386) at ../../../xpcom/base/nsDebugImpl.cpp:261
#1 0xb671979f in nsUnknownDecoder::DetermineContentType (this=0x84dfca0,
aRequest=0x8476810)
at ../../../../netwerk/streamconv/converters/nsUnknownDecoder.cpp:391
#2 0xb6718859 in nsUnknownDecoder::GetMIMETypeFromContent (this=0x84dfca0,
aRequest=0x8476810,
aData=0x80feddc "/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n *\n * ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the"...,
aLength=4096, type=@0xbfba16a4)
at ../../../../netwerk/streamconv/converters/nsUnknownDecoder.cpp:268
#3 0xb66c675b in CallUnknownTypeSniffer (aClosure=0x8476810,
aData=0x80feddc "/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n *\n * ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the"...,
aCount=4096) at ../../../../netwerk/base/src/nsBaseChannel.cpp:583
#4 0xb66d5db6 in CallPeekFunc (aInStream=0x80cd914, aClosure=0xbfba17e0,
aFromSegment=0x80feddc "/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n *\n * ***** BEGIN LICENSE BLOCK *****\n * Version: MPL
1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the"...,
aToOffset=0, aCount=4096, aWriteCount=0xbfba1790)
at ../../../../netwerk/base/src/nsInputStreamPump.cpp:125
#5 0xb7db0232 in nsPipeInputStream::ReadSegments (this=0x80cd914,
writer=0xb66d5d64 <CallPeekFunc>, closure=0xbfba17e0, count=4096,
readCount=0xbfba17e8) at ../../../xpcom/io/nsPipe3.cpp:799
#6 0xb66d5d2d in nsInputStreamPump::PeekStream (this=0x8476390,
callback=0xb66c66f2 <CallUnknownTypeSniffer>, closure=0x8476810)
at ../../../../netwerk/base/src/nsInputStreamPump.cpp:142
#7 0xb66c66e9 in nsBaseChannel::OnStartRequest (this=0x84767e0,
request=0x8476390, ctxt=0x0)
at ../../../../netwerk/base/src/nsBaseChannel.cpp:594
#8 0xb66d59ce in nsInputStreamPump::OnStateStart (this=0x8476390)
at ../../../../netwerk/base/src/nsInputStreamPump.cpp:439
#9 0xb66d6483 in nsInputStreamPump::OnInputStreamReady (this=0x8476390,
stream=0x80cd914) at ../../../../netwerk/base/src/nsInputStreamPump.cpp:395
#10 0xb7db2bb3 in nsInputStreamReadyEvent::Run (this=0x8476600)
at ../../../xpcom/io/nsStreamUtils.cpp:111
#11 0xb7dd7700 in nsThread::ProcessNextEvent (this=0x8089148, mayWait=1,
result=0xbfba1940) at ../../../xpcom/threads/nsThread.cpp:510
#12 0xb7d7f6fd in NS_ProcessNextEvent_P (thread=0x8089148, mayWait=1)
at nsThreadUtils.cpp:227
#13 0xb5794e98 in nsXULWindow::ShowModal (this=0x8411900)
at ../../../../xpfe/appshell/src/nsXULWindow.cpp:398
#14 0xb578c5bc in nsContentTreeOwner::ShowAsModal (this=0x8432be8)
at ../../../../xpfe/appshell/src/nsContentTreeOwner.cpp:524
#15 0xb5a18ad4 in nsWindowWatcher::OpenWindowJSInternal (this=0x8411278,
aParent=0x0,
aUrl=0xb7f24c80 "chrome://mozapps/content/profile/profileSelection.xul",
aName=0xb7f23ca6 "_blank",
aFeatures=0xb7f23c83 "centerscreen,chrome,modal,titlebar", aDialog=1,
argv=0x8411568, aCalledFromJS=0, _retval=0xbfba1fc4)
at ../../../../../embedding/components/windowwatcher/src/nsWindowWatcher.cpp:945
#16 0xb5a196a5 in nsWindowWatcher::OpenWindow (this=0x8411278, aParent=0x0,
aUrl=0xb7f24c80 "chrome://mozapps/content/profile/profileSelection.xul",
aName=0xb7f23ca6 "_blank",
aFeatures=0xb7f23c83 "centerscreen,chrome,modal,titlebar",
aArguments=0x84113c8, _retval=0xbfba1fc4)
at ../../../../../embedding/components/windowwatcher/src/nsWindowWatcher.cpp:419
#17 0xb7ef85b8 in ShowProfileManager (aProfileSvc=0x807df10, aNative=0x805a3b8)
at ../../../toolkit/xre/nsAppRunner.cpp:1795
#18 0xb7ef9ad5 in SelectProfile (aResult=0xbfba267c, aNative=0x805a3b8,
aStartOffline=Variable "aStartOffline" is not available.
) at ../../../toolkit/xre/nsAppRunner.cpp:2123
#19 0xb7efb821 in XRE_main (argc=2, argv=0xbfba2804, aAppData=0x8051108)
at ../../../toolkit/xre/nsAppRunner.cpp:2931
#20 0x08048c08 in main (argc=2, argv=0xc)
at ../../../browser/app/nsBrowserApp.cpp:158
Comment 1•17 years ago
|
||
Do you really use latest nightly trunk build? See Bug 386748, this should be fixed already.
Reporter | ||
Comment 2•17 years ago
|
||
It's still showing up when I compile with code pulled from CVS around 1 AM PST Jan 19. "cvs diff cvs diff toolkit/xre/nsXREDirProvider.cpp" gives no output, so I'm up-to-date on the file that was supposed to have been fixed.
Ah, looking at the patch:
>-#ifdef XP_WIN
> else if (!strcmp(aProperty, XRE_UPDATE_ROOT_DIR)) {
>+#ifdef XP_WIN
> rv = GetUpdateRootDir(getter_AddRefs(file));
>- }
>+#else
>+ // Only supported on Windows, so just immediately fail.
>+ return NS_ERROR_FAILURE;
> #endif
>+ }
So the fix won't change the behavior on Linux, which is what I'm using.
Updated•17 years ago
|
Component: Profile: BackEnd → XRE Startup
Product: Core → Toolkit
QA Contact: profile-manager-backend → xre.startup
Summary: Warning when trying to get profile dir → Warning when trying to get profile dir (NS_ENSURE_TRUE(compMgr) failed: file nsComponentManagerUtils.cpp)
Comment 3•17 years ago
|
||
(In reply to comment #2)
> So the fix won't change the behavior on Linux, which is what I'm using.
Yes, it does, by having non-Windows platforms hit the #else clause and immediately return a failure. The early return avoids the sillyness of trying to look in the profile [the cause of the warning] for a directory it won't find there either.
This bug is a different problem. Here, the component manager is trying to do a sensible thing (look for a components directory in the profile), it's just that there's no profile directory because -- surprise! -- it's the Profile Manager starting up.
To avoid this warning you'd probably need to make the component manager know if it's in a "profile manager mode", and skip trying to do what it's doing. That's probably not worth the complexity for the special case of the profile manager.
Component: XRE Startup → Startup and Profile System
QA Contact: xre.startup → startup
Comment 4•16 years ago
|
||
<http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey/1217484420.1217485284.24505.gz&fulltext=1>
{{
Linux nye Depend bloat on 2008/07/30 23:07:00
WARNING: NS_ENSURE_TRUE(compMgr) failed: file nsComponentManagerUtils.cpp, line 90
}}
And on
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1a2pre) Gecko/2008073018 SeaMonkey/2.0a1pre] (home made) (W2Ksp4)
Comment 5•16 years ago
|
||
Serge: Why assertion? I only see a warning here.
Comment 6•16 years ago
|
||
(In reply to comment #5)
Aren't |NS_ENSURE_TRUE()| considered assertions ?
Comment 7•16 years ago
|
||
Don't think so, see http://mxr.mozilla.org/mozilla/source/xpcom/glue/nsDebug.h#192. It uses a NS_WARNING macro, not a NS_ASSERTION or similar macro.
Updated•16 years ago
|
Flags: blocking1.9.1?
Comment 9•16 years ago
|
||
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1b1pre) Gecko/20080927200111 Minefield/3.1b1pre] (home, debug default) (W2Ksp4)
{
Running TestObserverService
...
WARNING: NS_ENSURE_TRUE(compMgr) failed: file .../objdir/xpcom/build/nsComponentManagerUtils.cpp, line 165
}
Keywords: testcase
Comment 10•16 years ago
|
||
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2a1pre) Gecko/20090409 Minefield/3.6a1pre] (home, debug+options) (W2Ksp4)
(http://hg.mozilla.org/mozilla-central/rev/cb053a66c9ed)
Comment 11•12 years ago
|
||
(In reply to Frank Wein [:mcsmurf] from comment #7)
> Don't think so, see
> http://mxr.mozilla.org/mozilla/source/xpcom/glue/nsDebug.h#192. It uses a
> NS_WARNING macro, not a NS_ASSERTION or similar macro.
Although, it should probably be an assertion in this case, as we proceed to call a method on compMgr without the nullptr check.
Comment 12•12 years ago
|
||
Never mind, I read the code wrong.
Updated•2 years ago
|
Severity: minor → S4
You need to log in
before you can comment on or make changes to this bug.
Description
•