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 "38ea14f567efa09687a822b33b4d9d60">
|
---|
10 | <!ENTITY valgrind-size "16 MB">
|
---|
11 | <!ENTITY valgrind-buildsize "390 MB (add 66 MB for tests)">
|
---|
12 | <!ENTITY valgrind-time "0.5 SBU (add 6.8 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 | &lfs121_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="gdb"/> (for tests),
|
---|
87 | <xref linkend="llvm"/> (with Clang), and
|
---|
88 | <xref linkend="which"/> (for tests)
|
---|
89 | </para>
|
---|
90 |
|
---|
91 | <!-- See "maintainer note", below
|
---|
92 | <bridgehead renderas="sect4">Optional for regenerating the documentation</bridgehead>
|
---|
93 | <para role="optional">
|
---|
94 | <xref linkend="libxslt"/> and
|
---|
95 | <xref linkend="texlive"/> (or <xref linkend="tl-installer"/>)
|
---|
96 | </para>
|
---|
97 | -->
|
---|
98 | </sect2>
|
---|
99 |
|
---|
100 | <sect2 role="installation">
|
---|
101 | <title>Installation of Valgrind</title>
|
---|
102 |
|
---|
103 | <para>
|
---|
104 | First, make several changes that are required for Valgrind to function on
|
---|
105 | systems with glibc-2.39 and binutils-2.42 installed:
|
---|
106 | </para>
|
---|
107 |
|
---|
108 | <screen><userinput remap="pre">patch -Np1 -i ../valgrind-&valgrind-version;-upstream_fixes-1.patch</userinput></screen>
|
---|
109 |
|
---|
110 | <para>
|
---|
111 | Install <application>Valgrind</application> by running the following
|
---|
112 | commands:
|
---|
113 | </para>
|
---|
114 |
|
---|
115 | <screen><userinput>sed -i 's|/doc/valgrind||' docs/Makefile.in &&
|
---|
116 |
|
---|
117 | ./configure --prefix=/usr \
|
---|
118 | --datadir=/usr/share/doc/valgrind-&valgrind-version; &&
|
---|
119 | make</userinput></screen>
|
---|
120 |
|
---|
121 | <para>
|
---|
122 | To test the results, issue: <command>make regtest</command>. The tests
|
---|
123 | may hang forever if <xref linkend="gdb"/> is not installed. Some tests
|
---|
124 | are known to hang also, depending on the version of glibc. A few tests
|
---|
125 | can fail in various suites. Problematic
|
---|
126 | tests can be disabled by changing the <userinput>prereq:</userinput> line
|
---|
127 | in the corresponding <filename>.vgtest</filename> file to
|
---|
128 | <userinput>prereq: false</userinput>. For example:
|
---|
129 | </para>
|
---|
130 |
|
---|
131 | <screen role="nodump"><userinput>sed -e 's@prereq:.*@prereq: false@' \
|
---|
132 | -i {helgrind,drd}/tests/pth_cond_destroy_busy.vgtest</userinput></screen>
|
---|
133 |
|
---|
134 | <!-- 731 tests, 6 stderr failures, 0 stdout failures, 1 stderrB failure,
|
---|
135 | 0 stdoutB failures, 1 post failure -bdubbs Apr 13. 22
|
---|
136 | valgrind-3.19.0
|
---|
137 |
|
---|
138 | 732 tests, 4 stderr failures, 0 stdout failures, 1 stderrB failure,
|
---|
139 | 0 stdoutB failures, 1 post failure - bdubbs Oct 26, 22
|
---|
140 | gdbserver_tests/hginfo (stderrB)
|
---|
141 | memcheck/tests/cdebug_zlib_gnu (stderr)
|
---|
142 | memcheck/tests/overlap (stderr)
|
---|
143 | helgrind/tests/tls_threads (stderr)
|
---|
144 | drd/tests/pth_mutex_signal (stderr)
|
---|
145 |
|
---|
146 | 765 tests, 2 stderr failures, 0 stdout failures, 0 stderrB failure,
|
---|
147 | 0 stdoutB failures, 0 post failure -bdubbs May 2, 23
|
---|
148 | valgrind-3.21.0
|
---|
149 | memcheck/tests/overlap (stderr)
|
---|
150 | helgrind/tests/pth_mempcpy_false_races (stderr)
|
---|
151 |
|
---|
152 | 792 tests, 1 stderr failure, 0 stdout failures, 0 stderrB failures,
|
---|
153 | 0 stdoutB failures, 0 post failures
|
---|
154 | valgrind-3.22.0
|
---|
155 | helgrind/tests/pth_mempcpy_false_races (stderr)
|
---|
156 | -->
|
---|
157 |
|
---|
158 | <note>
|
---|
159 | <para>
|
---|
160 | The <application>OpenMP</application> tests are skipped if libgomp
|
---|
161 | has been compiled with <option>--enable-linux-futex</option> (the
|
---|
162 | default). If needed, just recompile the libgomp library from
|
---|
163 | the gcc build tree, passing <option>--disable-linux-futex</option>
|
---|
164 | to configure, storing the library to some place and changing the link
|
---|
165 | from <filename>/usr/lib/libgomp.so.1</filename> to point to the new
|
---|
166 | library.
|
---|
167 | </para>
|
---|
168 | </note>
|
---|
169 |
|
---|
170 | <!-- Note to maintainer: there is a long thread in ticket #5882 explaining
|
---|
171 | why we do not provide instructions to rebuild the documentation.
|
---|
172 | (still broken with TeXLive 2016) -->
|
---|
173 |
|
---|
174 | <para>
|
---|
175 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
176 | </para>
|
---|
177 |
|
---|
178 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
179 |
|
---|
180 | </sect2>
|
---|
181 |
|
---|
182 | <sect2 role="commands">
|
---|
183 | <title>Command Explanations</title>
|
---|
184 |
|
---|
185 | <para>
|
---|
186 | <command>sed -i ... docs/Makefile.in </command>: This sed provides for
|
---|
187 | installing the documentation in a versioned directory.
|
---|
188 | </para>
|
---|
189 |
|
---|
190 | <para>
|
---|
191 | <option>--enable-lto=yes</option>: This option allows building Valgrind
|
---|
192 | with LTO (link time optimization). This produces a smaller/faster
|
---|
193 | Valgrind (up to 10%), but build time increases to about 5.5 SBU.
|
---|
194 | </para>
|
---|
195 |
|
---|
196 | </sect2>
|
---|
197 |
|
---|
198 | <sect2 role="content">
|
---|
199 | <title>Contents</title>
|
---|
200 |
|
---|
201 | <segmentedlist>
|
---|
202 | <segtitle>Installed Programs</segtitle>
|
---|
203 | <segtitle>Installed Libraries</segtitle>
|
---|
204 | <segtitle>Installed Directories</segtitle>
|
---|
205 |
|
---|
206 | <seglistitem>
|
---|
207 | <seg>
|
---|
208 | callgrind_annotate,
|
---|
209 | callgrind_control,
|
---|
210 | cg_annotate,
|
---|
211 | cg_diff,
|
---|
212 | cg_merge,
|
---|
213 | ms_print,
|
---|
214 | valgrind,
|
---|
215 | valgrind-di-server,
|
---|
216 | valgrind-listener, and
|
---|
217 | vgdb
|
---|
218 | </seg>
|
---|
219 | <seg>
|
---|
220 | None
|
---|
221 | </seg>
|
---|
222 | <seg>
|
---|
223 | /usr/lib/valgrind,
|
---|
224 | /usr/libexec/valgrind,
|
---|
225 | /usr/include/valgrind, and
|
---|
226 | /usr/share/doc/valgrind-&valgrind-version;
|
---|
227 | </seg>
|
---|
228 | </seglistitem>
|
---|
229 | </segmentedlist>
|
---|
230 |
|
---|
231 | <variablelist>
|
---|
232 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
233 | <?dbfo list-presentation="list"?>
|
---|
234 | <?dbhtml list-presentation="table"?>
|
---|
235 |
|
---|
236 | <varlistentry id="valgrind-prog">
|
---|
237 | <term><command>valgrind</command></term>
|
---|
238 | <listitem>
|
---|
239 | <para>
|
---|
240 | is a program for debugging and profiling Linux executables
|
---|
241 | </para>
|
---|
242 | <indexterm zone="valgrind valgrind-prog">
|
---|
243 | <primary sortas="b-valgrind">valgrind</primary>
|
---|
244 | </indexterm>
|
---|
245 | </listitem>
|
---|
246 | </varlistentry>
|
---|
247 |
|
---|
248 | <varlistentry id="callgrind_annotate">
|
---|
249 | <term><command>callgrind_annotate</command></term>
|
---|
250 | <listitem>
|
---|
251 | <para>
|
---|
252 | takes an output file produced by the
|
---|
253 | <application>Valgrind</application> tool Callgrind and prints the
|
---|
254 | information in an easy-to-read form
|
---|
255 | </para>
|
---|
256 | <indexterm zone="valgrind callgrind_annotate">
|
---|
257 | <primary sortas="b-callgrind_annotate">callgrind_annotate</primary>
|
---|
258 | </indexterm>
|
---|
259 | </listitem>
|
---|
260 | </varlistentry>
|
---|
261 |
|
---|
262 | <varlistentry id="callgrind_control">
|
---|
263 | <term><command>callgrind_control</command></term>
|
---|
264 | <listitem>
|
---|
265 | <para>
|
---|
266 | controls programs being run by the <application>Valgrind</application>
|
---|
267 | tool Callgrind
|
---|
268 | </para>
|
---|
269 | <indexterm zone="valgrind callgrind_control">
|
---|
270 | <primary sortas="b-callgrind_control">callgrind_control</primary>
|
---|
271 | </indexterm>
|
---|
272 | </listitem>
|
---|
273 | </varlistentry>
|
---|
274 |
|
---|
275 | <varlistentry id="cg_annotate">
|
---|
276 | <term><command>cg_annotate</command></term>
|
---|
277 | <listitem>
|
---|
278 | <para>
|
---|
279 | is a post-processing tool for the <application>Valgrind</application>
|
---|
280 | tool Cachegrind
|
---|
281 | </para>
|
---|
282 | <indexterm zone="valgrind cg_annotate">
|
---|
283 | <primary sortas="b-cg_annotate">cg_annotate</primary>
|
---|
284 | </indexterm>
|
---|
285 | </listitem>
|
---|
286 | </varlistentry>
|
---|
287 |
|
---|
288 | <varlistentry id="cg_diff">
|
---|
289 | <term><command>cg_diff</command></term>
|
---|
290 | <listitem>
|
---|
291 | <para>
|
---|
292 | compares two Cachegrind output files
|
---|
293 | </para>
|
---|
294 | <indexterm zone="valgrind cg_diff">
|
---|
295 | <primary sortas="b-cg_diff">cg_diff</primary>
|
---|
296 | </indexterm>
|
---|
297 | </listitem>
|
---|
298 | </varlistentry>
|
---|
299 |
|
---|
300 | <varlistentry id="cg_merge">
|
---|
301 | <term><command>cg_merge</command></term>
|
---|
302 | <listitem>
|
---|
303 | <para>
|
---|
304 | merges multiple Cachegrind output files into one
|
---|
305 | </para>
|
---|
306 | <indexterm zone="valgrind cg_merge">
|
---|
307 | <primary sortas="b-cg_merge">cg_merge</primary>
|
---|
308 | </indexterm>
|
---|
309 | </listitem>
|
---|
310 | </varlistentry>
|
---|
311 |
|
---|
312 | <varlistentry id="ms_print">
|
---|
313 | <term><command>ms_print</command></term>
|
---|
314 | <listitem>
|
---|
315 | <para>
|
---|
316 | takes an output file produced by the <application>Valgrind</application>
|
---|
317 | tool Massif and prints the information in an easy-to-read form
|
---|
318 | </para>
|
---|
319 | <indexterm zone="valgrind ms_print">
|
---|
320 | <primary sortas="b-ms_print">ms_print</primary>
|
---|
321 | </indexterm>
|
---|
322 | </listitem>
|
---|
323 | </varlistentry>
|
---|
324 |
|
---|
325 | <varlistentry id="valgrind-di-server">
|
---|
326 | <term><command>valgrind-di-server</command></term>
|
---|
327 | <listitem>
|
---|
328 | <para>
|
---|
329 | is a server that reads debuginfo from objects stored on a
|
---|
330 | different machine
|
---|
331 | </para>
|
---|
332 | <indexterm zone="valgrind valgrind-di-server">
|
---|
333 | <primary sortas="b-valgrind-di-server">valgrind-di-server</primary>
|
---|
334 | </indexterm>
|
---|
335 | </listitem>
|
---|
336 | </varlistentry>
|
---|
337 |
|
---|
338 | <varlistentry id="valgrind-listener">
|
---|
339 | <term><command>valgrind-listener</command></term>
|
---|
340 | <listitem>
|
---|
341 | <para>
|
---|
342 | listens on a socket for Valgrind commentary
|
---|
343 | </para>
|
---|
344 | <indexterm zone="valgrind valgrind-listener">
|
---|
345 | <primary sortas="b-valgrind-listener">valgrind-listener</primary>
|
---|
346 | </indexterm>
|
---|
347 | </listitem>
|
---|
348 | </varlistentry>
|
---|
349 |
|
---|
350 | <varlistentry id="vgdb">
|
---|
351 | <term><command>vgdb</command></term>
|
---|
352 | <listitem>
|
---|
353 | <para>
|
---|
354 | is an intermediary between Valgrind and GDB or a shell
|
---|
355 | </para>
|
---|
356 | <indexterm zone="valgrind vgdb">
|
---|
357 | <primary sortas="b-vgdb">vgdb</primary>
|
---|
358 | </indexterm>
|
---|
359 | </listitem>
|
---|
360 | </varlistentry>
|
---|
361 |
|
---|
362 | </variablelist>
|
---|
363 |
|
---|
364 | </sect2>
|
---|
365 |
|
---|
366 | </sect1>
|
---|