[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] 1.0.8 Memory leaks . . . and fixes

From: Chris Allegretta
Subject: Re: [Nano-devel] 1.0.8 Memory leaks . . . and fixes
Date: Thu, 21 Mar 2002 21:09:52 -0500
User-agent: Mutt/1.3.25i

On Sun, Feb 17, 2002 at 01:30:30PM -0800, Steven Kneizys wrote:
> I got a copy of 'zmalloc' on the web, and made changes, additions,
> corrections (fixed a bug in a debugging tool! ;-)  Zmalloc basically
> uses macros to redefine standard memory calls to be redirected to its
> own routines that keep track of the calls to allocate and free memory.
> It reports such things as re-freeing a previously freed buffer and
> unfreed buffers and mild buffer over(under)runs.
> Two of the things I added to zmalloc were the realloc and getcwd
> functions, and created zmalloc-friendly versions of some of the utils
> routines.  It originally reported the source of memory allocations as
> the utils routines, and I needed to know where those routines were
> being called.  
> I hooked it up to 1.1.1, it helped me find the 'null_at' bug that has
> been previously fixed for example, as well as many other leaks.  I
> hooked it up to 1.0.8 and found lots of leaks.  After some tweaking of
> the code I got all of the ones I observed fixed, there may be more ;-)
> I created a routine 'thanks_for_the_memories' that does cleanup at the
> end, perhaps it should be called at other places when nano leaves in
> error (last thing called, couldn't hurt maybe?)

Hi Steven,

        I figured I should get back to this eventually ;) I didn't apply
the 1.0 branch patch yet because there appear to be some issues (when
compiled with -Wall), but I think that was a simple matter of changing
the 'ret' variable to a char * instead of an int.  However, after that I
tried linking with -lefence to make sure nothing out of the ordinary
happened, and selecting a file from the browser bombed with a corrupted
string somewhere.  It seems like something's getting trampled.  I'll try
to have a look at it again, and if I missed a more recent version of the
patch for 1.0 I apologize.

Chris A
Chris Allegretta

"Share and Enjoy" - Douglas Adams, 1952 - 2001

reply via email to

[Prev in Thread] Current Thread [Next in Thread]