Closed
Bug 136712
Opened 23 years ago
Closed 18 years ago
nsJSContext causes lots of getting service (by CID) on shutdown [xlib]
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: timeless, Unassigned)
References
Details
Attachments
(1 file)
11.28 KB,
patch
|
bzbarsky
:
review-
|
Details | Diff | Splinter Review |
Getting service on shutdown. Denied.
CID: {dc26e0e0-ca94-11d1-a9a4-00805f8a7ac4}
IID: {a22ad7b0-ca86-11d1-a9a4-00805f8a7ac4}
both of these are prefs
#2 0x2831caa9 in nsDebug::Assertion (aStr=0x2836ca8a "stop for CID", aExpr=0x2836ca88 "0",
aFile=0x2836c040 "/home/timeless/mozilla/xpcom/components/nsComponentManager.cpp", aLine=1878)
at /home/timeless/mozilla/xpcom/glue/nsDebug.cpp:291
#3 0x282c2e25 in nsComponentManagerImpl::GetService (this=0x80c4000, aClass=@0x290d1834, aIID=@0x806b7dc, result=0xbfbfee84)
at /home/timeless/mozilla/xpcom/components/nsComponentManager.cpp:1878
#4 0x2831f4b6 in nsGetServiceByCID::operator() (this=0xbfbfef24, aIID=@0x806b7dc, aInstancePtr=0xbfbfee84)
at /home/timeless/mozilla/xpcom/glue/nsComponentManagerUtils.cpp:101
#5 0x080622c3 in nsCOMPtr<nsIPref>::assign_from_helper (this=0xbfbfef34, helper=@0xbfbfef24, aIID=@0x806b7dc)
at ../../dist/include/xpcom/nsCOMPtr.h:922
#6 0x0806517b in nsCOMPtr<nsIPref>::nsCOMPtr (this=0xbfbfef34, helper=@0xbfbfef24) at ../../dist/include/xpcom/nsCOMPtr.h:553
#7 0x29048c53 in ?? ()
#8 0x290490c3 in ?? ()
#9 0x29626af4 in ?? ()
#10 0x296a1125 in ?? ()
#11 0x296a2e3d in ?? ()
#12 0x2950d47c in ?? ()
#13 0x2950e34c in ?? ()
#14 0x2950deb7 in ?? ()
#15 0x28271457 in nsSupportsHashtable::ReleaseElement (aKey=0x85bbc00, aData=0x864d4c0, aClosure=0x0)
at /home/timeless/mozilla/xpcom/ds/nsHashtable.cpp:937
#16 0x2826f111 in _hashEnumerate (he=0x869ea20, i=1, arg=0xbfbff1ac) at /home/timeless/mozilla/xpcom/ds/nsHashtable.cpp:198
#17 0x2839d074 in PL_HashTableEnumerateEntries (ht=0x823cf94, f=0x2826f0d8 <_hashEnumerate(PLHashEntry *, int, void *)>,
arg=0xbfbff1ac) at /home/timeless/mozilla/nsprpub/lib/ds/plhash.c:429
#18 0x2826f7ed in nsHashtable::Enumerate (this=0x823cf90,
aEnumFunc=0x2827141c <nsSupportsHashtable::ReleaseElement(nsHashKey *, void *, void *)>, aClosure=0x0)
at /home/timeless/mozilla/xpcom/ds/nsHashtable.cpp:361
#19 0x28323df1 in nsSupportsHashtable::Enumerate (this=0x823cf90,
aEnumFunc=0x2827141c <nsSupportsHashtable::ReleaseElement(nsHashKey *, void *, void *)>, aClosure=0x0)
at /home/timeless/mozilla/xpcom/ds/nsHashtable.h:189
#20 0x282714ae in nsSupportsHashtable::~nsSupportsHashtable (this=0x823cf90, __in_chrg=2)
at /home/timeless/mozilla/xpcom/ds/nsHashtable.cpp:943
#21 0x294bd60e in ?? ()
#22 0x294bd793 in ?? ()
#23 0x282d0305 in nsServiceManager::ReleaseService (aContractID=0x297b6760 "@mozilla.org/xul/xul-prototype-cache;1",
service=0x823cf00, shutdownListener=0x0) at /home/timeless/mozilla/xpcom/components/nsServiceManagerObsolete.cpp:127
#24 0x295258ff in ?? ()
#25 0x295252fb in ?? ()
#26 0x29e703e3 in ?? ()
#27 0x29bb62e8 in ?? ()
#28 0x2831e1ac in nsGenericModule::Shutdown (this=0x82c7a80) at /home/timeless/mozilla/xpcom/glue/nsGenericFactory.cpp:323
#29 0x2831dbce in nsGenericModule::~nsGenericModule (this=0x82c7a80, __in_chrg=3)
at /home/timeless/mozilla/xpcom/glue/nsGenericFactory.cpp:233
#30 0x2831dd1c in nsGenericModule::Release (this=0x82c7a80) at /home/timeless/mozilla/xpcom/glue/nsGenericFactory.cpp:236
#31 0x282d1483 in nsDll::Shutdown (this=0x8150040) at /home/timeless/mozilla/xpcom/components/xcDll.cpp:478
#32 0x282c9a0a in nsFreeLibrary (dll=0x8150040, serviceMgr=0x0, when=3)
at /home/timeless/mozilla/xpcom/components/nsNativeComponentLoader.cpp:380
#33 0x282c9bc0 in nsFreeLibraryEnum (aKey=0x814f380, aData=0x8150040, closure=0xbfbff5e0)
at /home/timeless/mozilla/xpcom/components/nsNativeComponentLoader.cpp:432
#34 0x2826f111 in _hashEnumerate (he=0x80bc900, i=17, arg=0xbfbff5ac) at /home/timeless/mozilla/xpcom/ds/nsHashtable.cpp:198
#35 0x2839d074 in PL_HashTableEnumerateEntries (ht=0x80ca2c4, f=0x2826f0d8 <_hashEnumerate(PLHashEntry *, int, void *)>,
arg=0xbfbff5ac) at /home/timeless/mozilla/nsprpub/lib/ds/plhash.c:429
#36 0x2826f7ed in nsHashtable::Enumerate (this=0x80ca2c0, aEnumFunc=0x282c9b70 <nsFreeLibraryEnum(nsHashKey *, void *, void *)>,
aClosure=0xbfbff5e0) at /home/timeless/mozilla/xpcom/ds/nsHashtable.cpp:361
#37 0x282cb8e8 in nsNativeComponentLoader::UnloadAll (this=0x80bbfc0, aWhen=3)
at /home/timeless/mozilla/xpcom/components/nsNativeComponentLoader.cpp:1013
#38 0x282c608e in nsComponentManagerImpl::UnloadLibraries (this=0x80c4000, serviceMgr=0x0, aWhen=3)
at /home/timeless/mozilla/xpcom/components/nsComponentManager.cpp:2978
#39 0x282bf58d in nsComponentManagerImpl::Shutdown (this=0x80c4000)
at /home/timeless/mozilla/xpcom/components/nsComponentManager.cpp:790
#40 0x28265be2 in NS_ShutdownXPCOM (servMgr=0x0) at /home/timeless/mozilla/xpcom/build/nsXPComInit.cpp:571
I'm going to trigger a rebuild because i was trying to build xlib but it seems that this freebsd build has gtk trimmings.. if i don't touch this bug w/in a month mark it invalid
Comment 1•23 years ago
|
||
These are coming from the nsJSContext destructor. It is using nsIPref and the
old style C Callback methods instead of nsIPrefBranch and the Observer
methodology (which automatically cleans itself up at XPCOM shutdown.) Every time
a nsJSContext is destroyed (nsJSEnvironment.cpp currently at line 432), it does
a get_Service for nsIPref so that it can call pref->UnregisterCallback().
It is also doing a get_Service on nsIXPConnect with the same results.
Confirming the bug, but I think it belongs to DOM not Backend Prefs. ;)
Status: UNCONFIRMED → NEW
Ever confirmed: true
cool, i'll happily pass the buck now that I know more about it :)
Assignee: bnesse → jst
Component: Preferences: Backend → DOM Core
QA Contact: sairuh → stummala
Summary: xlib shutdown causes lots of getting service (by CID) on shutdown → nsJSContext causes lots of getting service (by CID) on shutdown [xlib]
Comment 4•22 years ago
|
||
*** Bug 105115 has been marked as a duplicate of this bug. ***
Comment 5•21 years ago
|
||
two new members; one comptr to nsIPrefBranchInternal and one to nsIXPConnect =>
no need for getservice at shutdown
Assignee: general → arne.anka
Status: NEW → ASSIGNED
Updated•21 years ago
|
Attachment #141474 -
Flags: superreview?(jst)
Attachment #141474 -
Flags: review?(bzbarsky)
![]() |
||
Comment 6•21 years ago
|
||
Comment on attachment 141474 [details] [diff] [review]
proposed patch
>Index: dom/src/base/nsJSEnvironment.cpp
>+ mPbi = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
> if (NS_SUCCEEDED(rv)) {
>+ mPbi->AddObserver(js_options_dot_str, this, PR_FALSE);
Congrats, you just leaked the prefservice and the JSContext both.
>+ Observe(mPbi, nsnull, nsnull);
Further, we have a number of JSContexts floating around, don't we? I'm not so
happy with bloating every single one of them with the two extra members.
Attachment #141474 -
Flags: superreview?(jst)
Attachment #141474 -
Flags: review?(bzbarsky)
Attachment #141474 -
Flags: review-
Updated•21 years ago
|
Assignee: mikael → general
Status: ASSIGNED → NEW
QA Contact: stummala → ian
Comment 7•18 years ago
|
||
Xlib port has been removed from trunk (bug 326152)
Please open a new bug if this still occurs in a trunk build.
-> WONTFIX
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → WONTFIX
Component: DOM: Core → DOM: Core & HTML
QA Contact: ian → general
You need to log in
before you can comment on or make changes to this bug.
Description
•