gnu-quality
[Top][All Lists]
Advanced

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

Re: [gnu-quality] valgrind


From: Simon Josefsson
Subject: Re: [gnu-quality] valgrind
Date: Tue, 16 Nov 2010 18:40:43 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux)

Thanks Karl for getting things up and running!

address@hidden (Karl Berry) writes:

> - how to valgrind to track serious memory bugs

Small starting pointer below.

I'm not sure what format to use.  A texinfo document seems overkill for
this, but a text file seems to simple.

/Simon

Valgrind
--------

Valgrind (http://valgrind.org/) is a dynamic analysis tool, which means
it is used during run-time and without any re-compilation.  It is
typically only useful to check compiled languages that supports
low-level memory management, like C and C++.  Valgrind can find many
memory management and threading bugs.  The simplest way is to run
Valgrind manually on your application, for example:

$ valgrind ./foo --bar

It will print out a human readable summary.

Automatic use of Valgrind for self-checks
-----------------------------------------

Gnulib contains a module called "valgrind" which provides a
"valgrind-tests.m4" file that will search for the valgrind tool and
provides the VALGRIND variable to contain commands used to launch it.
By default it runs valgrind in quiet mode to avoid output when there is
no problem.  The variable can be used in your tests/Makefile.am like
this:

TESTS_ENVIRONMENT = $(VALGRIND)

This will cause all your self-tests to be run under Valgrind.  Any
serious bug will trigger an error message.



reply via email to

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