Closed Bug 344623 Opened 19 years ago Closed 19 years ago

Increased Rlk (leak) on balsa after landing of bug 342311

Categories

(Core :: XPCOM, defect)

x86
Linux
defect
Not set
major

Tracking

()

VERIFIED FIXED

People

(Reporter: ispiked, Assigned: benjamin)

References

Details

(Keywords: memory-leak)

Attachments

(3 files)

2212 MOZ_CO_DATE=2006:07:13:08:42:00 5572 MOZ_CO_DATE=2006:07:13:10:25:00 Checkins: http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=PhoenixTinderbox&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2006-07-13+08%3A42&maxdate=2006-07-13+10%3A25&cvsroot=%2Fcvsroot --NEW-LEAKS-----------------------------------leaks------leaks% nsProxyObject 1456 - nsUrlClassifierCallbackWrapper 400 - nsUrlClassifierDBServiceWorker 40 - nsObserverService 48 - nsXPCWrappedJS 1344 833.33% nsThread 216 200.00% xptiInterfaceInfo 60 50.00% nsXPCWrappedJSClass 132 50.00% nsStringBuffer 24 50.00%
Assignee: nobody → benjamin
http://pastebin.ca/92373 is one of many odd stacks I get from the refcnt balancer while tracing this leak. This seems extremely scary to me. Darin, how are we calling nsThread::Shutdown from a proxy, and why is it recursive?
nsThreadPool uses a proxy of nsIThread to call nsIThread::Shutdown on the "right" thread. Since nsThread::Shutdown spins the event loop, the stack you saw can happen and there shouldn't be any problems caused by it.
FWIW, I considered inventing and passing a flag to nsIThread::Shutdown to prevent it from pumping events, which would avoid these scary looking stacks in some cases, but I couldn't come up with any other justification for doing so other than that those stacks look scary.
Spins which event loop? This stack is on the main thread, right? Why does nsThread::Shutdown appear three times?
Oh, are those nsThread::Shutdown calls for different threads?
Attached patch DuhSplinter Review
I'm going to commit this as self-evident. It doesn't fix the bug, but all the nsProxyObject leaks were bogus: only the urlclassifier leaks were new.
> Oh, are those nsThread::Shutdown calls for different threads? Yes... "thread pool"
Two different refcounting issues makes it really painful to balance.
Attachment #229854 - Flags: review?(darin)
Attachment #229854 - Flags: review?(darin) → review+
Fixed on trunk.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Verifified FIXED. Before and after bsmedberg's patch: 8165 MOZ_CO_DATE=2006:07:19:08:58:00 - before 2224 MOZ_CO_DATE=2006:07:19:11:51:00 - after 2212 MOZ_CO_DATE=2006:07:19:13:04:00 - in a build where we don't randomly leak nsRunnable(s)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: