Re: [SYSTEM-LINUX] Finding Memory Leaks : Help please.

From: Welcor (welcor@dune.net)
Date: 01/31/02


----- Original Message -----
From: "Justin Adler" <spam@WORLD-DOMINATION.COM.AU>


> Hello All.
>
>    So my question is this ->  Has anyone tried tried using a Memory Leak
> finding program with their circlemud code?
>
What you need to do, is to link in electric fence in your mud.
Electric fence is a library that takes over handling of memory allocation,
and checks if you index out of range, overflow, underrun, etc.

To use it:
edit your makefile,

LIBS = -lefence

make your binary, and run it through gdb.

now, if you have any major memory leaks, it will be sure to tell you where
they are. Actually the program crashes instead of ignoring buffer overruns,
indexing out of range, etc, and so forth, giving you a nice backtrace to
work from.

However, since efence uses a lot of memory you might want to either run the
mud in mini mode (-m), or use a select small world (edit the indexes in
the world file dirs). The latter is prefered, as spec procs aren't loaded
in mini mode, and thus you aren't checking those for memory problems.

When you've got the fenced mud up and running, be sure to test out every
command you have. You never know which part of the code is your problem...

If you haven't got electric fence on your shell, I'm pretty sure a search
in the archives will give you a download link.

Welcor

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT