[ab4fdfc] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[f1607a4] | 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 " ">
|
---|
[f22a317] | 9 | <!ENTITY valgrind-md5sum "c59775fcbfa82fcce796843d0aaa7538">
|
---|
[15dbe35] | 10 | <!ENTITY valgrind-size "16 MB">
|
---|
[f22a317] | 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)">
|
---|
[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 |
|
---|
[e320358] | 36 | &lfs122_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>
|
---|
[f22a317] | 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>
|
---|
[f22a317] | 81 | -->
|
---|
[f1607a4] | 82 | <bridgehead renderas="sect3">Valgrind Dependencies</bridgehead>
|
---|
| 83 |
|
---|
| 84 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 85 | <para role="optional">
|
---|
[f04d065f] | 86 | <xref linkend="DocBook"/> (for tests),
|
---|
[8558044] | 87 | <xref linkend="gdb"/> (for tests),
|
---|
[ae6d3b8] | 88 | <xref linkend="llvm"/> (with Clang), and
|
---|
| 89 | <xref linkend="which"/> (for tests)
|
---|
[f1607a4] | 90 | </para>
|
---|
| 91 |
|
---|
[ae6d3b8] | 92 | <!-- See "maintainer note", below
|
---|
[f1607a4] | 93 | <bridgehead renderas="sect4">Optional for regenerating the documentation</bridgehead>
|
---|
| 94 | <para role="optional">
|
---|
[f3429309] | 95 | <xref linkend="libxslt"/> and
|
---|
[2d98031c] | 96 | <xref linkend="texlive"/> (or <xref linkend="tl-installer"/>)
|
---|
[f1607a4] | 97 | </para>
|
---|
[ae6d3b8] | 98 | -->
|
---|
[f1607a4] | 99 | </sect2>
|
---|
| 100 |
|
---|
| 101 | <sect2 role="installation">
|
---|
| 102 | <title>Installation of Valgrind</title>
|
---|
[f22a317] | 103 | <!--
|
---|
[a67b5f36] | 104 | <para>
|
---|
[2c76fcd] | 105 | First, make several changes that are required for Valgrind to function on
|
---|
[7c0429ea] | 106 | systems with glibc-2.39 and binutils-2.42 installed:
|
---|
[a67b5f36] | 107 | </para>
|
---|
| 108 |
|
---|
[2c76fcd] | 109 | <screen><userinput remap="pre">patch -Np1 -i ../valgrind-&valgrind-version;-upstream_fixes-1.patch</userinput></screen>
|
---|
[f22a317] | 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)
|
---|
[15dbe35] | 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 | -->
|
---|
[559cb4f] | 158 |
|
---|
[ae6d3b8] | 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 |
|
---|
[f1607a4] | 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>
|
---|
[9dfdd942] | 187 | <command>sed -i ... docs/Makefile.in </command>: This sed provides for
|
---|
[f1607a4] | 188 | installing the documentation in a versioned directory.
|
---|
| 189 | </para>
|
---|
| 190 |
|
---|
[d30b7e7] | 191 | <para>
|
---|
[8558044] | 192 | <option>--enable-lto=yes</option>: This option allows building Valgrind
|
---|
| 193 | with LTO (link time optimization). This produces a smaller/faster
|
---|
[d30b7e7] | 194 | Valgrind (up to 10%), but build time increases to about 5.5 SBU.
|
---|
| 195 | </para>
|
---|
| 196 |
|
---|
[f1607a4] | 197 | </sect2>
|
---|
| 198 |
|
---|
| 199 | <sect2 role="content">
|
---|
| 200 | <title>Contents</title>
|
---|
| 201 |
|
---|
| 202 | <segmentedlist>
|
---|
| 203 | <segtitle>Installed Programs</segtitle>
|
---|
[a2ce753] | 204 | <segtitle>Installed Libraries</segtitle>
|
---|
[f1607a4] | 205 | <segtitle>Installed Directories</segtitle>
|
---|
| 206 |
|
---|
| 207 | <seglistitem>
|
---|
| 208 | <seg>
|
---|
[f3429309] | 209 | callgrind_annotate,
|
---|
| 210 | callgrind_control,
|
---|
| 211 | cg_annotate,
|
---|
| 212 | cg_diff,
|
---|
| 213 | cg_merge,
|
---|
| 214 | ms_print,
|
---|
| 215 | valgrind,
|
---|
[f1607a4] | 216 | valgrind-di-server,
|
---|
[f3429309] | 217 | valgrind-listener, and
|
---|
[f1607a4] | 218 | vgdb
|
---|
| 219 | </seg>
|
---|
| 220 | <seg>
|
---|
[a2ce753] | 221 | None
|
---|
[f1607a4] | 222 | </seg>
|
---|
| 223 | <seg>
|
---|
| 224 | /usr/lib/valgrind,
|
---|
[50cbddce] | 225 | /usr/libexec/valgrind,
|
---|
[f3429309] | 226 | /usr/include/valgrind, and
|
---|
[f1607a4] | 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>
|
---|
[4c24eb0a] | 241 | is a program for debugging and profiling Linux executables
|
---|
[f1607a4] | 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
|
---|
[4c24eb0a] | 255 | information in an easy-to-read form
|
---|
[f1607a4] | 256 | </para>
|
---|
[6076396] | 257 | <indexterm zone="valgrind callgrind_annotate">
|
---|
[f1607a4] | 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>
|
---|
[f3429309] | 267 | controls programs being run by the <application>Valgrind</application>
|
---|
[4c24eb0a] | 268 | tool Callgrind
|
---|
[f1607a4] | 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>
|
---|
[f3429309] | 280 | is a post-processing tool for the <application>Valgrind</application>
|
---|
[4c24eb0a] | 281 | tool Cachegrind
|
---|
[f1607a4] | 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>
|
---|
[4c24eb0a] | 293 | compares two Cachegrind output files
|
---|
[f1607a4] | 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>
|
---|
[4c24eb0a] | 305 | merges multiple Cachegrind output files into one
|
---|
[f1607a4] | 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>
|
---|
[4c24eb0a] | 318 | tool Massif and prints the information in an easy-to-read form
|
---|
[f1607a4] | 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>
|
---|
[f3429309] | 330 | is a server that reads debuginfo from objects stored on a
|
---|
[4c24eb0a] | 331 | different machine
|
---|
[f1607a4] | 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>
|
---|
[4c24eb0a] | 343 | listens on a socket for Valgrind commentary
|
---|
[f1607a4] | 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>
|
---|
[4c24eb0a] | 355 | is an intermediary between Valgrind and GDB or a shell
|
---|
[f1607a4] | 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>
|
---|