From: Nicholas Nethercote Date: Fri, 7 Aug 2009 02:58:11 +0000 (+0000) Subject: Went over the FAQ. Also tweaked vg-entities.xml a bit. X-Git-Tag: svn/VALGRIND_3_5_0~118 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=41876dfd59c5c916e05aa213e4821007e1efb66e;p=thirdparty%2Fvalgrind.git Went over the FAQ. Also tweaked vg-entities.xml a bit. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10732 --- diff --git a/cachegrind/docs/cg-manual.xml b/cachegrind/docs/cg-manual.xml index 90a8d43b22..7eedb134c9 100644 --- a/cachegrind/docs/cg-manual.xml +++ b/cachegrind/docs/cg-manual.xml @@ -1245,7 +1245,7 @@ use Cachegrind, but may be of interest to some people. How Cachegrind Works The best reference for understanding how Cachegrind works is chapter 3 of "Dynamic Binary Analysis and Instrumentation", by Nicholas Nethercote. It -is available on the Valgrind publications +is available on the Valgrind publications page. diff --git a/docs/xml/FAQ.xml b/docs/xml/FAQ.xml index 22409a4119..8454f2e237 100644 --- a/docs/xml/FAQ.xml +++ b/docs/xml/FAQ.xml @@ -11,7 +11,7 @@ &rel-type; &rel-version; &rel-date; &vg-lifespan; - Valgrind Developers + Valgrind Developers Email: &vg-vemail; @@ -52,7 +52,7 @@ From Nordic mythology. Originally (before release) the project was named Heimdall, after the watchman of the Nordic gods. He could "see a hundred miles by day or night, hear the grass growing, see the - wool growing on a sheep's back" (etc). This would have been a great + wool growing on a sheep's back", etc. This would have been a great name, but it was already taken by a security package "Heimdal". Keeping with the Nordic theme, Valgrind was chosen. Valgrind is @@ -78,7 +78,7 @@ - When I trying building Valgrind, 'make' dies partway with + When building Valgrind, 'make' dies partway with an assertion failure, something like this: % make: expand.c:489: allocated_variable_append: @@ -88,20 +88,20 @@ It's probably a bug in 'make'. Some, but not all, instances of version 3.79.1 have this bug, see - www.mail-archive.com/bug-make@gnu.org/msg01658.html. Try upgrading to - a more recent version of 'make'. Alternatively, we have heard that - unsetting the CFLAGS environment variable avoids the problem. + this. + Try upgrading to a more recent version of 'make'. Alternatively, we have + heard that unsetting the CFLAGS environment variable avoids the + problem. - When I try to build Valgrind, 'make' fails with - + When building Valgrind, 'make' fails with this: + /usr/bin/ld: cannot find -lc collect2: ld returned 1 exit status - - + You need to install the glibc-static-devel package. @@ -118,17 +118,17 @@ collect2: ld returned 1 exit status Programs run OK on Valgrind, but at exit produce a bunch of - errors involving __libc_freeres() and then die + errors involving __libc_freeres and then die with a segmentation fault. When the program exits, Valgrind runs the procedure - __libc_freeres() in glibc. This is a hook for + __libc_freeres in glibc. This is a hook for memory debuggers, so they can ask glibc to free up any memory it has used. Doing that is needed to ensure that Valgrind doesn't incorrectly report space leaks in glibc. - Problem is that running __libc_freeres() in + The problem is that running __libc_freeres in older glibc versions causes this crash. Workaround for 1.1.X and later versions of Valgrind: use the @@ -237,9 +237,9 @@ collect2: ld returned 1 exit status memory pool allocators. Memory for quite a number of destructed objects is not immediately freed and given back to the OS, but kept in the pool(s) for later re-use. The fact that the pools are not - freed at the exit() of the program cause Valgrind to report this + freed at the exit of the program cause Valgrind to report this memory as still reachable. The behaviour not to free pools at the - exit() could be called a bug of the library though. + exit could be called a bug of the library though. Using GCC, you can force the STL to use malloc and to free memory as soon as possible by globally disabling memory caching. @@ -269,8 +269,8 @@ collect2: ld returned 1 exit status by reading - http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#4_4_leak if - you absolutely want to do that. But beware: + http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#4_4_leak + if you absolutely want to do that. But beware: allocators belong to the more messy parts of the STL and people went to great lengths to make the STL portable across platforms. Chances are good that your solution will work on your @@ -297,7 +297,7 @@ collect2: ld returned 1 exit status object is unloaded before the program terminates, Valgrind will discard the debug information and the error message will be full of ??? entries. The workaround here is to avoid - calling dlclose() on these shared objects. + calling dlclose on these shared objects. Also, and can make stack traces worse. @@ -369,9 +369,11 @@ Invalid write of size 1 Occasionally Valgrind stack traces get the wrong function names. This is caused by glibc using aliases to effectively give one function two names. Most of the time Valgrind chooses a - suitable name, but very occasionally it gets it wrong. Examples we - know of are printing 'bcmp' instead of 'memcmp', 'index' instead of - 'strchr', and 'rindex' instead of 'strrchr'. + suitable name, but very occasionally it gets it wrong. Examples we know + of are printing bcmp instead of + memcmp, index instead of + strchr, and rindex instead of + strrchr. @@ -401,19 +403,12 @@ Invalid write of size 1 - - - - -Memcheck doesn't find my bug - - I try running "valgrind --tool=memcheck my_program" and get - Valgrind's startup message, but I don't get any errors and I know my - program has errors. + Memcheck doesn't report any errors and I know my program has + errors. There are two possible causes of this. @@ -442,13 +437,13 @@ valgrind-listener 12345 Second, if your program is statically linked, most Valgrind tools won't work as well, because they won't be able to replace - certain functions, such as malloc(), with their own versions. A key - indicator of this is if Memcheck says: + certain functions, such as malloc, with their own + versions. A key indicator of this is if Memcheck says: All heap blocks were freed -- no leaks are possible - when you know your program calls malloc(). The workaround is to - avoid statically linking your program. + when you know your program calls malloc. The + workaround is to avoid statically linking your program. @@ -475,6 +470,10 @@ int main(void) Unfortunately, Memcheck doesn't do bounds checking on static or stack arrays. We'd like to, but it's just not possible to do in a reasonable way that fits with how Memcheck works. Sorry. + + However, the experimental tool Ptrcheck can detect errors like + this. Run Valgrind with the option + to try it, but beware that it is not as robust as Memcheck. @@ -612,48 +611,31 @@ int main(void) How To Get Further Assistance + + - Please read all of this section before posting. - - If you think an answer is incomplete or inaccurate, please - e-mail &vg-vemail;. - Read the appropriate section(s) of the - Valgrind Documentation. - - Read the - Distribution Documents. + Valgrind Documentation. Search the valgrind-users mailing list archives, using the group name gmane.comp.debugging.valgrind. - Only when you have tried all of these things and are still - stuck, should you post to the - valgrind-users mailing list. In - which case, please read the following carefully. Making a complete - posting will greatly increase the chances that an expert or fellow - user reading it will have enough information and motivation to - reply. - - Make sure you give full details of the problem, including the - full output of valgrind -v <your-prog>, if - applicable. Also which Linux distribution you're using (Red Hat, - Debian, etc) and its version number. - - You are in little danger of making your posting too long unless - you include large chunks of Valgrind's (unsuppressed) output, so err - on the side of giving too much information. - - Clearly written subject lines and message bodies are - appreciated, too. - - Finally, remember that, despite the fact that most of the - community are very helpful and responsive to emailed questions, you - are probably requesting help from unpaid volunteers, so you have no - guarantee of receiving an answer. + If you think an answer in this FAQ is incomplete or inaccurate, please + e-mail &vg-vemail;. + + If you have tried all of these things and are still + stuck, you can try mailing the + valgrind-users mailing list. + Note that an email has a better change of being answered usefully if it is + clearly written. Also remember that, despite the fact that most of the + community are very helpful and responsive to emailed questions, you are + probably requesting help from unpaid volunteers, so you have no guarantee + of receiving an answer. diff --git a/docs/xml/dist-docs.xml b/docs/xml/dist-docs.xml index 599ffb082d..b5ccf68b9f 100644 --- a/docs/xml/dist-docs.xml +++ b/docs/xml/dist-docs.xml @@ -11,7 +11,7 @@ &rel-type; &rel-version; &rel-date; &vg-lifespan; - Valgrind Developers + Valgrind Developers Email: &vg-vemail; diff --git a/docs/xml/manual-writing-tools.xml b/docs/xml/manual-writing-tools.xml index e579d7be8b..046f4b2e7b 100644 --- a/docs/xml/manual-writing-tools.xml +++ b/docs/xml/manual-writing-tools.xml @@ -54,7 +54,7 @@ when the option is used to select it. To write your own tool, you'll need the Valgrind source code. You'll need a check-out of the Subversion repository for the automake/autoconf build instructions to work. See the information about how to do check-out -from the repository at the Valgrind +from the repository at the Valgrind website. diff --git a/docs/xml/manual.xml b/docs/xml/manual.xml index 8694aacd8b..5a01af2a73 100644 --- a/docs/xml/manual.xml +++ b/docs/xml/manual.xml @@ -11,7 +11,7 @@ &rel-type; &rel-version; &rel-date; &vg-lifespan; - Valgrind Developers + Valgrind Developers Email: &vg-vemail; diff --git a/docs/xml/quick-start-guide.xml b/docs/xml/quick-start-guide.xml index 748d20930b..306c90866d 100644 --- a/docs/xml/quick-start-guide.xml +++ b/docs/xml/quick-start-guide.xml @@ -10,7 +10,7 @@ &rel-type; &rel-version; &rel-date; &vg-lifespan; - Valgrind Developers + Valgrind Developers Email: &vg-vemail; diff --git a/docs/xml/tech-docs.xml b/docs/xml/tech-docs.xml index 8be5922fb6..918e8e37eb 100644 --- a/docs/xml/tech-docs.xml +++ b/docs/xml/tech-docs.xml @@ -10,7 +10,7 @@ &rel-type; &rel-version; &rel-date; &vg-lifespan; - Valgrind Developers + Valgrind Developers Email: &vg-vemail; diff --git a/docs/xml/valgrind-manpage.xml b/docs/xml/valgrind-manpage.xml index 41e74fd4fa..64ccf1d5a6 100644 --- a/docs/xml/valgrind-manpage.xml +++ b/docs/xml/valgrind-manpage.xml @@ -42,8 +42,8 @@ below it describe tool-specific options. This manual page covers only basic usage and options. For more comprehensive information, please see the HTML documentation on your -system: &vg-doc-path;, or online: -&vg-bookset;. +system: &vg-docs-path;, or online: +&vg-docs-url;. @@ -223,9 +223,9 @@ system: &vg-doc-path;, or online: See Also -&vg-doc-path;, +&vg-docs-path;, and/or -&vg-bookset;. +&vg-docs-url;. diff --git a/docs/xml/vg-entities.xml b/docs/xml/vg-entities.xml index 91e4b30b5b..1f0d0652fa 100644 --- a/docs/xml/vg-entities.xml +++ b/docs/xml/vg-entities.xml @@ -1,9 +1,7 @@ - - @@ -11,14 +9,14 @@ - + - - - - - - + + + + + +