blob: 3cb204e53a56bfffa966fb5f510cea656565ddf3 [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~~~~~~~~~~~~~~~~~
nethercote5da1e172003-12-03 21:44:45 +000017Valgrind is a GPL'd system for debugging and profiling x86-Linux programs.
18With the tools that come with Valgrind, you can automatically detect
19many memory management and threading bugs, avoiding hours of frustrating
20bug-hunting, making your programs more stable. You can also perform
21detailed profiling to help speed up your programs.
sewardjde4a1d02002-03-22 01:27:54 +000022
nethercote0635b722004-04-16 07:25:32 +000023The Valgrind distribution includes five tools: two memory error
nethercote075a1022004-04-10 00:36:25 +000024detectors, a thread error detector, a cache profiler and a heap profiler.
25Several other tools have been built with Valgrind.
nethercote5da1e172003-12-03 21:44:45 +000026
27To give you an idea of what Valgrind tools do, when a program is run
28under the supervision of the first memory error detector tool, all reads
29and writes of memory are checked, and calls to malloc/new/free/delete
30are intercepted. As a result, it can detect problems such as:
31
32 Use of uninitialised memory
33 Reading/writing memory after it has been free'd
34 Reading/writing off the end of malloc'd blocks
35 Reading/writing inappropriate areas on the stack
nethercoteed7e0732003-12-02 15:30:28 +000036 Memory leaks -- where pointers to malloc'd blocks are lost forever
37 Passing of uninitialised and/or unaddressible memory to system calls
nethercote5da1e172003-12-03 21:44:45 +000038 Mismatched use of malloc/new/new [] vs free/delete/delete []
39 Overlaps of arguments to strcpy() and related functions
nethercoteed7e0732003-12-02 15:30:28 +000040 Some abuses of the POSIX pthread API
sewardjde4a1d02002-03-22 01:27:54 +000041
nethercoteed7e0732003-12-02 15:30:28 +000042Problems like these can be difficult to find by other means, often
43lying undetected for long periods, then causing occasional,
nethercote5da1e172003-12-03 21:44:45 +000044difficult-to-diagnose crashes. When one of these errors occurs, you can
45attach GDB to your program, so you can poke around and see what's going
46on.
sewardjde4a1d02002-03-22 01:27:54 +000047
48Valgrind is closely tied to details of the CPU, operating system and
49to a less extent, compiler and basic C libraries. This makes it
50difficult to make it portable, so I have chosen at the outset to
nethercote5da1e172003-12-03 21:44:45 +000051concentrate on what I believe to be a widely used platform: x86/Linux.
sewardjde4a1d02002-03-22 01:27:54 +000052
53Valgrind is licensed under the GNU General Public License, version 2.
njn25e49d8e72002-09-23 09:36:25 +000054Read the file COPYING in the source distribution for details.
sewardjde4a1d02002-03-22 01:27:54 +000055
56
57Documentation
58~~~~~~~~~~~~~
59A comprehensive user guide is supplied. Point your browser at
nethercote5da1e172003-12-03 21:44:45 +000060$PREFIX/share/doc/valgrind/manual.html, where $PREFIX is whatever you
61specified with --prefix= when building.
sewardjde4a1d02002-03-22 01:27:54 +000062
63
nethercoteed7e0732003-12-02 15:30:28 +000064Building and installing it
65~~~~~~~~~~~~~~~~~~~~~~~~~~
66To install from CVS :
67
68 0. Check out the code from CVS, following the instructions at
69 http://developer.kde.org/source/anoncvs.html. The 'modulename' is
70 "valgrind".
71
72 1. cd into the source directory.
73
74 2. Run ./autogen.sh to setup the environment (you need the standard
75 autoconf tools to do so).
76
nethercote5da1e172003-12-03 21:44:45 +000077To install from a tar.bz2 distribution:
nethercoteed7e0732003-12-02 15:30:28 +000078
79 3. Run ./configure, with some options if you wish. The standard
80 options are documented in the INSTALL file. The only interesting
81 one is the usual --prefix=/where/you/want/it/installed.
82
83 4. Do "make".
84
85 5. Do "make install", possibly as root if the destination permissions
86 require that.
87
nethercote3b41a5b2004-04-21 09:17:19 +000088 6. See if it works. Try "valgrind --tool=memcheck ls -l". Either
nethercote71a941e2004-04-21 07:22:50 +000089 this works, or it bombs out with some complaint. In that case,
90 please let us know (see valgrind.kde.org/bugs.html).
nethercoteed7e0732003-12-02 15:30:28 +000091
92Important! Do not move the valgrind installation into a place
93different from that specified by --prefix at build time. This will
94cause things to break in subtle ways, mostly when Valgrind handles
95fork/exec calls.
96
sewardjde4a1d02002-03-22 01:27:54 +000097
sewardjde4a1d02002-03-22 01:27:54 +000098Julian Seward (jseward@acm.org)
njn2bc10122005-05-08 02:10:27 +000099Nick Nethercote (njn@valgrind.org)
nethercote5da1e172003-12-03 21:44:45 +0000100Jeremy Fitzhardinge (jeremy@goop.org)