blob: 89208436eb9e15140f27c69ef7b2389c211f46e4 [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~~~~~~~~~~~~~~~~~~~~~~~~~~
58At the moment, very rudimentary.
59
60This tarball is set up for a standard Red Hat 7.2 machine. No
61configure script, no autoconf, no nothing. Do the following:
62
630. Unpack the sources and cd into the source directory.
64
651. Do "make"
66
672. See if it works. Try "./valgrind ls -l". Either this works,
68 or it bombs out complaining it can't find argc/argv/envp.
69 If this happens, you'll have to futz around with
70 vg_main.c:710 to vg_main.c:790 to try and find suitable offsets.
71 It's not hard; many have been successful here.
72
73Once step 2 is successful, you can now use valgrind. Documentation
74is in docs/manual.html. The following auxiliary steps may enhance
75your valgrinding experience, though.
76
773. Add enough suppressions to the default suppression file
78 (linux24.supp) so that
79 ./valgrind xedit
80 runs without generating any errors. This means you've more
81 or less suppressed all the scummy errors from the X11 base
82 libraries and from glibc, which will make it easier to spot
83 genuine errors in your own code.
84
85 If you are using a machine with a 2.2 kernel (RedHat 6.2,
86 or Debian) you probably will want to edit the "valgrind"
87 shell script, to select the linux22.supp suppression file
88 (uncomment line 13; comment out line 14)
89
90If any kind soul would like to contribute a basic autoconf-style
91configuration/install mechanism (the usual autoconf ; ./configure ;
92make ; make install deal), that would be very much appreciated. I
93will get round to it eventually, but there are only 24 hours in each
94day.
95
96If you want to install it somewhere other than the build directory:
97the files needed for installation are: valgrind.so, valgrinq.so,
98valgrind, VERSION, linux24.supp. You can copy these to any directory
99you like.
100
101I find it simplest to symlink <build_dir>/valgrind to somewhere
102else in my path, so I can use it in-place. No need to "install"
103really.
104
105Julian Seward (jseward@acm.org)
10615 Feb 2002