[Gllug] Memory Leak Detecting

Daniel P. Berrange dan at berrange.com
Mon Aug 29 12:02:25 UTC 2005


On Mon, Aug 29, 2005 at 07:47:42PM +0100, Nix wrote:
> On Sun, 28 Aug 2005, Daniel P. Berrange wrote:
> > On Sat, Aug 27, 2005 at 09:51:10PM +0100, Peter Childs wrote:
> >>     Does anyone know of any good tools for finding memory leaks other
> >> than running it through Valgrind multiple times trying to follow as many
> >> avenues as possible. I'm really lookin for some sort of Parser. As I
> >> have quite a lot off C++/Qt code I know has leaks and I would really
> >> love the find and plug them.
> > 
> > I can recommend trying out MPatrol, which not only replaces the traditional
> > C malloc/free style functions, but also C++  new/delete, and also overrides
> > core functions like memset, memcpy to protect & dectect invalid pointers
> > and buffer overflows in their use.
> 
> GCC 4.1 will introduce -fmudflap, which tries to do similar things while
> reducing erroneous warnings by applying compile-time analysis.

If you have the luxury of being able to use such a new GCC (or have
Fedora Core 3 or RHEL-4), then also go for the -DFORTIFY_SOURCE=2 
option which does compile checking of certain buffer overflow
conditions

http://www.redhat.com/magazine/009jul05/features/execshield/#checks

Regards,
Dan.
-- 
|=-            GPG key: http://www.berrange.com/~dan/gpgkey.txt       -=|
|=-       Perl modules: http://search.cpan.org/~danberr/              -=|
|=-           Projects: http://freshmeat.net/~danielpb/               -=|
|=-   berrange at redhat.com  -  Daniel Berrange  -  dan at berrange.com    -=|
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list