Closed Bug 73053 Opened 23 years ago Closed 15 years ago

Lea memory allocator breaks in most Unices

Categories

(Core :: XPCOM, defect)

x86
All
defect
Not set
critical

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jesup, Unassigned)

References

Details

(Keywords: crash, memory-leak)

Attachments

(3 files)

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.)
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).

Assignee: scc → kandrot
Severity: normal → major
How about diff -u?  My eyes hurt.

/be
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).
Depends on: 72497
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
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
"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.
Any movement on getting the latest Lea allocator in?
Blocks: 71814
Blocks: 71874
No longer blocks: 71814
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
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.
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
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"
Assignee: waterson → rjesup
Keywords: mozilla0.9.4mlk
Target Milestone: --- → mozilla0.9.7
Blocks: 92580
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 :-)
Target Milestone: mozilla0.9.7 → mozilla1.0
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
*** Bug 191979 has been marked as a duplicate of this bug. ***
Target Milestone: mozilla1.0 → ---
QA Contact: kandrot → nobody
Assignee: rjesup → nobody
QA Contact: nobody → xpcom
shaver, OK to close?
(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.

Attachment

General

Created:
Updated:
Size: