Closed
Bug 399112
Opened 17 years ago
Closed 13 years ago
leaking a JSThread
Categories
(Toolkit :: Startup and Profile System, defect, P4)
Toolkit
Startup and Profile System
Tracking
()
RESOLVED
WORKSFORME
mozilla1.9
People
(Reporter: sayrer, Unassigned)
References
Details
(Keywords: memory-leak, Whiteboard: [missed 1.9 checkin])
Attachments
(3 files)
libumem shows we're leaking a JSThread on every shutdown.
Reporter | ||
Comment 1•17 years ago
|
||
Comment 2•17 years ago
|
||
Is this a similar|same leak?
Comment 3•17 years ago
|
||
wtc, can you remind me (or timeless may if he's watching) why the main thread's js_ThreadDestructorCB might not be running, in time or at all? Thanks,
/be
Comment 4•17 years ago
|
||
The main thread's NSPR thread private data destructors will only be
run if you call PR_Cleanup().
The main thread's pthread thread specific data destructors will only be
run if you call pthread_exit(). If you just fall off the main() function,
the pthread thread specific data destructors won't be called.
Comment 5•17 years ago
|
||
Cc'ing bsmedberg -- is this a dup? If not, it needs to change component.
/be
Comment 6•17 years ago
|
||
Trace malloc leaks increased substantially with the landing of bug 365851.
Flags: blocking1.9?
OS: SunOS → All
Priority: -- → P1
Hardware: PC → All
Version: unspecified → Trunk
Comment 7•17 years ago
|
||
Seems like a bug in browser/app/nsBrowserApp.cpp. Patch next.
/be
Assignee: general → nobody
Component: JavaScript Engine → General
Flags: blocking1.9?
Product: Core → Firefox
QA Contact: general → general
Updated•17 years ago
|
Flags: blocking-firefox3?
Comment 8•17 years ago
|
||
bsmedberg, I welcome your opinion too -- feel free to steal this bug if there is a app-generic fix in toolkit or XPCOM.
/be
Attachment #302079 -
Flags: review?
Updated•17 years ago
|
Attachment #302079 -
Flags: review? → review?(mconnor)
Updated•17 years ago
|
Component: General → Startup and Profile System
QA Contact: general → startup
Comment 9•17 years ago
|
||
Comment on attachment 302079 [details] [diff] [review]
fix, according to gdb
r+a=me, straightforward enough
Attachment #302079 -
Flags: review?(mconnor)
Attachment #302079 -
Flags: review+
Attachment #302079 -
Flags: approval1.9+
Comment 10•17 years ago
|
||
Comment on attachment 302079 [details] [diff] [review]
fix, according to gdb
Brendan, we actually added a _fini routine to libnspr4.so
that calls the NSPR thread private data destructors for
the main thread for several months. But that caused crashes
in application code. We fixed one or two crashes. But
the third crash, I decided that applications are used to
NSPR not calling the main thread's TPD destructors, and
removed that code. See bug 383977.
So I'm worried that your patch will have the same fate.
Also note that after you shut down NSPR, you need to make
sure no destructors of C++ static variables and no atexit
handlers use NSPR. This is actually why Mozilla is not
calling PR_Cleanup.
Updated•17 years ago
|
Flags: blocking-firefox3? → blocking-firefox3+
Priority: P1 → P2
Target Milestone: --- → Firefox 3 beta4
Comment 11•17 years ago
|
||
We do want to destroy the JSThreads mapped by JS's thread-private index, for sane leak accounting. Probably other stuff like that (XPConnect, etc.). What to do?
/be
Flags: blocking-firefox3+ → blocking-firefox3?
Priority: P2 → P1
Target Milestone: Firefox 3 beta4 → ---
Updated•17 years ago
|
Target Milestone: --- → Firefox 3 beta4
Comment 12•17 years ago
|
||
Is there a JS_cleanup function which can set/sets the thread-private value to null? See bug 349463 which solves a reverse xpconnect bug by *not* cleaning up threads after a certain point if we haven't shut them down correctly by then.
Updated•17 years ago
|
Flags: blocking-firefox3? → blocking-firefox3+
Updated•17 years ago
|
Priority: P1 → P3
Updated•17 years ago
|
Target Milestone: Firefox 3 beta4 → Firefox 3
Updated•17 years ago
|
Priority: P3 → P4
Comment 13•17 years ago
|
||
Not blocking on this bug for final ship. Would take a safe enough patch if one comes through.
Flags: wanted-firefox3+
Flags: blocking-firefox3-
Flags: blocking-firefox3+
Updated•17 years ago
|
Whiteboard: [missed 1.9 checkin]
Comment 14•17 years ago
|
||
Comment on attachment 302079 [details] [diff] [review]
fix, according to gdb
Removing approval since this missed the 1.9 cutoff.
Attachment #302079 -
Flags: approval1.9+
Assignee | ||
Updated•16 years ago
|
Product: Firefox → Toolkit
Comment 15•13 years ago
|
||
Is this still wanted?
Comment 16•13 years ago
|
||
This was fixed quite some time ago in another bug.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•