Closed
Bug 73053
Opened 23 years ago
Closed 15 years ago
Lea memory allocator breaks in most Unices
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: jesup, Unassigned)
References
Details
(Keywords: crash, memory-leak)
Attachments
(3 files)
5.26 KB,
patch
|
Details | Diff | Splinter Review | |
4.79 KB,
patch
|
Details | Diff | Splinter Review | |
174.82 KB,
text/plain
|
Details |
The Lea memory allocator (--enable-lea) doesn't deal with startup issues properly. malloc() calls pthread_mutex_lock(), which calls pthread_mutex_init(), which calls malloc()... Boom, pthread calls exit(). The solution is to not call pthread_mutex_lock until the lock has been initialized. I used a very general procedure patterned after dmalloc (www.dmalloc.com), but not exactly the same (more general, minimal extra overhead at runtime). --enable-lea now works with FreeBSD 4.1-STABLE. It should work with any pthreads system; perhaps requiring tuning of the thread-lock_count and THREAD_INIT_LOCK values. (I was pretty conservative with the current values.)
Reporter | ||
Comment 1•23 years ago
|
||
Reporter | ||
Comment 2•23 years ago
|
||
Reassigning to kandrot, cc waterson Adding crash (since it crashes with --enable-lea on most Unixes) Nominating for mozilla0.8.1 (it's a pretty safe patch, and only affects --enable-lea).
Comment 3•23 years ago
|
||
How about diff -u? My eyes hurt. /be
Reporter | ||
Comment 4•23 years ago
|
||
Reporter | ||
Comment 5•23 years ago
|
||
BTW, a note that should be made somewhere is that to use LEA currently, you need to "setenv LD_PRELOAD whatever/libxpcom.so" (or sh equivalent) before running it. Running it in GDB is even more fun (but possible). Alternate memory allocators (Lea or PHK's) should be statically linked into the main executable to avoid massive hassles; they should not be part of xpcom (it's too late).
Comment 6•23 years ago
|
||
Maybe someone could r=/sr= the patch in here?
Keywords: mozilla0.8.1
Summary: Lea memory allocator breaks in most Unixes → Lea memory allocator breaks in most Unices
Comment 7•23 years ago
|
||
Thanks for the patch. There are two other bugs that currently interfere with me applying this patch: lea currently crashes on Linux (ie so therefore Lea currently does not work at all now), and there is a newer version of Lea. I will look into how to add this patch into the new Lea and see if it fixes the general crashes that other people are now seeing.
Status: NEW → ASSIGNED
Reporter | ||
Comment 8•23 years ago
|
||
"Crashes on Linux" - are you sure it still crashes with this patch if you do the LD_PRELOAD magic I mention? Without both the patch and the LD_PRELOAD, it _will_ crash on any system.
Reporter | ||
Comment 9•23 years ago
|
||
Any movement on getting the latest Lea allocator in?
Reporter | ||
Comment 10•23 years ago
|
||
nominating for 0.9.4 to try to get something to move here (I would nominate for 0.9.5 but that's not a valid keyword)
Keywords: mozilla0.9.4
Comment 11•23 years ago
|
||
I now have a build with 2.7.0 in and it seems to work. I want to verify it, and I guess I need r=, sr= to get it checked in. I will append 2.7.0, with out the changes for pthread, since so it will be a clean Lea 2.7.0. Once that is approved, then we should be able to get the changes approved, if they are still valid for 2.7.0.
Comment 12•23 years ago
|
||
Reporter | ||
Comment 13•23 years ago
|
||
Reassigning to waterson (Chris, feel free to reassign again. I'd take this if I can get our legal dept to approve my CVS access form.) Sounds like this is pretty much ready for checkin anyways. r=? sr=?
Assignee: kandrot → waterson
Status: ASSIGNED → NEW
Reporter | ||
Comment 14•23 years ago
|
||
Since it's been 3 months, I'm taking this one. I'll give the 2.7.0 patch a spin under Linux & BSD and then ask for reviews. Adding mlk to put it on memory-use radar, though it's not really a "leak"
Comment 15•22 years ago
|
||
Lea 2.7 is bug 72497. Since this one is targeted at 0.9.7, and that one is targeted at 0.9.8, I think someone needs to update both :-)
Reporter | ||
Updated•22 years ago
|
Target Milestone: mozilla0.9.7 → mozilla1.0
Comment 16•22 years ago
|
||
By the definitions on <http://bugzilla.mozilla.org/bug_status.html#severity> and <http://bugzilla.mozilla.org/enter_bug.cgi?format=guided>, crashing and dataloss bugs are of critical or possibly higher severity. Only changing open bugs to minimize unnecessary spam. Keywords to trigger this would be crash, topcrash, topcrash+, zt4newcrash, dataloss.
Severity: major → critical
Comment 17•21 years ago
|
||
*** Bug 191979 has been marked as a duplicate of this bug. ***
Updated•21 years ago
|
Target Milestone: mozilla1.0 → ---
Updated•18 years ago
|
QA Contact: kandrot → nobody
Updated•18 years ago
|
Assignee: rjesup → nobody
QA Contact: nobody → xpcom
Comment 18•15 years ago
|
||
shaver, OK to close?
Fine with me.
Comment 20•15 years ago
|
||
(In reply to comment #15) > Lea 2.7 is bug 72497. Since this one is targeted at 0.9.7, and that one is > targeted at 0.9.8, I think someone needs to update both :-) => wontfix, given that bug 72497 is wontfix
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•