blob: 049c91d7de3b6ac3148a109e1ee0c17223d36d1b [file] [log] [blame]
barte3e54df2008-06-12 15:20:42 +00001<?xml version="1.0"?> <!-- -*- sgml -*- -->
2<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
4[ <!ENTITY % vg-entities SYSTEM "../../docs/xml/vg-entities.xml"> %vg-entities; ]>
5
6
7<chapter id="drd-manual" xreflabel="DRD: a thread error detector">
8 <title>DRD: a thread error detector</title>
9
10<para>To use this tool, you must specify
11<computeroutput>--tool=exp-drd</computeroutput>
12on the Valgrind command line.</para>
13
14<sect1 id="drd-manual.overview" xreflabel="Overview">
15<title>Overview</title>
16
17<para>
18DRD is a Valgrind tool for detecting errors in multithreaded C and C++
19programs that use the POSIX threading primitives, also known as
20pthreads. POSIX threads is the most widely available threading library
21on Unix systems.
22</para>
23
24<para>
25The next section provides
26<link linkend="drd-manual.multithreading">
27background information about multithreading</link>.
28</para>
29
30<para>
31DRD can detect two classes of errors, which are discussed in detail:
32</para>
33
34<orderedlist>
35 <listitem>
36 <para><link linkend="drd-manual.api-checks">
37 Misuses of the POSIX threads API.</link></para>
38 </listitem>
39 <listitem>
40 <para><link linkend="drd-manual.data-races">
41 Data races -- accessing memory without adequate locking.
42 </link></para>
43 </listitem>
44</orderedlist>
45
46<para>Then there is a
47<link linkend="drd-manual.options">summary of command-line
48options.</link>
49</para>
50
51<para>Finally, there is a section about the current
52<link linkend="drd-manual.limitations">limitations</link>
53of DRD.
54</para>
55
56</sect1>
57
58
59<sect1 id="drd-manual.multithreading" xreflabel="Multithreading">
60<title>Multithreaded Programming</title>
61</sect1>
62
63
64<sect1 id="drd-manual.api-checks" xreflabel="API Checks">
65<title>Detected errors: Misuses of the POSIX threads API</title>
66</sect1>
67
68
69<sect1 id="drd-manual.data-races" xreflabel="Data Races">
70<title>Detected errors: Data Races</title>
71</sect1>
72
73
74<sect1 id="drd-manual.options" xreflabel="DRD Options">
75<title>DRD Options</title>
76
77<para>The following end-user options are available:</para>
78
79<!-- start of xi:include in the manpage -->
80<variablelist id="drd.opts.list">
81</variablelist>
82<!-- end of xi:include in the manpage -->
83
84<!-- start of xi:include in the manpage -->
85<para>In addition, the following debugging options are available for
86DRD:</para>
87<variablelist id="drd.debugopts.list">
88</variablelist>
89<!-- end of xi:include in the manpage -->
90
91</sect1>
92
93<sect1 id="drd-manual.limitations" xreflabel="Limitations">
94<title>DRD Limitations</title>
95
96<para>DRD currently has the following limitations:</para>
97
98<itemizedlist>
99 <listitem><para>DRD has only been tested on the Linux operating
100 system, and not on any of the other operating systems supported by
101 Valgrind.</para>
102 </listitem>
103 <listitem><para>Of the two POSIX threads implementations for Linux,
104 only the NPTL (Native POSIX Thread Library) is supported. The older
105 LinuxThreads library is not supported.</para>
106 </listitem>
107 <listitem><para>When running DRD on a PowerPC CPU, DRD will report
108 false positives on atomic operations. See also <ulink
109 url="http://bugs.kde.org/show_bug.cgi?id=162354">bug 162354</ulink>.
110 </para></listitem>
111 <listitem><para>DRD, just like memcheck, will refuse to
112 start on Linux distributions where all symbol information has been
113 removed from ld.so. This is e.g. the case for openSUSE 10.3 -- see
114 also <ulink
115 url="http://bugzilla.novell.com/show_bug.cgi?id=396197">bug 396197</ulink>.
116 </para></listitem>
117 <listitem><para>If you compile the DRD sourcecode yourself, you need
118 gcc 3.0 or later. gcc 2.95 is not supported.</para>
119 </listitem>
120
121</itemizedlist>
122
123</sect1>
124
125</chapter>