Closed Bug 43244 Opened 24 years ago Closed 24 years ago

nsProxyObjectManager leaked during shutdown, noise reduction PATCH INCLUDED

Categories

(Core :: XPCOM, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED DUPLICATE of bug 44680

People

(Reporter: inaky.gonzalez, Assigned: rayw)

Details

(Keywords: memory-leak)

Attachments

(1 file)

During XPCOM shutdown, I was getting the following allocation traces:

<nsHashtable>
@ (136) 0x82c26a8 unbalanced 1
__libc_start_main + 0x00000112
Unknown + 0x08054621
NS_ShutdownXPCOM(nsIServiceManager *) + 0x0000018a
nsServiceManager::ShutdownGlobalServiceManager(nsIServiceManager **) +
0x00000041
nsServiceManagerImpl::Release(void) + 0x0000009f
nsServiceManagerImpl::~nsServiceManagerImpl(void) + 0x00000044
nsObjectHashtable::~nsObjectHashtable(void) + 0x0000002b
nsObjectHashtable::Reset(void) + 0x00000028
nsHashtable::Reset(int (*)(nsHashKey *, void *, void *), void *) + 0x00000041
PL_HashTableEnumerateEntries + 0x0000008c
nsHashtable::Enumerate(int (*)(nsHashKey *, void *, void *), void *) +
0x00000087
nsServiceEntry::NotifyListeners(void) + 0x00000191
nsNetModuleMgr::Release(void) + 0x00000097
nsNetModuleMgr::~nsNetModuleMgr(void) + 0x0000003b
nsSupportsArray::Release(void) + 0x00000091
nsSupportsArray::~nsSupportsArray(void) + 0x0000002a
nsSupportsArray::DeleteArray(void) + 0x00000025
nsSupportsArray::Clear(void) + 0x0000004e
nsNetModRegEntry::Release(void) + 0x0000009b
nsNetModRegEntry::~nsNetModRegEntry(void) + 0x0000006c
nsCOMPtr<nsINetNotify>::~nsCOMPtr(void) + 0x00000067
nsProxyEventObject::Release(void) + 0x00000099
nsProxyEventObject::~nsProxyEventObject(void) + 0x0000009b
nsProxyObjectManager::GetInstance(void) + 0x0000003f
nsProxyObjectManager::nsProxyObjectManager(void) + 0x00000069
nsHashtable::nsHashtable(unsigned int, int) + 0x0000003d

@ (137) 0x8143d68 unbalanced 1
__libc_start_main + 0x00000112
Unknown + 0x08054621
NS_ShutdownXPCOM(nsIServiceManager *) + 0x0000018a
nsServiceManager::ShutdownGlobalServiceManager(nsIServiceManager **) +
0x00000041
nsServiceManagerImpl::Release(void) + 0x0000009f
nsServiceManagerImpl::~nsServiceManagerImpl(void) + 0x00000044
nsObjectHashtable::~nsObjectHashtable(void) + 0x0000002b
nsObjectHashtable::Reset(void) + 0x00000028
nsHashtable::Reset(int (*)(nsHashKey *, void *, void *), void *) + 0x00000041
PL_HashTableEnumerateEntries + 0x0000008c
nsHashtable::Enumerate(int (*)(nsHashKey *, void *, void *), void *) +
0x00000087
nsServiceEntry::NotifyListeners(void) + 0x00000191
nsNetModuleMgr::Release(void) + 0x00000097
nsNetModuleMgr::~nsNetModuleMgr(void) + 0x0000003b
nsSupportsArray::Release(void) + 0x00000091
nsSupportsArray::~nsSupportsArray(void) + 0x0000002a
nsSupportsArray::DeleteArray(void) + 0x00000025
nsSupportsArray::Clear(void) + 0x0000004e
nsNetModRegEntry::Release(void) + 0x0000009b
nsNetModRegEntry::~nsNetModRegEntry(void) + 0x0000006c
nsCOMPtr<nsINetNotify>::~nsCOMPtr(void) + 0x00000067
nsProxyEventObject::Release(void) + 0x00000099
nsProxyEventObject::~nsProxyEventObject(void) + 0x0000009b
nsProxyObjectManager::GetInstance(void) + 0x0000003f
nsProxyObjectManager::nsProxyObjectManager(void) + 0x00000090
nsHashtable::nsHashtable(unsigned int, int) + 0x0000003d

As you can see, when destroying a nsProxyEventObject, we are requesting a
nsProxyObjecManager. The code which does this is at nsProxyEventObject.cpp:324.
The problem lies in we were using a normal pointer to hold the new one which was
being created, as the normal one was already destroyed. Changing that pointer to
an nsCOMPtr (or releasing at end) fixes it. Patch included. 

This only reduces noise, but for me that is good enough. I have to wade trough
so much noise I´m going nuts.
Adding PATCH keyword for easier querying.
Keywords: patch
Adding mlk keyword, I did yesterday but somehow it did not get trough.
Keywords: mlk
Target Milestone: --- → M18
There appear to be at least one other place in this source file where the same 
problem is occurring, but the patch only fixes one of them.  Is there a reason 
for this?
Yep, that I´m trying to fix every leak I find in the refcnt balancer logs, not
revising every source file, so the order of the fixes will not be neccessarily
the same.
Status: NEW → ASSIGNED
Keywords: nsbeta3
dup.


*** This bug has been marked as a duplicate of 44680 ***
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
- Per last comments and no reopen - Marking Verified/Duplicate.
- Duplicate bug # 44680 was marked verified fixed
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: