From: Julian Seward Date: Mon, 22 Dec 2008 01:00:15 +0000 (+0000) Subject: Minor updates for 3.4.0. Also fix a large number of missing X-Git-Tag: svn/VALGRIND_3_4_0~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7d583fcbde62a6bc2b778584768ff5f5e25590d;p=thirdparty%2Fvalgrind.git Minor updates for 3.4.0. Also fix a large number of missing and tags. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8861 --- diff --git a/docs/xml/quick-start-guide.xml b/docs/xml/quick-start-guide.xml index d93f9d1ec6..fbb1cd6d09 100644 --- a/docs/xml/quick-start-guide.xml +++ b/docs/xml/quick-start-guide.xml @@ -79,7 +79,7 @@ Other tools you may find useful are: the codebase. They can be distinguished by the "exp-" prefix on their names. Experimental tools are not subject to the same quality control standards that apply to our production-grade tools - (Memcheck, Cachegrind, Callgrind, Massif and Helgrind). + (Memcheck, Cachegrind, Callgrind, Massif, Helgrind and DRD). @@ -89,7 +89,7 @@ Valgrind User Manual. What follows is the minimum information you need to start detecting memory errors in your program with Memcheck. Note that this -guide applies to Valgrind version 3.3.0 and later. Some of the +guide applies to Valgrind version 3.4.0 and later. Some of the information is not quite right for earlier versions. @@ -104,7 +104,8 @@ numbers. Using -O0 is also a good idea, if you can tolerate the slowdown. With -O1 line numbers in error messages can be inaccurate, although generally speaking Memchecking code compiled at --O1 works fairly well. Use of +-O1 works fairly well and is +recommended. Use of -O2 and above is not recommended as Memcheck occasionally reports uninitialised-value errors which don't really exist. @@ -115,16 +116,16 @@ really exist. Running your program under Memcheck -If you normally run your program like this: +If you normally run your program like this: myprog arg1 arg2 -Use this command line: +Use this command line: valgrind --leak-check=yes myprog arg1 arg2 -Memcheck is the default tool. The option -turns on the detailed memory leak detector. +Memcheck is the default tool. The +option turns on the detailed memory leak detector. Your program will run much slower (eg. 20 to 30 times) than normal, and use a lot more memory. Memcheck will issue messages about @@ -136,7 +137,8 @@ memory errors and leaks that it detects. Interpreting Memcheck's output -Here's an example C program with a memory error and a memory leak. +Here's an example C program with a memory error and a memory +leak. #include <stdlib.h> @@ -154,8 +156,8 @@ memory errors and leaks that it detects. } -Most error messages look like the following, which describes problem 1, -the heap block overrun: +Most error messages look like the following, which describes +problem 1, the heap block overrun: ==19182== Invalid write of size 4 @@ -167,7 +169,7 @@ the heap block overrun: ==19182== by 0x80483AB: main (example.c:11) -Things to notice: +Things to notice: @@ -202,11 +204,11 @@ Things to notice: -It's worth fixing errors in the order they are reported, as later -errors can be caused by earlier errors. Failing to do this is a +It's worth fixing errors in the order they are reported, as +later errors can be caused by earlier errors. Failing to do this is a common cause of difficulty with Memcheck. -Memory leak messages look like this: +Memory leak messages look like this: ==19182== 40 bytes in 1 blocks are definitely lost in loss record 1 of 1 @@ -215,12 +217,13 @@ common cause of difficulty with Memcheck. ==19182== by 0x80483AB: main (a.c:11) -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.) +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.) There are several kinds of leaks; the two most important -categories are: +categories are: @@ -234,7 +237,14 @@ categories are: -If you don't understand an error message, please consult +It can be difficult to track down the root causes of +uninitialised-value errors reported by Memcheck. Try using +the to get extra information. +This makes Memcheck run slower, but the extra information you get +often saves a lot of time figuring out where the uninitialised values +are coming from. + +If you don't understand an error message, please consult in the which has examples of all the error messages Memcheck produces.