blob: e8c1c5a6e156238eedb2b9d0d23420c4b1a2b685 [file] [log] [blame]
sewardjde4a1d02002-03-22 01:27:54 +00001
nethercote5da1e172003-12-03 21:44:45 +00002Release notes for Valgrind
3~~~~~~~~~~~~~~~~~~~~~~~~~~
nethercoteed7e0732003-12-02 15:30:28 +00004If you are building a binary package of Valgrind for distribution,
5please read README_PACKAGERS. It contains some important information.
sewardj365a8512002-07-01 08:30:05 +00006
nethercoteed7e0732003-12-02 15:30:28 +00007If you are developing Valgrind, please read README_DEVELOPERS. It contains
8some useful information.
9
10For instructions on how to build/install, see the end of this file.
sewardjde4a1d02002-03-22 01:27:54 +000011
nethercote5da1e172003-12-03 21:44:45 +000012Valgrind works on most, reasonably recent Linux setups. If you have
13problems, consult FAQ.txt to see if there are workarounds.
sewardjde4a1d02002-03-22 01:27:54 +000014
15Executive Summary
16~~~~~~~~~~~~~~~~~
njna2488752005-07-26 22:33:26 +000017Valgrind is an award-winning suite of tools for debugging and profiling
18Linux programs. With the tools that come with Valgrind, you can
19automatically detect many memory management and threading bugs, avoiding
20hours of frustrating bug-hunting, making your programs more stable. You can
21also perform detailed profiling, to speed up and reduce memory use of your
22programs.
sewardjde4a1d02002-03-22 01:27:54 +000023
njn567c0142006-03-31 12:24:37 +000024The Valgrind distribution currently includes four tools: a memory error
25detector, a thread error detector, a cache profiler and a heap profiler.
nethercote5da1e172003-12-03 21:44:45 +000026
27To give you an idea of what Valgrind tools do, when a program is run
njn567c0142006-03-31 12:24:37 +000028under the supervision of Memcheck, the memory error detector tool, all
29reads and writes of memory are checked, and calls to malloc/new/free/delete
30are intercepted. As a result, Memcheck can detect if your program:
nethercote5da1e172003-12-03 21:44:45 +000031
njn567c0142006-03-31 12:24:37 +000032 - Accesses memory it shouldn't (areas not yet allocated, areas that have
33 been freed, areas past the end of heap blocks, inaccessible areas of
34 the stack).
35
36 - Uses uninitialised values in dangerous ways.
37
38 - Leaks memory.
39
40 - Does bad frees of heap blocks (double frees, mismatched frees).
41
42 - Passes overlapping source and destination memory blocks to memcpy() and
43 related functions.
sewardjde4a1d02002-03-22 01:27:54 +000044
nethercoteed7e0732003-12-02 15:30:28 +000045Problems like these can be difficult to find by other means, often
46lying undetected for long periods, then causing occasional,
nethercote5da1e172003-12-03 21:44:45 +000047difficult-to-diagnose crashes. When one of these errors occurs, you can
48attach GDB to your program, so you can poke around and see what's going
49on.
sewardjde4a1d02002-03-22 01:27:54 +000050
51Valgrind is closely tied to details of the CPU, operating system and
52to a less extent, compiler and basic C libraries. This makes it
njn0d733b82005-07-26 22:01:04 +000053difficult to make it portable. Nonetheless, it is available for
54the following platforms: x86/Linux, AMD64/Linux and PPC32/Linux.
sewardjde4a1d02002-03-22 01:27:54 +000055
56Valgrind is licensed under the GNU General Public License, version 2.
njn25e49d8e72002-09-23 09:36:25 +000057Read the file COPYING in the source distribution for details.
sewardjde4a1d02002-03-22 01:27:54 +000058
59
60Documentation
61~~~~~~~~~~~~~
62A comprehensive user guide is supplied. Point your browser at
nethercote5da1e172003-12-03 21:44:45 +000063$PREFIX/share/doc/valgrind/manual.html, where $PREFIX is whatever you
64specified with --prefix= when building.
sewardjde4a1d02002-03-22 01:27:54 +000065
66
nethercoteed7e0732003-12-02 15:30:28 +000067Building and installing it
68~~~~~~~~~~~~~~~~~~~~~~~~~~
njn0d733b82005-07-26 22:01:04 +000069To install from the Subversion repository :
nethercoteed7e0732003-12-02 15:30:28 +000070
njn0d733b82005-07-26 22:01:04 +000071 0. Check out the code from SVN, following the instructions at
njn1b70e822005-11-08 19:38:58 +000072 http://www.valgrind.org/downloads/repository.html.
nethercoteed7e0732003-12-02 15:30:28 +000073
74 1. cd into the source directory.
75
76 2. Run ./autogen.sh to setup the environment (you need the standard
77 autoconf tools to do so).
78
njn0d733b82005-07-26 22:01:04 +000079 3. Continue with the following instructions...
80
nethercote5da1e172003-12-03 21:44:45 +000081To install from a tar.bz2 distribution:
nethercoteed7e0732003-12-02 15:30:28 +000082
njn0d733b82005-07-26 22:01:04 +000083 4. Run ./configure, with some options if you wish. The standard
nethercoteed7e0732003-12-02 15:30:28 +000084 options are documented in the INSTALL file. The only interesting
85 one is the usual --prefix=/where/you/want/it/installed.
86
njn0d733b82005-07-26 22:01:04 +000087 5. Do "make".
nethercoteed7e0732003-12-02 15:30:28 +000088
njn0d733b82005-07-26 22:01:04 +000089 6. Do "make install", possibly as root if the destination permissions
nethercoteed7e0732003-12-02 15:30:28 +000090 require that.
91
njn0d733b82005-07-26 22:01:04 +000092 7. See if it works. Try "valgrind ls -l". Either this works, or it
93 bombs out with some complaint. In that case, please let us know
94 (see www.valgrind.org).
nethercoteed7e0732003-12-02 15:30:28 +000095
96Important! Do not move the valgrind installation into a place
97different from that specified by --prefix at build time. This will
98cause things to break in subtle ways, mostly when Valgrind handles
99fork/exec calls.
100
sewardjde4a1d02002-03-22 01:27:54 +0000101
njn1b70e822005-11-08 19:38:58 +0000102The Valgrind Developers