|
From: <sv...@va...> - 2005-11-26 18:43:38
|
Author: de Date: 2005-11-26 18:43:24 +0000 (Sat, 26 Nov 2005) New Revision: 242 Log: A few more tweaks to make all the docs work properly=20 Added: trunk/docs/manual/QuickStart.html Removed: trunk/docs/manual/bk01ar01.html Modified: trunk/admin/updating.readme trunk/docs/index.html trunk/docs/manual/ac-manual.html trunk/docs/manual/cg-manual.html trunk/docs/manual/index.html trunk/docs/manual/manual.html trunk/docs/manual/ms-manual.html trunk/docs/manual/quick-start.html trunk/php/menu.php Modified: trunk/admin/updating.readme =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/admin/updating.readme 2005-11-26 17:43:55 UTC (rev 241) +++ trunk/admin/updating.readme 2005-11-26 18:43:24 UTC (rev 242) @@ -71,7 +71,10 @@ # ssh over to exonetric and stick the new tarball in ./downloads/, # and move the old one to ./downloads/archive/ ssh ow.vh -su - [fjyb!wiZ0.e] +su - cd /usr/local/www/sites/valgrind-www/downloads/ mv ./valgrind-x.x.x.tar.bz2 ./archive/ mv /home/de/valgrind-x.x.x.tar.bz2 . +chmod a+r ./valgrind-x.x.x.tar.bz2 + +# back on phoenix: Modified: trunk/docs/index.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/index.html 2005-11-26 17:43:55 UTC (rev 241) +++ trunk/docs/index.html 2005-11-26 18:43:24 UTC (rev 242) @@ -1 +1 @@ -<?php include "./manual/quick-start.html"; ?> +<?php include "./manual/index.html"; ?> Added: trunk/docs/manual/QuickStart.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/manual/QuickStart.html (rev 0) +++ trunk/docs/manual/QuickStart.html 2005-11-26 18:43:24 UTC (rev 242) @@ -0,0 +1,40 @@ +<div class=3D"book" lang=3D"en"> +<div class=3D"titlepage"> +<div> +<div><h1 class=3D"title"> +<a name=3D"QuickStart"></a>The Valgrind Quick Start Guide</h1></div> +<div><div class=3D"author"> +<h3 class=3D"author"></h3> +<code class=3D"email"><<a href=3D"mailto:val...@va..."><a hr= ef=3D"mailto:val...@va..." target=3D"_top">val...@va...= </a></a>></code> +</div></div> +<div><p class=3D"releaseinfo">Release 3.1.0 November 25 2005</p></div> +<div><p class=3D"copyright">Copyright =A9 2000-2005 <a href=3D"http://ww= w.valgrind.org/info/developers.html" target=3D"_top">Valgrind Developers<= /a></p></div> +</div> +<hr> +</div> +<div class=3D"toc"> +<p><b>Table of Contents</b></p> +<dl> +<dt><span class=3D"article"><a href=3D"quick-start.html">The Valgrind Qu= ick Start Guide</a></span></dt> +<dd><dl> +<dt><span class=3D"sect1"><a href=3D"quick-start.html#quick-start.intro"= >1. Introduction</a></span></dt> +<dt><span class=3D"sect1"><a href=3D"quick-start.html#quick-start.prepar= e">2. Preparing your program</a></span></dt> +<dt><span class=3D"sect1"><a href=3D"quick-start.html#quick-start.mcrun"= >3. Running your program under Memcheck</a></span></dt> +<dt><span class=3D"sect1"><a href=3D"quick-start.html#quick-start.interp= ret">4. Interpreting Memcheck's output</a></span></dt> +<dt><span class=3D"sect1"><a href=3D"quick-start.html#quick-start.caveat= s">5. Caveats</a></span></dt> +<dt><span class=3D"sect1"><a href=3D"quick-start.html#quick-start.info">= 6. More information</a></span></dt> +</dl></dd> +</dl> +</div> +</div><div xmlns:cf=3D"http://docbook.sourceforge.net/xmlns/chunkfast/1.= 0"> +<br><table class=3D"nav" width=3D"100%" cellspacing=3D"3" cellpadding=3D= "2" border=3D"0" summary=3D"Navigation footer"> +<tr> +<td rowspan=3D"2" width=3D"40%" align=3D"left"> +<a accesskey=3D"p" href=3D"index.html"><<=A0Valgrind Documentation= </a>=A0</td> +<td width=3D"20%" align=3D"center"><a accesskey=3D"u" href=3D"index.html= ">Up</a></td> +<td rowspan=3D"2" width=3D"40%" align=3D"right">=A0<a accesskey=3D"n" hr= ef=3D"quick-start.html">The Valgrind Quick Start Guide=A0>></a> +</td> +</tr> +<tr><td width=3D"20%" align=3D"center"><a accesskey=3D"h" href=3D"index.= html">Home</a></td></tr> +</table> +</div> Modified: trunk/docs/manual/ac-manual.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/manual/ac-manual.html 2005-11-26 17:43:55 UTC (rev 241) +++ trunk/docs/manual/ac-manual.html 2005-11-26 18:43:24 UTC (rev 242) @@ -3,7 +3,7 @@ <a name=3D"ac-manual"></a>4.=A0Addrcheck: a lightweight memory checker</= h2></div></div></div> <div class=3D"toc"> <p><b>Table of Contents</b></p> -<dl><dt><span class=3D"sect1"><a href=3D"ac-manual.html#id2576356">4.1. = Kinds of bugs that Addrcheck can find</a></span></dt></dl> +<dl><dt><span class=3D"sect1"><a href=3D"ac-manual.html#id2570741">4.1. = Kinds of bugs that Addrcheck can find</a></span></dt></dl> </div> <p>To use this tool, you must specify <code class=3D"computeroutput">--tool=3Daddrcheck</code> on the Valgrind @@ -12,7 +12,7 @@ reinstate it in later releases.</p> <div class=3D"sect1" lang=3D"en"> <div class=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear: b= oth"> -<a name=3D"id2576356"></a>4.1.=A0Kinds of bugs that Addrcheck can find</= h2></div></div></div> +<a name=3D"id2570741"></a>4.1.=A0Kinds of bugs that Addrcheck can find</= h2></div></div></div> <p>Addrcheck is a simplified version of the Memcheck tool described in Section 3. It is identical in every way to Memcheck, except for one important detail: it does not do the Deleted: trunk/docs/manual/bk01ar01.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/manual/bk01ar01.html 2005-11-26 17:43:55 UTC (rev 241) +++ trunk/docs/manual/bk01ar01.html 2005-11-26 18:43:24 UTC (rev 242) @@ -1,195 +0,0 @@ -<div class=3D"article" lang=3D"en"> -<div class=3D"titlepage"> -<div><div><h2 class=3D"title"> -<a name=3D"id2552463"></a>The Valgrind Quick Start Guide</h2></div></div= > -<hr> -</div> -<div class=3D"sect1" lang=3D"en"> -<div class=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear: b= oth"> -<a name=3D"quick-start.intro"></a>1.=A0Introduction</h2></div></div></di= v> -<p>The Valgrind distribution has multiple tools. The most popular is th= e -memory checking tool (called Memcheck) which can detect many common memo= ry -errors such as:</p> -<div class=3D"itemizedlist"><ul type=3D"disc"> -<li><p>touching memory you shouldn't (eg. overrunning heap block=20 - boundaries);</p></li> -<li><p>using values before they have been initialized;</p></li> -<li><p>incorrect freeing of memory, such as double-freeing heap - blocks;</p></li> -<li><p>memory leaks.</p></li> -</ul></div> -<p>What follows is the minimum information you need to start detecting -memory errors in your program with Memcheck. Note that this guide appli= es -to Valgrind version 2.4.0 and later; some of the information is not qui= te -right for earlier versions.</p> -</div> -<div class=3D"sect1" lang=3D"en"> -<div class=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear: b= oth"> -<a name=3D"quick-start.prepare"></a>2.=A0Preparing your program</h2></di= v></div></div> -<p>Compile your program with <code class=3D"computeroutput">-g</code> to= include -debugging information so that Memcheck's error messages include exact li= ne -numbers. Using <code class=3D"computeroutput">-O0</code> is also a good= idea, if -you can tolerate the slowdown. With <code class=3D"computeroutput">-O1<= /code>=20 -line numbers in error messages can be inaccurate, although generally spe= aking -Memchecking code compiled at <code class=3D"computeroutput">-O1</code> w= orks=20 -fairly well. Use of <code class=3D"computeroutput">-O2</code> and above= is -not recommended as Memcheck occasionally reports uninitialised-value -errors which don't really exist.</p> -</div> -<div class=3D"sect1" lang=3D"en"> -<div class=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear: b= oth"> -<a name=3D"quick-start.mcrun"></a>3.=A0Running your program under Memche= ck</h2></div></div></div> -<p>If you normally run your program like this: - -</p> -<pre class=3D"programlisting"> - myprog arg1 arg2 -</pre> -<p> - -Use this command line: - -</p> -<pre class=3D"programlisting"> - valgrind --leak-check=3Dyes myprog arg1 arg2 -</pre> -<p> - -Memcheck is the default tool. The -<code class=3D"computeroutput">--leak-check</code> option turns on the d= etailed -memory leak detector.</p> -<p>Your program will run much slower (eg. 20 to 30 times) than normal, -and use a lot more memory. Memcheck will issue messages about memory er= rors -and leaks that it detects.</p> -</div> -<div class=3D"sect1" lang=3D"en"> -<div class=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear: b= oth"> -<a name=3D"quick-start.interpret"></a>4.=A0Interpreting Memcheck's outpu= t</h2></div></div></div> -<p>Here's an example C program with a memory error and a memory leak. - -</p> -<pre class=3D"programlisting"> - #include <stdlib.h> - - void f(void) - { - int* x =3D malloc(10 * sizeof(int)); - x[10] =3D 0; // problem 1: heap block overrun - } // problem 2: memory leak -- x not freed - - int main(void) - { - f(); - return 0; - } -</pre> -<p> - -Most error messages look like the following, which describes problem 1, = the -heap block overrun: - -</p> -<pre class=3D"programlisting"> - =3D=3D19182=3D=3D Invalid write of size 4 - =3D=3D19182=3D=3D at 0x804838F: f (example.c:6) - =3D=3D19182=3D=3D by 0x80483AB: main (example.c:11) - =3D=3D19182=3D=3D Address 0x1BA45050 is 0 bytes after a block of size= 40 alloc'd - =3D=3D19182=3D=3D at 0x1B8FF5CD: malloc (vg_replace_malloc.c:130) - =3D=3D19182=3D=3D by 0x8048385: f (example.c:5) - =3D=3D19182=3D=3D by 0x80483AB: main (example.c:11) -</pre> -<p> - -Things to notice: - -</p> -<div class=3D"itemizedlist"><ul type=3D"disc"> -<li><p>There is a lot of information in each error message; read it - carefully.</p></li> -<li><p>The 19182 is the process ID; it's usually unimportant.</p></li> -<li><p>The first line ("Invalid write...") tells you what kind of error = it - is. Here, the program wrote to some memory it should not have due to a - heap block overrun.</p></li> -<li><p>Below the first line is a stack trace telling you where the probl= em - occurred. Stack traces can get quite large, and be confusing, especi= ally - if you are using the C++ STL. Reading them from the bottom up can he= lp. - If the stack trace is not big enough, use the - <code class=3D"computeroutput">--num-callers</code> option to make it - bigger.</p></li> -<li><p>The code addresses (eg. 0x804838F) are usually unimportant, but - occasionally crucial for tracking down weirder bugs.</p></li> -<li><p>Some error messages have a second component which describes the m= emory - address involved. This one shows that the written memory is just pas= t - the end of a block allocated with malloc() on line 5 of example.c.</p= ></li> -</ul></div> -<p> - -It's worth fixing errors in the order they are reported, as later -errors can be caused by earlier errors.</p> -<p>Memory leak messages look like this: - -</p> -<pre class=3D"programlisting"> - =3D=3D19182=3D=3D 40 bytes in 1 blocks are definitely lost in loss rec= ord 1 of 1 - =3D=3D19182=3D=3D at 0x1B8FF5CD: malloc (vg_replace_malloc.c:130) - =3D=3D19182=3D=3D by 0x8048385: f (a.c:5) - =3D=3D19182=3D=3D by 0x80483AB: main (a.c:11) -</pre> -<p> - -The stack trace tells you where the leaked memory was allocated. -Memcheck cannot tell you why the memory leaked, unfortunately. (Ignore = the -"vg_replace_malloc.c", that's an implementation detail.)</p> -<p>There are several kinds of leaks; the two most important categories = are: - -</p> -<div class=3D"itemizedlist"><ul type=3D"disc"> -<li><p>"definitely lost": your program is leaking memory -- fix - it!</p></li> -<li><p>"probably lost": your program is leaking memory, unless - you're doing funny things with pointers (such as moving them to point= to - the middle of a heap block).</p></li> -</ul></div> -<p> - -If you don't understand an error message, please consult=20 -<a href=3D"mc-manual.html#mc-manual.errormsgs">Explanation of error mess= ages from Memcheck</a> in the <a href=3D"manual.html">Valgrind User Manua= l</a> which has -examples of all the error messages Memcheck produces.</p> -</div> -<div class=3D"sect1" lang=3D"en"> -<div class=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear: b= oth"> -<a name=3D"quick-start.caveats"></a>5.=A0Caveats</h2></div></div></div> -<p>Memcheck is not perfect; it occasionally produces false positives, -and there are mechanisms for suppressing these (see=20 -<a href=3D"manual-core.html#manual-core.suppress">Suppressing errors</a>= in the <a href=3D"manual.html">Valgrind User Manual</a>). -However, it is typically right 99% of the time, so you should be wary of -ignoring its error messages. After all, you wouldn't ignore warning -messages produced by a compiler, right? The suppression mechanism is al= so -useful if Memcheck is reporting errors in library code that you cannot -change; the default suppression set hides a lot of these, but you may -come across more.</p> -<p>Memcheck also cannot detect every memory error your program has. For -example, it can't detect if you overrun the bounds of an array that is -allocated statically or on the stack. But it should detect every error = that -could crash your program (eg. cause a segmentation fault).</p> -</div> -<div class=3D"sect1" lang=3D"en"> -<div class=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear: b= oth"> -<a name=3D"quick-start.info"></a>6.=A0More information</h2></div></div><= /div> -<p>Please consult the <a href=3D"FAQ.html">Valgrind FAQ</a> and the -<a href=3D"manual.html">Valgrind User Manual</a>, which have much more i= nformation. Note that the -other tools in the Valgrind distribution can be invoked with the -<code class=3D"computeroutput">--tool</code> option.</p> -</div> -</div><div xmlns:cf=3D"http://docbook.sourceforge.net/xmlns/chunkfast/1.= 0"> -<br><table class=3D"nav" width=3D"100%" cellspacing=3D"3" cellpadding=3D= "2" border=3D"0" summary=3D"Navigation footer"> -<tr> -<td rowspan=3D"2" width=3D"40%" align=3D"left"> -<a accesskey=3D"p" href=3D"quick-start.html"><<=A0The Valgrind Qui= ck Start Guide</a>=A0</td> -<td width=3D"20%" align=3D"center"><a accesskey=3D"u" href=3D"quick-star= t.html">Up</a></td> -<td rowspan=3D"2" width=3D"40%" align=3D"right">=A0<a accesskey=3D"n" hr= ef=3D"manual.html">Valgrind User Manual=A0>></a> -</td> -</tr> -<tr><td width=3D"20%" align=3D"center"><a accesskey=3D"h" href=3D"index.= html">Home</a></td></tr> -</table> -</div> Modified: trunk/docs/manual/cg-manual.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/manual/cg-manual.html 2005-11-26 17:43:55 UTC (rev 241) +++ trunk/docs/manual/cg-manual.html 2005-11-26 18:43:24 UTC (rev 242) @@ -18,10 +18,10 @@ </dl></dd> <dt><span class=3D"sect1"><a href=3D"cg-manual.html#cg-manual.annopts">5= .3. <code class=3D"computeroutput">cg_annotate</code> options</a></span><= /dt> <dd><dl> -<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2597747">5.3.1. Wa= rnings</a></span></dt> -<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2613379">5.3.2. Th= ings to watch out for</a></span></dt> -<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2552721">5.3.3. Ac= curacy</a></span></dt> -<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2614451">5.3.4. To= do</a></span></dt> +<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2599180">5.3.1. Wa= rnings</a></span></dt> +<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2588740">5.3.2. Th= ings to watch out for</a></span></dt> +<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2592950">5.3.3. Ac= curacy</a></span></dt> +<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2580615">5.3.4. To= do</a></span></dt> </dl></dd> </dl> </div> @@ -615,7 +615,7 @@ </ul></div> <div class=3D"sect2" lang=3D"en"> <div class=3D"titlepage"><div><div><h3 class=3D"title"> -<a name=3D"id2597747"></a>5.3.1.=A0Warnings</h3></div></div></div> +<a name=3D"id2599180"></a>5.3.1.=A0Warnings</h3></div></div></div> <p>There are a couple of situations in which <code class=3D"computeroutput">cg_annotate</code> issues warnings.</p> @@ -638,7 +638,7 @@ </div> <div class=3D"sect2" lang=3D"en"> <div class=3D"titlepage"><div><div><h3 class=3D"title"> -<a name=3D"id2613379"></a>5.3.2.=A0Things to watch out for</h3></div></d= iv></div> +<a name=3D"id2588740"></a>5.3.2.=A0Things to watch out for</h3></div></d= iv></div> <p>Some odd things that can occur during annotation:</p> <div class=3D"itemizedlist"><ul type=3D"disc"> <li> @@ -732,7 +732,7 @@ </div> <div class=3D"sect2" lang=3D"en"> <div class=3D"titlepage"><div><div><h3 class=3D"title"> -<a name=3D"id2552721"></a>5.3.3.=A0Accuracy</h3></div></div></div> +<a name=3D"id2592950"></a>5.3.3.=A0Accuracy</h3></div></div></div> <p>Valgrind's cache profiling has a number of shortcomings:</p> <div class=3D"itemizedlist"><ul type=3D"disc"> @@ -778,7 +778,7 @@ </div> <div class=3D"sect2" lang=3D"en"> <div class=3D"titlepage"><div><div><h3 class=3D"title"> -<a name=3D"id2614451"></a>5.3.4.=A0Todo</h3></div></div></div> +<a name=3D"id2580615"></a>5.3.4.=A0Todo</h3></div></div></div> <div class=3D"itemizedlist"><ul type=3D"disc"><li><p>Program start-up/sh= ut-down calls a lot of functions that aren't interesting and just complicate the output. Would be nice to exclude these somehow.</p></li></ul></div> Modified: trunk/docs/manual/index.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/manual/index.html 2005-11-26 17:43:55 UTC (rev 241) +++ trunk/docs/manual/index.html 2005-11-26 18:43:24 UTC (rev 242) @@ -22,7 +22,7 @@ <div class=3D"toc"> <p><b>Table of Contents</b></p> <dl> -<dt><span class=3D"book"><a href=3D"quick-start.html">The Valgrind Quick= Start Guide</a></span></dt> +<dt><span class=3D"book"><a href=3D"QuickStart.html">The Valgrind Quick = Start Guide</a></span></dt> <dt><span class=3D"book"><a href=3D"manual.html">Valgrind User Manual</a= ></span></dt> <dt><span class=3D"book"><a href=3D"FAQ.html">Valgrind FAQ</a></span></d= t> <dt><span class=3D"book"><a href=3D"tech-docs.html">Valgrind Technical D= ocumentation</a></span></dt> @@ -34,7 +34,7 @@ <br><table class=3D"nav" width=3D"100%" cellspacing=3D"3" cellpadding=3D= "2" border=3D"0" summary=3D"Navigation footer"><tr> <td rowspan=3D"2" width=3D"40%" align=3D"left">=A0</td> <td width=3D"20%" align=3D"center">=A0</td> -<td rowspan=3D"2" width=3D"40%" align=3D"right">=A0<a accesskey=3D"n" hr= ef=3D"quick-start.html">The Valgrind Quick Start Guide=A0>></a> +<td rowspan=3D"2" width=3D"40%" align=3D"right">=A0<a accesskey=3D"n" hr= ef=3D"QuickStart.html">The Valgrind Quick Start Guide=A0>></a> </td> </tr></table> </div> Modified: trunk/docs/manual/manual.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/manual/manual.html 2005-11-26 17:43:55 UTC (rev 241) +++ trunk/docs/manual/manual.html 2005-11-26 18:43:24 UTC (rev 242) @@ -72,7 +72,7 @@ <dt><span class=3D"sect1"><a href=3D"mc-manual.html#mc-manual.clientreqs= ">3.6. Client Requests</a></span></dt> </dl></dd> <dt><span class=3D"chapter"><a href=3D"ac-manual.html">4. Addrcheck: a l= ightweight memory checker</a></span></dt> -<dd><dl><dt><span class=3D"sect1"><a href=3D"ac-manual.html#id2576356">4= .1. Kinds of bugs that Addrcheck can find</a></span></dt></dl></dd> +<dd><dl><dt><span class=3D"sect1"><a href=3D"ac-manual.html#id2570741">4= .1. Kinds of bugs that Addrcheck can find</a></span></dt></dl></dd> <dt><span class=3D"chapter"><a href=3D"cg-manual.html">5. Cachegrind: a = cache profiler</a></span></dt> <dd><dl> <dt><span class=3D"sect1"><a href=3D"cg-manual.html#cg-manual.cache">5.1= . Cache profiling</a></span></dt> @@ -89,10 +89,10 @@ </dl></dd> <dt><span class=3D"sect1"><a href=3D"cg-manual.html#cg-manual.annopts">5= .3. <code class=3D"computeroutput">cg_annotate</code> options</a></span><= /dt> <dd><dl> -<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2597747">5.3.1. Wa= rnings</a></span></dt> -<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2613379">5.3.2. Th= ings to watch out for</a></span></dt> -<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2552721">5.3.3. Ac= curacy</a></span></dt> -<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2614451">5.3.4. To= do</a></span></dt> +<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2599180">5.3.1. Wa= rnings</a></span></dt> +<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2588740">5.3.2. Th= ings to watch out for</a></span></dt> +<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2592950">5.3.3. Ac= curacy</a></span></dt> +<dt><span class=3D"sect2"><a href=3D"cg-manual.html#id2580615">5.3.4. To= do</a></span></dt> </dl></dd> </dl></dd> <dt><span class=3D"chapter"><a href=3D"ms-manual.html">6. Massif: a heap= profiler</a></span></dt> @@ -118,7 +118,7 @@ <br><table class=3D"nav" width=3D"100%" cellspacing=3D"3" cellpadding=3D= "2" border=3D"0" summary=3D"Navigation footer"> <tr> <td rowspan=3D"2" width=3D"40%" align=3D"left"> -<a accesskey=3D"p" href=3D"bk01ar01.html"><<=A0The Valgrind Quick = Start Guide</a>=A0</td> +<a accesskey=3D"p" href=3D"quick-start.html"><<=A0The Valgrind Qui= ck Start Guide</a>=A0</td> <td width=3D"20%" align=3D"center"><a accesskey=3D"u" href=3D"index.html= ">Up</a></td> <td rowspan=3D"2" width=3D"40%" align=3D"right">=A0<a accesskey=3D"n" hr= ef=3D"manual-intro.html">1.=A0Introduction=A0>></a> </td> Modified: trunk/docs/manual/ms-manual.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/manual/ms-manual.html 2005-11-26 17:43:55 UTC (rev 241) +++ trunk/docs/manual/ms-manual.html 2005-11-26 18:43:24 UTC (rev 242) @@ -169,7 +169,7 @@ profiling data.</p> <p>Here's an example graph:</p> <div class=3D"mediaobject"> -<a name=3D"spacetime-graph"></a><img src=3D"massif-graph-sm.png" alt=3D"= Spacetime Graph"> +<a name=3D"spacetime-graph"></a><img src=3D"images/massif-graph-sm.png" = alt=3D"Spacetime Graph"> </div> <p>The graph is broken into several bands. Most bands represent a single line of your program that does some heap Modified: trunk/docs/manual/quick-start.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/manual/quick-start.html 2005-11-26 17:43:55 UTC (rev 241) +++ trunk/docs/manual/quick-start.html 2005-11-26 18:43:24 UTC (rev 242) @@ -1,38 +1,193 @@ -<div class=3D"book" lang=3D"en"> +<div class=3D"article" lang=3D"en"> <div class=3D"titlepage"> -<div> -<div><h1 class=3D"title"> -<a name=3D"quick-start"></a>The Valgrind Quick Start Guide</h1></div> -<div><div class=3D"author"> -<h3 class=3D"author"></h3> -<code class=3D"email"><<a href=3D"mailto:val...@va..."><a hr= ef=3D"mailto:val...@va..." target=3D"_top">val...@va...= </a></a>></code> -</div></div> -<div><p class=3D"releaseinfo">Release 3.1.0 November 25 2005</p></div> -<div><p class=3D"copyright">Copyright =A9 2000-2005 <a href=3D"http://ww= w.valgrind.org/info/developers.html" target=3D"_top">Valgrind Developers<= /a></p></div> -</div> +<div><div><h2 class=3D"title"> +<a name=3D"quick-start"></a>The Valgrind Quick Start Guide</h2></div></d= iv> <hr> </div> -<div class=3D"toc"> -<p><b>Table of Contents</b></p> -<dl> -<dt><span class=3D"article"><a href=3D"bk01ar01.html">The Valgrind Quick= Start Guide</a></span></dt> -<dd><dl> -<dt><span class=3D"sect1"><a href=3D"bk01ar01.html#quick-start.intro">1.= Introduction</a></span></dt> -<dt><span class=3D"sect1"><a href=3D"bk01ar01.html#quick-start.prepare">= 2. Preparing your program</a></span></dt> -<dt><span class=3D"sect1"><a href=3D"bk01ar01.html#quick-start.mcrun">3.= Running your program under Memcheck</a></span></dt> -<dt><span class=3D"sect1"><a href=3D"bk01ar01.html#quick-start.interpret= ">4. Interpreting Memcheck's output</a></span></dt> -<dt><span class=3D"sect1"><a href=3D"bk01ar01.html#quick-start.caveats">= 5. Caveats</a></span></dt> -<dt><span class=3D"sect1"><a href=3D"bk01ar01.html#quick-start.info">6. = More information</a></span></dt> -</dl></dd> -</dl> +<div class=3D"sect1" lang=3D"en"> +<div class=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear: b= oth"> +<a name=3D"quick-start.intro"></a>1.=A0Introduction</h2></div></div></di= v> +<p>The Valgrind distribution has multiple tools. The most popular is th= e +memory checking tool (called Memcheck) which can detect many common memo= ry +errors such as:</p> +<div class=3D"itemizedlist"><ul type=3D"disc"> +<li><p>touching memory you shouldn't (eg. overrunning heap block=20 + boundaries);</p></li> +<li><p>using values before they have been initialized;</p></li> +<li><p>incorrect freeing of memory, such as double-freeing heap + blocks;</p></li> +<li><p>memory leaks.</p></li> +</ul></div> +<p>What follows is the minimum information you need to start detecting +memory errors in your program with Memcheck. Note that this guide appli= es +to Valgrind version 2.4.0 and later; some of the information is not qui= te +right for earlier versions.</p> </div> +<div class=3D"sect1" lang=3D"en"> +<div class=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear: b= oth"> +<a name=3D"quick-start.prepare"></a>2.=A0Preparing your program</h2></di= v></div></div> +<p>Compile your program with <code class=3D"computeroutput">-g</code> to= include +debugging information so that Memcheck's error messages include exact li= ne +numbers. Using <code class=3D"computeroutput">-O0</code> is also a good= idea, if +you can tolerate the slowdown. With <code class=3D"computeroutput">-O1<= /code>=20 +line numbers in error messages can be inaccurate, although generally spe= aking +Memchecking code compiled at <code class=3D"computeroutput">-O1</code> w= orks=20 +fairly well. Use of <code class=3D"computeroutput">-O2</code> and above= is +not recommended as Memcheck occasionally reports uninitialised-value +errors which don't really exist.</p> +</div> +<div class=3D"sect1" lang=3D"en"> +<div class=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear: b= oth"> +<a name=3D"quick-start.mcrun"></a>3.=A0Running your program under Memche= ck</h2></div></div></div> +<p>If you normally run your program like this: + +</p> +<pre class=3D"programlisting"> + myprog arg1 arg2 +</pre> +<p> + +Use this command line: + +</p> +<pre class=3D"programlisting"> + valgrind --leak-check=3Dyes myprog arg1 arg2 +</pre> +<p> + +Memcheck is the default tool. The +<code class=3D"computeroutput">--leak-check</code> option turns on the d= etailed +memory leak detector.</p> +<p>Your program will run much slower (eg. 20 to 30 times) than normal, +and use a lot more memory. Memcheck will issue messages about memory er= rors +and leaks that it detects.</p> +</div> +<div class=3D"sect1" lang=3D"en"> +<div class=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear: b= oth"> +<a name=3D"quick-start.interpret"></a>4.=A0Interpreting Memcheck's outpu= t</h2></div></div></div> +<p>Here's an example C program with a memory error and a memory leak. + +</p> +<pre class=3D"programlisting"> + #include <stdlib.h> + + void f(void) + { + int* x =3D malloc(10 * sizeof(int)); + x[10] =3D 0; // problem 1: heap block overrun + } // problem 2: memory leak -- x not freed + + int main(void) + { + f(); + return 0; + } +</pre> +<p> + +Most error messages look like the following, which describes problem 1, = the +heap block overrun: + +</p> +<pre class=3D"programlisting"> + =3D=3D19182=3D=3D Invalid write of size 4 + =3D=3D19182=3D=3D at 0x804838F: f (example.c:6) + =3D=3D19182=3D=3D by 0x80483AB: main (example.c:11) + =3D=3D19182=3D=3D Address 0x1BA45050 is 0 bytes after a block of size= 40 alloc'd + =3D=3D19182=3D=3D at 0x1B8FF5CD: malloc (vg_replace_malloc.c:130) + =3D=3D19182=3D=3D by 0x8048385: f (example.c:5) + =3D=3D19182=3D=3D by 0x80483AB: main (example.c:11) +</pre> +<p> + +Things to notice: + +</p> +<div class=3D"itemizedlist"><ul type=3D"disc"> +<li><p>There is a lot of information in each error message; read it + carefully.</p></li> +<li><p>The 19182 is the process ID; it's usually unimportant.</p></li> +<li><p>The first line ("Invalid write...") tells you what kind of error = it + is. Here, the program wrote to some memory it should not have due to a + heap block overrun.</p></li> +<li><p>Below the first line is a stack trace telling you where the probl= em + occurred. Stack traces can get quite large, and be confusing, especi= ally + if you are using the C++ STL. Reading them from the bottom up can he= lp. + If the stack trace is not big enough, use the + <code class=3D"computeroutput">--num-callers</code> option to make it + bigger.</p></li> +<li><p>The code addresses (eg. 0x804838F) are usually unimportant, but + occasionally crucial for tracking down weirder bugs.</p></li> +<li><p>Some error messages have a second component which describes the m= emory + address involved. This one shows that the written memory is just pas= t + the end of a block allocated with malloc() on line 5 of example.c.</p= ></li> +</ul></div> +<p> + +It's worth fixing errors in the order they are reported, as later +errors can be caused by earlier errors.</p> +<p>Memory leak messages look like this: + +</p> +<pre class=3D"programlisting"> + =3D=3D19182=3D=3D 40 bytes in 1 blocks are definitely lost in loss rec= ord 1 of 1 + =3D=3D19182=3D=3D at 0x1B8FF5CD: malloc (vg_replace_malloc.c:130) + =3D=3D19182=3D=3D by 0x8048385: f (a.c:5) + =3D=3D19182=3D=3D by 0x80483AB: main (a.c:11) +</pre> +<p> + +The stack trace tells you where the leaked memory was allocated. +Memcheck cannot tell you why the memory leaked, unfortunately. (Ignore = the +"vg_replace_malloc.c", that's an implementation detail.)</p> +<p>There are several kinds of leaks; the two most important categories = are: + +</p> +<div class=3D"itemizedlist"><ul type=3D"disc"> +<li><p>"definitely lost": your program is leaking memory -- fix + it!</p></li> +<li><p>"probably lost": your program is leaking memory, unless + you're doing funny things with pointers (such as moving them to point= to + the middle of a heap block).</p></li> +</ul></div> +<p> + +If you don't understand an error message, please consult=20 +<a href=3D"mc-manual.html#mc-manual.errormsgs">Explanation of error mess= ages from Memcheck</a> in the <a href=3D"manual.html">Valgrind User Manua= l</a> which has +examples of all the error messages Memcheck produces.</p> +</div> +<div class=3D"sect1" lang=3D"en"> +<div class=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear: b= oth"> +<a name=3D"quick-start.caveats"></a>5.=A0Caveats</h2></div></div></div> +<p>Memcheck is not perfect; it occasionally produces false positives, +and there are mechanisms for suppressing these (see=20 +<a href=3D"manual-core.html#manual-core.suppress">Suppressing errors</a>= in the <a href=3D"manual.html">Valgrind User Manual</a>). +However, it is typically right 99% of the time, so you should be wary of +ignoring its error messages. After all, you wouldn't ignore warning +messages produced by a compiler, right? The suppression mechanism is al= so +useful if Memcheck is reporting errors in library code that you cannot +change; the default suppression set hides a lot of these, but you may +come across more.</p> +<p>Memcheck also cannot detect every memory error your program has. For +example, it can't detect if you overrun the bounds of an array that is +allocated statically or on the stack. But it should detect every error = that +could crash your program (eg. cause a segmentation fault).</p> +</div> +<div class=3D"sect1" lang=3D"en"> +<div class=3D"titlepage"><div><div><h2 class=3D"title" style=3D"clear: b= oth"> +<a name=3D"quick-start.info"></a>6.=A0More information</h2></div></div><= /div> +<p>Please consult the <a href=3D"FAQ.html">Valgrind FAQ</a> and the +<a href=3D"manual.html">Valgrind User Manual</a>, which have much more i= nformation. Note that the +other tools in the Valgrind distribution can be invoked with the +<code class=3D"computeroutput">--tool</code> option.</p> +</div> </div><div xmlns:cf=3D"http://docbook.sourceforge.net/xmlns/chunkfast/1.= 0"> <br><table class=3D"nav" width=3D"100%" cellspacing=3D"3" cellpadding=3D= "2" border=3D"0" summary=3D"Navigation footer"> <tr> <td rowspan=3D"2" width=3D"40%" align=3D"left"> -<a accesskey=3D"p" href=3D"index.html"><<=A0Valgrind Documentation= </a>=A0</td> -<td width=3D"20%" align=3D"center"><a accesskey=3D"u" href=3D"index.html= ">Up</a></td> -<td rowspan=3D"2" width=3D"40%" align=3D"right">=A0<a accesskey=3D"n" hr= ef=3D"bk01ar01.html">The Valgrind Quick Start Guide=A0>></a> +<a accesskey=3D"p" href=3D"QuickStart.html"><<=A0The Valgrind Quic= k Start Guide</a>=A0</td> +<td width=3D"20%" align=3D"center"><a accesskey=3D"u" href=3D"QuickStart= .html">Up</a></td> +<td rowspan=3D"2" width=3D"40%" align=3D"right">=A0<a accesskey=3D"n" hr= ef=3D"manual.html">Valgrind User Manual=A0>></a> </td> </tr> <tr><td width=3D"20%" align=3D"center"><a accesskey=3D"h" href=3D"index.= html">Home</a></td></tr> Modified: trunk/php/menu.php =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/php/menu.php 2005-11-26 17:43:55 UTC (rev 241) +++ trunk/php/menu.php 2005-11-26 18:43:24 UTC (rev 242) @@ -17,6 +17,7 @@ ); =20 $docs =3D array( + array( 'url'=3D>'manual/index.html', 'tag'=3D>'Table of Contents= ' ), array( 'url'=3D>'manual/quick-start.html', 'tag'=3D>'Quick Start' ), array( 'url'=3D>'manual/FAQ.html', 'tag'=3D>'FAQ' ), array( 'url'=3D>'manual/manual.html', 'tag'=3D>'User Manual' ), |