1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY valgrind-download-http "https://sourceware.org/pub/valgrind/valgrind-&valgrind-version;.tar.bz2">
|
---|
8 | <!ENTITY valgrind-download-ftp " ">
|
---|
9 | <!ENTITY valgrind-md5sum "c59775fcbfa82fcce796843d0aaa7538">
|
---|
10 | <!ENTITY valgrind-size "16 MB">
|
---|
11 | <!ENTITY valgrind-buildsize "392 MB (add 68 MB for tests)">
|
---|
12 | <!ENTITY valgrind-time "0.5 SBU (add 7.2 SBU for tests; both using parallelism=4)">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="valgrind" xreflabel="Valgrind-&valgrind-version;">
|
---|
16 | <?dbhtml filename="valgrind.html"?>
|
---|
17 |
|
---|
18 |
|
---|
19 | <title>Valgrind-&valgrind-version;</title>
|
---|
20 |
|
---|
21 | <indexterm zone="valgrind">
|
---|
22 | <primary sortas="a-Valgrind">Valgrind</primary>
|
---|
23 | </indexterm>
|
---|
24 |
|
---|
25 | <sect2 role="package">
|
---|
26 | <title>Introduction to Valgrind</title>
|
---|
27 |
|
---|
28 | <para>
|
---|
29 | <application>Valgrind</application> is an instrumentation framework for
|
---|
30 | building dynamic analysis tools. There are Valgrind tools that can
|
---|
31 | automatically detect many memory management and threading bugs, and
|
---|
32 | profile programs in detail. Valgrind can also be used to build new
|
---|
33 | tools.
|
---|
34 | </para>
|
---|
35 |
|
---|
36 | &lfs122_checked;
|
---|
37 |
|
---|
38 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
39 | <itemizedlist spacing="compact">
|
---|
40 | <listitem>
|
---|
41 | <para>
|
---|
42 | Download (HTTP): <ulink url="&valgrind-download-http;"/>
|
---|
43 | </para>
|
---|
44 | </listitem>
|
---|
45 | <listitem>
|
---|
46 | <para>
|
---|
47 | Download (FTP): <ulink url="&valgrind-download-ftp;"/>
|
---|
48 | </para>
|
---|
49 | </listitem>
|
---|
50 | <listitem>
|
---|
51 | <para>
|
---|
52 | Download MD5 sum: &valgrind-md5sum;
|
---|
53 | </para>
|
---|
54 | </listitem>
|
---|
55 | <listitem>
|
---|
56 | <para>
|
---|
57 | Download size: &valgrind-size;
|
---|
58 | </para>
|
---|
59 | </listitem>
|
---|
60 | <listitem>
|
---|
61 | <para>
|
---|
62 | Estimated disk space required: &valgrind-buildsize;
|
---|
63 | </para>
|
---|
64 | </listitem>
|
---|
65 | <listitem>
|
---|
66 | <para>
|
---|
67 | Estimated build time: &valgrind-time;
|
---|
68 | </para>
|
---|
69 | </listitem>
|
---|
70 | </itemizedlist>
|
---|
71 | <!--
|
---|
72 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
73 | <itemizedlist spacing="compact">
|
---|
74 | <listitem>
|
---|
75 | <para>
|
---|
76 | Required patch:
|
---|
77 | <ulink url="&patch-root;/valgrind-&valgrind-version;-upstream_fixes-1.patch"/>
|
---|
78 | </para>
|
---|
79 | </listitem>
|
---|
80 | </itemizedlist>
|
---|
81 | -->
|
---|
82 | <bridgehead renderas="sect3">Valgrind Dependencies</bridgehead>
|
---|
83 |
|
---|
84 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
85 | <para role="optional">
|
---|
86 | <xref linkend="DocBook"/> (for tests),
|
---|
87 | <xref linkend="gdb"/> (for tests),
|
---|
88 | <xref linkend="llvm"/> (with Clang), and
|
---|
89 | <xref linkend="which"/> (for tests)
|
---|
90 | </para>
|
---|
91 |
|
---|
92 | <!-- See "maintainer note", below
|
---|
93 | <bridgehead renderas="sect4">Optional for regenerating the documentation</bridgehead>
|
---|
94 | <para role="optional">
|
---|
95 | <xref linkend="libxslt"/> and
|
---|
96 | <xref linkend="texlive"/> (or <xref linkend="tl-installer"/>)
|
---|
97 | </para>
|
---|
98 | -->
|
---|
99 | </sect2>
|
---|
100 |
|
---|
101 | <sect2 role="installation">
|
---|
102 | <title>Installation of Valgrind</title>
|
---|
103 | <!--
|
---|
104 | <para>
|
---|
105 | First, make several changes that are required for Valgrind to function on
|
---|
106 | systems with glibc-2.39 and binutils-2.42 installed:
|
---|
107 | </para>
|
---|
108 |
|
---|
109 | <screen><userinput remap="pre">patch -Np1 -i ../valgrind-&valgrind-version;-upstream_fixes-1.patch</userinput></screen>
|
---|
110 | -->
|
---|
111 | <para>
|
---|
112 | Install <application>Valgrind</application> by running the following
|
---|
113 | commands:
|
---|
114 | </para>
|
---|
115 |
|
---|
116 | <screen><userinput>sed -i 's|/doc/valgrind||' docs/Makefile.in &&
|
---|
117 |
|
---|
118 | ./configure --prefix=/usr \
|
---|
119 | --datadir=/usr/share/doc/valgrind-&valgrind-version; &&
|
---|
120 | make</userinput></screen>
|
---|
121 |
|
---|
122 | <para>
|
---|
123 | To test the results, issue: <command>make regtest</command>. The tests
|
---|
124 | may hang forever if <xref linkend="gdb"/> is not installed. Some tests
|
---|
125 | are known to hang also, depending on the version of glibc. A few tests
|
---|
126 | can fail in various suites. Problematic
|
---|
127 | tests can be disabled by changing the <userinput>prereq:</userinput> line
|
---|
128 | in the corresponding <filename>.vgtest</filename> file to
|
---|
129 | <userinput>prereq: false</userinput>. For example:
|
---|
130 | </para>
|
---|
131 |
|
---|
132 | <screen role="nodump"><userinput>sed -e 's@prereq:.*@prereq: false@' \
|
---|
133 | -i {helgrind,drd}/tests/pth_cond_destroy_busy.vgtest</userinput></screen>
|
---|
134 |
|
---|
135 | <!-- 731 tests, 6 stderr failures, 0 stdout failures, 1 stderrB failure,
|
---|
136 | 0 stdoutB failures, 1 post failure -bdubbs Apr 13. 22
|
---|
137 | valgrind-3.19.0
|
---|
138 |
|
---|
139 | 732 tests, 4 stderr failures, 0 stdout failures, 1 stderrB failure,
|
---|
140 | 0 stdoutB failures, 1 post failure - bdubbs Oct 26, 22
|
---|
141 | gdbserver_tests/hginfo (stderrB)
|
---|
142 | memcheck/tests/cdebug_zlib_gnu (stderr)
|
---|
143 | memcheck/tests/overlap (stderr)
|
---|
144 | helgrind/tests/tls_threads (stderr)
|
---|
145 | drd/tests/pth_mutex_signal (stderr)
|
---|
146 |
|
---|
147 | 765 tests, 2 stderr failures, 0 stdout failures, 0 stderrB failure,
|
---|
148 | 0 stdoutB failures, 0 post failure -bdubbs May 2, 23
|
---|
149 | valgrind-3.21.0
|
---|
150 | memcheck/tests/overlap (stderr)
|
---|
151 | helgrind/tests/pth_mempcpy_false_races (stderr)
|
---|
152 |
|
---|
153 | 792 tests, 1 stderr failure, 0 stdout failures, 0 stderrB failures,
|
---|
154 | 0 stdoutB failures, 0 post failures
|
---|
155 | valgrind-3.22.0
|
---|
156 | helgrind/tests/pth_mempcpy_false_races (stderr)
|
---|
157 | -->
|
---|
158 |
|
---|
159 | <note>
|
---|
160 | <para>
|
---|
161 | The <application>OpenMP</application> tests are skipped if libgomp
|
---|
162 | has been compiled with <option>--enable-linux-futex</option> (the
|
---|
163 | default). If needed, just recompile the libgomp library from
|
---|
164 | the gcc build tree, passing <option>--disable-linux-futex</option>
|
---|
165 | to configure, storing the library to some place and changing the link
|
---|
166 | from <filename>/usr/lib/libgomp.so.1</filename> to point to the new
|
---|
167 | library.
|
---|
168 | </para>
|
---|
169 | </note>
|
---|
170 |
|
---|
171 | <!-- Note to maintainer: there is a long thread in ticket #5882 explaining
|
---|
172 | why we do not provide instructions to rebuild the documentation.
|
---|
173 | (still broken with TeXLive 2016) -->
|
---|
174 |
|
---|
175 | <para>
|
---|
176 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
177 | </para>
|
---|
178 |
|
---|
179 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
180 |
|
---|
181 | </sect2>
|
---|
182 |
|
---|
183 | <sect2 role="commands">
|
---|
184 | <title>Command Explanations</title>
|
---|
185 |
|
---|
186 | <para>
|
---|
187 | <command>sed -i ... docs/Makefile.in </command>: This sed provides for
|
---|
188 | installing the documentation in a versioned directory.
|
---|
189 | </para>
|
---|
190 |
|
---|
191 | <para>
|
---|
192 | <option>--enable-lto=yes</option>: This option allows building Valgrind
|
---|
193 | with LTO (link time optimization). This produces a smaller/faster
|
---|
194 | Valgrind (up to 10%), but build time increases to about 5.5 SBU.
|
---|
195 | </para>
|
---|
196 |
|
---|
197 | </sect2>
|
---|
198 |
|
---|
199 | <sect2 role="content">
|
---|
200 | <title>Contents</title>
|
---|
201 |
|
---|
202 | <segmentedlist>
|
---|
203 | <segtitle>Installed Programs</segtitle>
|
---|
204 | <segtitle>Installed Libraries</segtitle>
|
---|
205 | <segtitle>Installed Directories</segtitle>
|
---|
206 |
|
---|
207 | <seglistitem>
|
---|
208 | <seg>
|
---|
209 | callgrind_annotate,
|
---|
210 | callgrind_control,
|
---|
211 | cg_annotate,
|
---|
212 | cg_diff,
|
---|
213 | cg_merge,
|
---|
214 | ms_print,
|
---|
215 | valgrind,
|
---|
216 | valgrind-di-server,
|
---|
217 | valgrind-listener, and
|
---|
218 | vgdb
|
---|
219 | </seg>
|
---|
220 | <seg>
|
---|
221 | None
|
---|
222 | </seg>
|
---|
223 | <seg>
|
---|
224 | /usr/lib/valgrind,
|
---|
225 | /usr/libexec/valgrind,
|
---|
226 | /usr/include/valgrind, and
|
---|
227 | /usr/share/doc/valgrind-&valgrind-version;
|
---|
228 | </seg>
|
---|
229 | </seglistitem>
|
---|
230 | </segmentedlist>
|
---|
231 |
|
---|
232 | <variablelist>
|
---|
233 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
234 | <?dbfo list-presentation="list"?>
|
---|
235 | <?dbhtml list-presentation="table"?>
|
---|
236 |
|
---|
237 | <varlistentry id="valgrind-prog">
|
---|
238 | <term><command>valgrind</command></term>
|
---|
239 | <listitem>
|
---|
240 | <para>
|
---|
241 | is a program for debugging and profiling Linux executables
|
---|
242 | </para>
|
---|
243 | <indexterm zone="valgrind valgrind-prog">
|
---|
244 | <primary sortas="b-valgrind">valgrind</primary>
|
---|
245 | </indexterm>
|
---|
246 | </listitem>
|
---|
247 | </varlistentry>
|
---|
248 |
|
---|
249 | <varlistentry id="callgrind_annotate">
|
---|
250 | <term><command>callgrind_annotate</command></term>
|
---|
251 | <listitem>
|
---|
252 | <para>
|
---|
253 | takes an output file produced by the
|
---|
254 | <application>Valgrind</application> tool Callgrind and prints the
|
---|
255 | information in an easy-to-read form
|
---|
256 | </para>
|
---|
257 | <indexterm zone="valgrind callgrind_annotate">
|
---|
258 | <primary sortas="b-callgrind_annotate">callgrind_annotate</primary>
|
---|
259 | </indexterm>
|
---|
260 | </listitem>
|
---|
261 | </varlistentry>
|
---|
262 |
|
---|
263 | <varlistentry id="callgrind_control">
|
---|
264 | <term><command>callgrind_control</command></term>
|
---|
265 | <listitem>
|
---|
266 | <para>
|
---|
267 | controls programs being run by the <application>Valgrind</application>
|
---|
268 | tool Callgrind
|
---|
269 | </para>
|
---|
270 | <indexterm zone="valgrind callgrind_control">
|
---|
271 | <primary sortas="b-callgrind_control">callgrind_control</primary>
|
---|
272 | </indexterm>
|
---|
273 | </listitem>
|
---|
274 | </varlistentry>
|
---|
275 |
|
---|
276 | <varlistentry id="cg_annotate">
|
---|
277 | <term><command>cg_annotate</command></term>
|
---|
278 | <listitem>
|
---|
279 | <para>
|
---|
280 | is a post-processing tool for the <application>Valgrind</application>
|
---|
281 | tool Cachegrind
|
---|
282 | </para>
|
---|
283 | <indexterm zone="valgrind cg_annotate">
|
---|
284 | <primary sortas="b-cg_annotate">cg_annotate</primary>
|
---|
285 | </indexterm>
|
---|
286 | </listitem>
|
---|
287 | </varlistentry>
|
---|
288 |
|
---|
289 | <varlistentry id="cg_diff">
|
---|
290 | <term><command>cg_diff</command></term>
|
---|
291 | <listitem>
|
---|
292 | <para>
|
---|
293 | compares two Cachegrind output files
|
---|
294 | </para>
|
---|
295 | <indexterm zone="valgrind cg_diff">
|
---|
296 | <primary sortas="b-cg_diff">cg_diff</primary>
|
---|
297 | </indexterm>
|
---|
298 | </listitem>
|
---|
299 | </varlistentry>
|
---|
300 |
|
---|
301 | <varlistentry id="cg_merge">
|
---|
302 | <term><command>cg_merge</command></term>
|
---|
303 | <listitem>
|
---|
304 | <para>
|
---|
305 | merges multiple Cachegrind output files into one
|
---|
306 | </para>
|
---|
307 | <indexterm zone="valgrind cg_merge">
|
---|
308 | <primary sortas="b-cg_merge">cg_merge</primary>
|
---|
309 | </indexterm>
|
---|
310 | </listitem>
|
---|
311 | </varlistentry>
|
---|
312 |
|
---|
313 | <varlistentry id="ms_print">
|
---|
314 | <term><command>ms_print</command></term>
|
---|
315 | <listitem>
|
---|
316 | <para>
|
---|
317 | takes an output file produced by the <application>Valgrind</application>
|
---|
318 | tool Massif and prints the information in an easy-to-read form
|
---|
319 | </para>
|
---|
320 | <indexterm zone="valgrind ms_print">
|
---|
321 | <primary sortas="b-ms_print">ms_print</primary>
|
---|
322 | </indexterm>
|
---|
323 | </listitem>
|
---|
324 | </varlistentry>
|
---|
325 |
|
---|
326 | <varlistentry id="valgrind-di-server">
|
---|
327 | <term><command>valgrind-di-server</command></term>
|
---|
328 | <listitem>
|
---|
329 | <para>
|
---|
330 | is a server that reads debuginfo from objects stored on a
|
---|
331 | different machine
|
---|
332 | </para>
|
---|
333 | <indexterm zone="valgrind valgrind-di-server">
|
---|
334 | <primary sortas="b-valgrind-di-server">valgrind-di-server</primary>
|
---|
335 | </indexterm>
|
---|
336 | </listitem>
|
---|
337 | </varlistentry>
|
---|
338 |
|
---|
339 | <varlistentry id="valgrind-listener">
|
---|
340 | <term><command>valgrind-listener</command></term>
|
---|
341 | <listitem>
|
---|
342 | <para>
|
---|
343 | listens on a socket for Valgrind commentary
|
---|
344 | </para>
|
---|
345 | <indexterm zone="valgrind valgrind-listener">
|
---|
346 | <primary sortas="b-valgrind-listener">valgrind-listener</primary>
|
---|
347 | </indexterm>
|
---|
348 | </listitem>
|
---|
349 | </varlistentry>
|
---|
350 |
|
---|
351 | <varlistentry id="vgdb">
|
---|
352 | <term><command>vgdb</command></term>
|
---|
353 | <listitem>
|
---|
354 | <para>
|
---|
355 | is an intermediary between Valgrind and GDB or a shell
|
---|
356 | </para>
|
---|
357 | <indexterm zone="valgrind vgdb">
|
---|
358 | <primary sortas="b-vgdb">vgdb</primary>
|
---|
359 | </indexterm>
|
---|
360 | </listitem>
|
---|
361 | </varlistentry>
|
---|
362 |
|
---|
363 | </variablelist>
|
---|
364 |
|
---|
365 | </sect2>
|
---|
366 |
|
---|
367 | </sect1>
|
---|