This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Doug Lea's malloc implementation?
- From: Bart Veer <bartv at ecoscentric dot com>
- To: npyatkov at usa dot net
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Sun, 11 Aug 2002 16:33:57 +0100 (BST)
- Subject: Re: [ECOS] Doug Lea's malloc implementation?
- References: <0H0M00DSP529BI@mtaout01.icomcast.net>
>>>>> "Nikolay" == Nikolay V Pyatkov <npyatkov@usa.net> writes:
Nikolay> I was debugging GoAhead web server on linux synthetic
Nikolay> target. It was crashing in the middle of the first page
Nikolay> transfer. I traced the problem to free() in the "Doug
Nikolay> Lea's malloc implementation". The values to the free
Nikolay> looks fine. At the top of the stack was allocation of 4
Nikolay> bytes and free of the same 4 bytes. I could not get any
Nikolay> useful information from the dbg. I removed -O2. The same
Nikolay> result.
Nikolay> But after selecting "Simple variable block
Nikolay> implementation" instead of " Doug Lea's malloc
Nikolay> implementation" and recompiling the kernel everything
Nikolay> works just fine.
Nikolay> Did anyone see any problems with this package or it is
Nikolay> just my setup?
The Doug Lea malloc implementation is known to be pretty solid, and is
further stress-tested by the various tests in the services/memalloc
package (especially malloc4). However if there is a bug somewhere in
the application, for example a double free on a region of memory, then
you may well see different behaviour from the different allocators.
With one allocator such a bug might go unnoticed (assuming the freed
memory has not yet been reallocated), while with another allocator it
might cause immediate memory corruption. Make sure you are running
with CYGDBG_MEMALLOC_ALLOCATOR_DLMALLOC_DEBUG enabled, that may help
find the problem.
Bart
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss