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