This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: alloca is bad?


> From: Michael Meissner <meissner@cygnus.com>
> Date: Sun, 12 Nov 2000 20:00:34 -0500
> 
> For malloc overruns, I typically just link in with -lefence or other
> tools, and it is fairly obvious where the bug is.

Except that there are programs where using Efence or similar tools is
impractical, because these libraries typically don't free memory when
the application calls `free' (to catch code which writes into free'd
memory).  This enlarges the memory footprint of such programs to the
extent that you cannot link with -lefence, because the program won't
run for more than a few moments, or not at all.

I'd expect GDB to be one of the programs where this approach is not
very practical, what with all the malloc'ing that goes on there.

In fact, we have such an elusive memory problem right now in Emacs
development sources.  It's been a couple of months since it was first
reported, and all of the Emacs developers have been hunting it ever
since, including lots of special-purpose code that was written
specifically for catching that bug.  The bug is still at large...

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]