blob: a43d291a6883b35b4bebe4146cde6e85f3ab6d19 [file] [log] [blame]
sewardjde4a1d02002-03-22 01:27:54 +00001
2Release notes for Valgrind, snapshot 20020217
3~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
5KDE3 developers: please read also README_KDE3_FOLKS for guidance
6about how to debug KDE3 applications with Valgrind.
7
8For instructions on how to build/install, see the end of this file.
9
10
11Executive Summary
12~~~~~~~~~~~~~~~~~
13Valgrind is a tool to help you find memory-management problems in your
14programs. When a program is run under Valgrind's supervision, all
15reads and writes of memory are checked, and calls to
16malloc/new/free/delete are intercepted. As a result, Valgrind can
17detect problems such as:
18
19 Use of uninitialised memory
20 Reading/writing memory after it has been free'd
21 Reading/writing off the end of malloc'd blocks
22 Reading/writing inappropriate areas on the stack
23 Memory leaks -- where pointers to malloc'd blocks are lost forever
24 Passing of uninitialised and/or unaddressible memory to system calls
25 Mismatched use of malloc/new/new [] vs free/delete/delete []
26
27Problems like these can be difficult to find by other means, often
28lying undetected for long periods, then causing occasional,
29difficult-to-diagnose crashes.
30
31When Valgrind detects such a problem, it can, if you like, attach GDB
32to your program, so you can poke around and see what's going on.
33
34Valgrind is closely tied to details of the CPU, operating system and
35to a less extent, compiler and basic C libraries. This makes it
36difficult to make it portable, so I have chosen at the outset to
37concentrate on what I believe to be a widely used platform: Red Hat
38Linux 7.2, on x86s. I believe that it will work without significant
39difficulty on other x86 GNU/Linux systems which use the 2.4 kernel and
40GNU libc 2.2.X, for example SuSE 7.1 and Mandrake 8.0. Red Hat 6.2 is
41also supported. It has worked in the past, and probably still does,
42on RedHat 7.1 and 6.2. Note that I haven't compiled it on RedHat 7.1
43and 6.2 for a while, so they may no longer work now.
44
45Valgrind is licensed under the GNU General Public License, version 2.
46Read the file LICENSE in the source distribution for details.
47
48
49Documentation
50~~~~~~~~~~~~~
51A comprehensive user guide is supplied. Point your browser at
52docs/index.html. If your browser doesn't like frames, point it
53instead at docs/manual.html.
54
55
56Building and installing it
57~~~~~~~~~~~~~~~~~~~~~~~~~~
sewardjde4a1d02002-03-22 01:27:54 +000058
gobrye721a522002-03-22 13:38:30 +000059If you install from CVS :
sewardjde4a1d02002-03-22 01:27:54 +000060
gobrye721a522002-03-22 13:38:30 +000061 0. cd into the source directory
sewardjde4a1d02002-03-22 01:27:54 +000062
gobrye721a522002-03-22 13:38:30 +000063 1. Run ./autogen.sh to setup the environment (you need the standard
64 autoconf tools to do so)
sewardjde4a1d02002-03-22 01:27:54 +000065
gobrye721a522002-03-22 13:38:30 +000066If you install from a tar.gz archive:
sewardjde4a1d02002-03-22 01:27:54 +000067
gobrye721a522002-03-22 13:38:30 +000068 2. Run ./configure, with some options if you wish. The standard
69 options are documented in the INSTALL file.
70
71 3. Do "make"
72
73 4. As root, do "make install"
74
75 5. See if it works. Try "valgrind ls -l". Either this works,
76 or it bombs out complaining it can't find argc/argv/envp.
77 If this happens, you'll have to futz around with
78 vg_main.c:710 to vg_main.c:790 to try and find suitable offsets.
79 It's not hard; many have been successful here.
80
81Once step 5 is successful, you can now use valgrind. Documentation
sewardjde4a1d02002-03-22 01:27:54 +000082is in docs/manual.html. The following auxiliary steps may enhance
83your valgrinding experience, though.
84
gobry69896d52002-04-05 06:56:07 +0000856. Create a file containing enough suppressions so that
gobry59528b22002-04-05 07:02:00 +000086
87 valgrind xedit
88
sewardjde4a1d02002-03-22 01:27:54 +000089 runs without generating any errors. This means you've more
90 or less suppressed all the scummy errors from the X11 base
91 libraries and from glibc, which will make it easier to spot
gobry69896d52002-04-05 06:56:07 +000092 genuine errors in your own code. The default.supp file
93 should contains a good starting point. Do *not* edit this file
94 however, as it will be overwritten at the next installation of
gobrydef1bad2002-04-11 06:58:55 +000095 valgrind, but create your own local.supp file.
gobry69896d52002-04-05 06:56:07 +000096
sewardjde4a1d02002-03-22 01:27:54 +000097
sewardjde4a1d02002-03-22 01:27:54 +000098Julian Seward (jseward@acm.org)
9915 Feb 2002