source: general/prog/valgrind.xml@ 50182be

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 50182be was a67b5f3, checked in by Douglas R. Reno <renodr@…>, 4 years ago

Fix valgrind problems with GCC-10

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@23114 af4574ff-66df-0310-9fd7-8a98e5e911e0

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