nsProxyObjectManager leaked during shutdown, noise reduction PATCH INCLUDED

VERIFIED DUPLICATE of bug 44680

Status

()

P3
normal
VERIFIED DUPLICATE of bug 44680
19 years ago
18 years ago

People

(Reporter: inaky.gonzalez, Assigned: rayw)

Tracking

({memory-leak})

Trunk
x86
Linux
memory-leak
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

19 years ago
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.
(Reporter)

Comment 1

19 years ago
Created attachment 10430 [details] [diff] [review]
Patch to fix shutdown noise on nsProxyEventObject (fixes nsProxyManager and nsHashtables)

Comment 2

19 years ago
Adding PATCH keyword for easier querying.
Keywords: patch
(Reporter)

Comment 3

19 years ago
Adding mlk keyword, I did yesterday but somehow it did not get trough.
Keywords: mlk

Updated

19 years ago
Target Milestone: --- → M18
(Assignee)

Comment 4

19 years ago
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?
(Reporter)

Comment 5

19 years ago
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.
(Assignee)

Updated

19 years ago
Status: NEW → ASSIGNED

Updated

19 years ago
Keywords: nsbeta3

Comment 6

19 years ago
dup.


*** This bug has been marked as a duplicate of 44680 ***
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → DUPLICATE

Comment 7

18 years ago
- 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.