njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> <!-- -*- sgml -*- --> |
| 2 | <!DOCTYPE book 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 "vg-entities.xml"> %vg-entities; ]> |
| 5 | |
| 6 | <book id="FAQ" xreflabel="Valgrind FAQ"> |
| 7 | |
| 8 | <bookinfo> |
| 9 | <title>Valgrind FAQ</title> |
| 10 | </bookinfo> |
| 11 | |
| 12 | |
| 13 | <chapter id="faq.background" xreflabel="Background"> |
| 14 | <title>Background</title> |
| 15 | |
| 16 | <qandaset id="qset.background"> |
| 17 | |
| 18 | <qandaentry id="faq.pronounce"> |
| 19 | <question> |
| 20 | <para>How do you pronounce "Valgrind"?</para> |
| 21 | </question> |
| 22 | <answer> |
| 23 | <para>The "Val" as in the world "value". The "grind" is |
| 24 | pronounced with a short 'i' -- ie. "grinned" (rhymes with |
| 25 | "tinned") rather than "grined" (rhymes with "find").</para> |
| 26 | <para>Don't feel bad: almost everyone gets it wrong at |
| 27 | first.</para> |
| 28 | </answer> |
| 29 | </qandaentry> |
| 30 | |
| 31 | <qandaentry id="faq.whence"> |
| 32 | <question> |
| 33 | <para>Where does the name "Valgrind" come from?</para> |
| 34 | </question> |
| 35 | <answer> |
| 36 | <para>From Nordic mythology. Originally (before release) the |
| 37 | project was named Heimdall, after the watchman of the Nordic |
| 38 | gods. He could "see a hundred miles by day or night, hear the |
| 39 | grass growing, see the wool growing on a sheep's back" (etc). |
| 40 | This would have been a great name, but it was already taken by |
| 41 | a security package "Heimdal".</para> <para>Keeping with the |
| 42 | Nordic theme, Valgrind was chosen. Valgrind is the name of the |
| 43 | main entrance to Valhalla (the Hall of the Chosen Slain in |
| 44 | Asgard). Over this entrance there resides a wolf and over it |
| 45 | there is the head of a boar and on it perches a huge eagle, |
| 46 | whose eyes can see to the far regions of the nine worlds. Only |
| 47 | those judged worthy by the guardians are allowed to pass |
| 48 | through Valgrind. All others are refused entrance.</para> |
| 49 | <para>It's not short for "value grinder", although that's not a |
| 50 | bad guess.</para> |
| 51 | </answer> |
| 52 | </qandaentry> |
| 53 | |
| 54 | </qandaset> |
| 55 | |
| 56 | </chapter> |
| 57 | |
| 58 | |
| 59 | <chapter id="faq.installing" |
| 60 | xreflabel="Compiling, installing and configuring"> |
| 61 | <title>Compiling, installing and configuring</title> |
| 62 | <qandaset id="qset.installing"> |
| 63 | |
| 64 | <qandaentry id="faq.make_dies"> |
| 65 | <question> |
| 66 | <para>When I trying building Valgrind, 'make' dies partway with |
| 67 | an assertion failure, something like this: |
| 68 | <screen> |
| 69 | % make: expand.c:489: allocated_variable_append: |
| 70 | Assertion 'current_variable_set_list->next != 0' failed. |
| 71 | </screen> |
| 72 | </para> |
| 73 | </question> |
| 74 | <answer> |
| 75 | <para>It's probably a bug in 'make'. Some, but not all, |
| 76 | instances of version 3.79.1 have this bug, see |
| 77 | www.mail-archive.com/bug-make@gnu.org/msg01658.html. Try |
| 78 | upgrading to a more recent version of 'make'. Alternatively, |
| 79 | we have heard that unsetting the CFLAGS environment variable |
| 80 | avoids the problem.</para> |
| 81 | </answer> |
| 82 | </qandaentry> |
| 83 | |
| 84 | </qandaset> |
| 85 | </chapter> |
| 86 | |
| 87 | |
| 88 | |
| 89 | <chapter id="faq.abort" |
| 90 | xreflabel="Valgrind aborts unexpectedly"> |
| 91 | <title>Valgrind aborts unexpectedly</title> |
| 92 | <qandaset id="qset.abort"> |
| 93 | |
| 94 | <qandaentry id="faq.exit_errors"> |
| 95 | <question> |
| 96 | <para>Programs run OK on Valgrind, but at exit produce a bunch |
| 97 | of errors a bit like this:</para> |
| 98 | </question> |
| 99 | <answer><para> |
| 100 | <programlisting> |
| 101 | ==20755== Invalid read of size 4 |
| 102 | ==20755== at 0x40281C8A: _nl_unload_locale (loadlocale.c:238) |
| 103 | ==20755== by 0x4028179D: free_mem (findlocale.c:257) |
| 104 | ==20755== by 0x402E0962: __libc_freeres (set-freeres.c:34) |
| 105 | ==20755== by 0x40048DCC: vgPlain___libc_freeres_wrapper (vg_clientfuncs.c:585) |
| 106 | ==20755== Address 0x40CC304C is 8 bytes inside a block of size 380 free'd |
| 107 | ==20755== at 0x400484C9: free (vg_clientfuncs.c:180) |
| 108 | ==20755== by 0x40281CBA: _nl_unload_locale (loadlocale.c:246) |
| 109 | ==20755== by 0x40281218: free_mem (setlocale.c:461) |
| 110 | ==20755== by 0x402E0962: __libc_freeres (set-freeres.c:34) |
| 111 | </programlisting> |
| 112 | |
| 113 | and then die with a segmentation fault.</para> |
| 114 | <para>When the program exits, Valgrind runs the procedure |
| 115 | <literal>__libc_freeres()</literal> in glibc. This is a hook |
| 116 | for memory debuggers, so they can ask glibc to free up any |
| 117 | memory it has used. Doing that is needed to ensure that |
| 118 | Valgrind doesn't incorrectly report space leaks in glibc.</para> |
| 119 | <para>Problem is that running |
| 120 | <literal>__libc_freeres()</literal> in older glibc versions |
| 121 | causes this crash.</para> <para>WORKAROUND FOR 1.1.X and later |
| 122 | versions of Valgrind: use the |
| 123 | <literal>--run-libc-freeres=no</literal> flag. You may then get |
| 124 | space leak reports for glibc-allocations (please _don't_ report |
| 125 | these to the glibc people, since they are not real leaks), but |
| 126 | at least the program runs.</para> |
| 127 | </answer> |
| 128 | </qandaentry> |
| 129 | |
| 130 | <qandaentry id="faq.bugdeath"> |
| 131 | <question> |
| 132 | <para>My (buggy) program dies like this:</para> |
| 133 | </question> |
| 134 | <answer> |
| 135 | <screen> |
| 136 | % valgrind: vg_malloc2.c:442 (bszW_to_pszW): Assertion 'pszW >= 0' failed. |
| 137 | </screen> |
| 138 | |
| 139 | <para>If Memcheck (the memory checker) shows any invalid reads, |
| 140 | invalid writes and invalid frees in your program, the above may |
| 141 | happen. Reason is that your program may trash Valgrind's |
| 142 | low-level memory manager, which then dies with the above |
| 143 | assertion, or something like this. The cure is to fix your |
| 144 | program so that it doesn't do any illegal memory accesses. The |
| 145 | above failure will hopefully go away after that.</para> |
| 146 | </answer> |
| 147 | </qandaentry> |
| 148 | |
| 149 | <qandaentry id="faq.msgdeath"> |
| 150 | <question> |
| 151 | <para>My program dies, printing a message like this along the |
| 152 | way:</para> |
| 153 | </question> |
| 154 | <answer> |
| 155 | <screen> |
| 156 | % disInstr: unhandled instruction bytes: 0x66 0xF 0x2E 0x5 |
| 157 | </screen> |
| 158 | |
| 159 | <para>Older versions did not support some x86 instructions, |
| 160 | particularly SSE/SSE2 instructions. Try a newer Valgrind; we |
| 161 | now support almost all instructions. If it still happens with |
| 162 | newer versions, if the failing instruction is an SSE/SSE2 |
njn | d0d6473 | 2005-04-16 14:58:34 +0000 | [diff] [blame] | 163 | instruction, you might be able to recompile your program |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 164 | without it by using the flag |
| 165 | <computeroutput>-march</computeroutput> to gcc. Either way, |
| 166 | let us know and we'll try to fix it.</para> |
| 167 | |
| 168 | <para>Another possibility is that your program has a bug and |
| 169 | erroneously jumps to a non-code address, in which case you'll |
| 170 | get a SIGILL signal. Memcheck/Addrcheck may issue a warning |
| 171 | just before this happens, but they might not if the jump |
| 172 | happens to land in addressable memory.</para> |
| 173 | </answer> |
| 174 | </qandaentry> |
| 175 | |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 176 | </qandaset> |
| 177 | </chapter> |
| 178 | |
| 179 | |
| 180 | <chapter id="faq.unexpected" |
| 181 | xreflabel="Valgrind behaves unexpectedly"> |
| 182 | <title>Valgrind behaves unexpectedly</title> |
| 183 | <qandaset id="qset.unexpected"> |
| 184 | |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 185 | <qandaentry id="faq.slowthread"> |
| 186 | <question> |
| 187 | <para>My threaded server process runs unbelievably slowly on |
| 188 | Valgrind. So slowly, in fact, that at first I thought it had |
| 189 | completely locked up.</para> |
| 190 | </question> |
| 191 | <answer> |
| 192 | <para>We are not completely sure about this, but one |
| 193 | possibility is that laptops with power management fool |
| 194 | Valgrind's timekeeping mechanism, which is (somewhat in error) |
| 195 | based on the x86 RDTSC instruction. A "fix" which is claimed |
| 196 | to work is to run some other cpu-intensive process at the same |
| 197 | time, so that the laptop's power-management clock-slowing does |
| 198 | not kick in. We would be interested in hearing more feedback |
| 199 | on this.</para> |
| 200 | |
| 201 | <para>Another possible cause is that versions prior to 1.9.6 |
| 202 | did not support threading on glibc 2.3.X systems well. |
| 203 | Hopefully the situation is much improved with 1.9.6 and later |
| 204 | versions.</para> |
| 205 | </answer> |
| 206 | </qandaentry> |
| 207 | |
| 208 | |
| 209 | <qandaentry id="faq.reports"> |
| 210 | <question> |
| 211 | <para>My program uses the C++ STL and string classes. Valgrind |
| 212 | reports 'still reachable' memory leaks involving these classes |
| 213 | at the exit of the program, but there should be none.</para> |
| 214 | </question> |
| 215 | <answer> |
| 216 | <para>First of all: relax, it's probably not a bug, but a |
| 217 | feature. Many implementations of the C++ standard libraries |
| 218 | use their own memory pool allocators. Memory for quite a |
| 219 | number of destructed objects is not immediately freed and given |
| 220 | back to the OS, but kept in the pool(s) for later re-use. The |
| 221 | fact that the pools are not freed at the exit() of the program |
| 222 | cause Valgrind to report this memory as still reachable. The |
| 223 | behaviour not to free pools at the exit() could be called a bug |
| 224 | of the library though.</para> |
| 225 | |
| 226 | <para>Using gcc, you can force the STL to use malloc and to |
| 227 | free memory as soon as possible by globally disabling memory |
| 228 | caching. Beware! Doing so will probably slow down your |
| 229 | program, sometimes drastically.</para> |
| 230 | <itemizedlist> |
| 231 | <listitem> |
| 232 | <para>With gcc 2.91, 2.95, 3.0 and 3.1, compile all source |
| 233 | using the STL with <literal>-D__USE_MALLOC</literal>. Beware! |
| 234 | This is removed from gcc starting with version 3.3.</para> |
| 235 | </listitem> |
| 236 | <listitem> |
njn | 8a5ad76 | 2005-05-12 13:45:56 +0000 | [diff] [blame] | 237 | <para>With gcc 3.2.2 and later, you should export the environment |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 238 | variable <literal>GLIBCPP_FORCE_NEW</literal> before running |
| 239 | your program.</para> |
| 240 | </listitem> |
njn | 8a5ad76 | 2005-05-12 13:45:56 +0000 | [diff] [blame] | 241 | <listitem> |
| 242 | <para>With gcc 3.4 and later, that variable has changed name to |
| 243 | <literal>GLIBCXX_FORCE_NEW</literal>.</para> |
| 244 | </listitem> |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 245 | </itemizedlist> |
| 246 | |
| 247 | <para>There are other ways to disable memory pooling: using the |
| 248 | <literal>malloc_alloc</literal> template with your objects (not |
| 249 | portable, but should work for gcc) or even writing your own |
| 250 | memory allocators. But all this goes beyond the scope of this |
| 251 | FAQ. Start by reading <ulink |
| 252 | url="http://gcc.gnu.org/onlinedocs/libstdc++/ext/howto.html#3"> |
| 253 | http://gcc.gnu.org/onlinedocs/libstdc++/ext/howto.html#3</ulink> |
| 254 | if you absolutely want to do that. But beware:</para> |
| 255 | |
| 256 | <orderedlist> |
| 257 | <listitem> |
| 258 | <para>there are currently changes underway for gcc which are |
| 259 | not totally reflected in the docs right now ("now" == 26 Apr |
| 260 | 03)</para> |
| 261 | </listitem> |
| 262 | <listitem> |
| 263 | <para>allocators belong to the more messy parts of the STL |
njn | d0d6473 | 2005-04-16 14:58:34 +0000 | [diff] [blame] | 264 | and people went to great lengths to make it portable across |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 265 | platforms. Chances are good that your solution will work on |
| 266 | your platform, but not on others.</para> |
| 267 | </listitem> |
| 268 | </orderedlist> |
| 269 | </answer> |
| 270 | </qandaentry> |
| 271 | |
| 272 | |
| 273 | <qandaentry id="faq.unhelpful"> |
| 274 | <question> |
| 275 | <para>The stack traces given by Memcheck (or another tool) |
| 276 | aren't helpful. How can I improve them?</para> |
| 277 | </question> |
| 278 | <answer> |
| 279 | <para>If they're not long enough, use |
| 280 | <literal>--num-callers</literal> to make them longer.</para> |
| 281 | <para>If they're not detailed enough, make sure you are |
| 282 | compiling with <literal>-g</literal> to add debug information. |
| 283 | And don't strip symbol tables (programs should be unstripped |
| 284 | unless you run 'strip' on them; some libraries ship |
| 285 | stripped).</para> |
| 286 | |
njn | 0211ff3 | 2005-05-15 14:49:24 +0000 | [diff] [blame] | 287 | <para>Also, for leak reports involving shared objects, if the shared |
| 288 | object is unloaded before the program terminates, Valgrind will discard |
| 289 | the debug information and the error message will be full of |
| 290 | <literal>???</literal> entries. The workaround here is to avoid calling |
| 291 | dlclose() on these shared objects. |
| 292 | </para> |
| 293 | |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 294 | <para>Also, <literal>-fomit-frame-pointer</literal> and |
| 295 | <literal>-fstack-check</literal> can make stack traces |
| 296 | worse.</para> |
| 297 | |
| 298 | <para>Some example sub-traces:</para> |
| 299 | |
| 300 | <para>With debug information and unstripped (best):</para> |
| 301 | <programlisting> |
| 302 | Invalid write of size 1 |
| 303 | at 0x80483BF: really (malloc1.c:20) |
| 304 | by 0x8048370: main (malloc1.c:9) |
| 305 | </programlisting> |
| 306 | |
| 307 | <para>With no debug information, unstripped:</para> |
| 308 | <programlisting> |
| 309 | Invalid write of size 1 |
| 310 | at 0x80483BF: really (in /auto/homes/njn25/grind/head5/a.out) |
| 311 | by 0x8048370: main (in /auto/homes/njn25/grind/head5/a.out) |
| 312 | </programlisting> |
| 313 | |
| 314 | <para>With no debug information, stripped:</para> |
| 315 | <programlisting> |
| 316 | Invalid write of size 1 |
| 317 | at 0x80483BF: (within /auto/homes/njn25/grind/head5/a.out) |
| 318 | by 0x8048370: (within /auto/homes/njn25/grind/head5/a.out) |
| 319 | by 0x42015703: __libc_start_main (in /lib/tls/libc-2.3.2.so) |
| 320 | by 0x80482CC: (within /auto/homes/njn25/grind/head5/a.out) |
| 321 | </programlisting> |
| 322 | |
| 323 | <para>With debug information and -fomit-frame-pointer:</para> |
| 324 | <programlisting> |
| 325 | Invalid write of size 1 |
| 326 | at 0x80483C4: really (malloc1.c:20) |
| 327 | by 0x42015703: __libc_start_main (in /lib/tls/libc-2.3.2.so) |
| 328 | by 0x80482CC: ??? (start.S:81) |
| 329 | </programlisting> |
| 330 | |
njn | 0211ff3 | 2005-05-15 14:49:24 +0000 | [diff] [blame] | 331 | <para>A leak error message involving an unloaded shared object:</para> |
| 332 | |
| 333 | <programlisting> |
| 334 | 84 bytes in 1 blocks are possibly lost in loss record 488 of 713 |
| 335 | at 0x1B9036DA: operator new(unsigned) (vg_replace_malloc.c:132) |
| 336 | by 0x1DB63EEB: ??? |
| 337 | by 0x1DB4B800: ??? |
| 338 | by 0x1D65E007: ??? |
| 339 | by 0x8049EE6: main (main.cpp:24) |
| 340 | </programlisting> |
| 341 | |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 342 | </answer> |
| 343 | </qandaentry> |
| 344 | |
njn | 16eeb4e | 2005-06-16 03:56:58 +0000 | [diff] [blame^] | 345 | <qandaentry id="faq.aliases"> |
| 346 | <question> |
| 347 | <para>The stack traces given by Memcheck (or another tool) seem to |
| 348 | have the wrong function name in them. What's happening?</para> |
| 349 | </question> |
| 350 | <answer> |
| 351 | <para>Occasionally Valgrind stack traces get the wrong function names. |
| 352 | This is caused by glibc using aliases to effectively give one function two |
| 353 | names. Most of the time Valgrind chooses a suitable name, but very |
| 354 | occasionally it gets it wrong. |
| 355 | |
| 356 | Examples we know of are printing 'bcmp' instead of 'memcmp', 'index' |
| 357 | instead of 'strchr', and 'rindex' instead of 'strrchr'.</para> |
| 358 | </answer> |
| 359 | </qandaentry> |
| 360 | |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 361 | </qandaset> |
| 362 | </chapter> |
| 363 | |
| 364 | |
| 365 | <chapter id="faq.notfound" xreflabel="Memcheck doesn't find my bug"> |
| 366 | <title>Memcheck doesn't find my bug</title> |
| 367 | <qandaset id="qset.notfound"> |
| 368 | |
| 369 | <qandaentry id="faq.hiddenbug"> |
| 370 | <question> |
| 371 | <para>I try running "valgrind --tool=memcheck my_program" and |
| 372 | get Valgrind's startup message, but I don't get any errors and |
| 373 | I know my program has errors.</para> |
| 374 | </question> |
| 375 | <answer> |
njn | a11b9b0 | 2005-03-27 17:05:08 +0000 | [diff] [blame] | 376 | <para>There are two possible causes of this.</para> |
| 377 | |
| 378 | <para>First, by default, Valgrind only traces the top-level process. |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 379 | So if your program spawns children, they won't be traced by |
| 380 | Valgrind by default. Also, if your program is started by a |
| 381 | shell script, Perl script, or something similar, Valgrind will |
| 382 | trace the shell, or the Perl interpreter, or equivalent.</para> |
| 383 | |
| 384 | <para>To trace child processes, use the |
| 385 | <literal>--trace-children=yes</literal> option.</para> |
| 386 | |
| 387 | <para>If you are tracing large trees of processes, it can be |
| 388 | less disruptive to have the output sent over the network. Give |
| 389 | Valgrind the flag |
| 390 | <literal>--log-socket=127.0.0.1:12345</literal> (if you want |
| 391 | logging output sent to <literal>port 12345</literal> on |
| 392 | <literal>localhost</literal>). You can use the |
| 393 | valgrind-listener program to listen on that port:</para> |
| 394 | <programlisting> |
| 395 | valgrind-listener 12345 |
| 396 | </programlisting> |
| 397 | |
| 398 | <para>Obviously you have to start the listener process first. |
| 399 | See the Manual: <ulink url="http://www.valgrind.org/docs/bookset/manual-core.out2file.html">Directing output to file</ulink> for more details.</para> |
njn | a11b9b0 | 2005-03-27 17:05:08 +0000 | [diff] [blame] | 400 | |
| 401 | <para>Second, if your program is statically linked, most Valgrind tools |
| 402 | won't work as well, because they won't be able to replace certain |
| 403 | functions, such as malloc(), with their own versions. A key indicator of |
| 404 | this is if Memcheck says: |
| 405 | <programlisting> |
| 406 | No malloc'd blocks -- no leaks are possible |
| 407 | </programlisting> |
| 408 | when you know your program calls malloc(). The workaround is to avoid |
| 409 | statically linking your program.</para> |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 410 | </answer> |
| 411 | </qandaentry> |
| 412 | |
| 413 | |
| 414 | <qandaentry id="faq.overruns"> |
| 415 | <question> |
| 416 | <para>Why doesn't Memcheck find the array overruns in this program?</para> |
| 417 | </question> |
| 418 | <answer> |
| 419 | <programlisting> |
| 420 | int static[5]; |
| 421 | |
| 422 | int main(void) |
| 423 | { |
| 424 | int stack[5]; |
| 425 | |
| 426 | static[5] = 0; |
| 427 | stack [5] = 0; |
| 428 | |
| 429 | return 0; |
| 430 | } |
| 431 | </programlisting> |
| 432 | <para>Unfortunately, Memcheck doesn't do bounds checking on |
| 433 | static or stack arrays. We'd like to, but it's just not |
| 434 | possible to do in a reasonable way that fits with how Memcheck |
| 435 | works. Sorry.</para> |
| 436 | </answer> |
| 437 | </qandaentry> |
| 438 | |
| 439 | |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 440 | </qandaset> |
| 441 | </chapter> |
| 442 | |
| 443 | |
| 444 | <chapter id="faq.misc" |
| 445 | xreflabel="Miscellaneous"> |
| 446 | <title>Miscellaneous</title> |
| 447 | <qandaset id="qset.misc"> |
| 448 | |
| 449 | <qandaentry id="faq.writesupp"> |
| 450 | <question> |
| 451 | <para>I tried writing a suppression but it didn't work. Can |
| 452 | you write my suppression for me?</para> |
| 453 | </question> |
| 454 | <answer> |
| 455 | <para>Yes! Use the |
| 456 | <computeroutput>--gen-suppressions=yes</computeroutput> feature |
| 457 | to spit out suppressions automatically for you. You can then |
| 458 | edit them if you like, eg. combining similar automatically |
| 459 | generated suppressions using wildcards like |
| 460 | <literal>'*'</literal>.</para> |
| 461 | |
| 462 | <para>If you really want to write suppressions by hand, read |
| 463 | the manual carefully. Note particularly that C++ function |
| 464 | names must be <literal>_mangled_</literal>.</para> |
| 465 | </answer> |
| 466 | </qandaentry> |
| 467 | |
| 468 | |
| 469 | <qandaentry id="faq.deflost"> |
| 470 | <question> |
| 471 | <para>With Memcheck/Addrcheck's memory leak detector, what's |
| 472 | the difference between "definitely lost", "possibly lost", |
| 473 | "still reachable", and "suppressed"?</para> |
| 474 | </question> |
| 475 | <answer> |
| 476 | <para>The details are in the Manual: |
| 477 | <ulink url="http://www.valgrind.org/docs/bookset/mc-manual.leaks.html">Memory leak detection</ulink>.</para> |
| 478 | |
| 479 | <para>In short:</para> |
| 480 | <itemizedlist> |
| 481 | <listitem> |
| 482 | <para>"definitely lost" means your program is leaking memory |
| 483 | -- fix it!</para> |
| 484 | </listitem> |
| 485 | <listitem> |
| 486 | <para>"possibly lost" means your program is probably leaking |
| 487 | memory, unless you're doing funny things with |
| 488 | pointers.</para> |
| 489 | </listitem> |
| 490 | <listitem> |
| 491 | <para>"still reachable" means your program is probably ok -- |
| 492 | it didn't free some memory it could have. This is quite |
| 493 | common and often reasonable. Don't use |
| 494 | <computeroutput>--show-reachable=yes</computeroutput> if you |
| 495 | don't want to see these reports.</para> |
| 496 | </listitem> |
| 497 | <listitem> |
| 498 | <para>"suppressed" means that a leak error has been |
| 499 | suppressed. There are some suppressions in the default |
| 500 | suppression files. You can ignore suppressed errors.</para> |
| 501 | </listitem> |
| 502 | </itemizedlist> |
| 503 | </answer> |
| 504 | </qandaentry> |
| 505 | |
| 506 | |
| 507 | </qandaset> |
| 508 | </chapter> |
| 509 | |
| 510 | |
| 511 | <!-- template |
| 512 | <chapter id="faq." |
| 513 | xreflabel="xx"> |
| 514 | <title>xx</title> |
| 515 | <qandaset id="qset."> |
| 516 | |
| 517 | <qandaentry id="faq.deflost"> |
| 518 | <question> |
| 519 | <para></para> |
| 520 | </question> |
| 521 | <answer> |
| 522 | <para></para> |
| 523 | </answer> |
| 524 | </qandaentry> |
| 525 | |
| 526 | </qandaset> |
| 527 | </chapter> |
| 528 | --> |
| 529 | |
| 530 | |
| 531 | |
| 532 | <chapter id="faq.help" xreflabel="How To Get Further Assistance"> |
| 533 | <title>How To Get Further Assistance</title> |
| 534 | |
| 535 | |
| 536 | <para>Please read all of this section before posting.</para> |
| 537 | |
| 538 | <para>If you think an answer is incomplete or inaccurate, please |
| 539 | e-mail <ulink url="mailto:&vg-vemail;">&vg-vemail;</ulink>.</para> |
| 540 | |
| 541 | <para>Read the appropriate section(s) of the Manual(s): |
| 542 | <ulink url="http://www.valgrind.org/docs/">Valgrind |
| 543 | Documentation</ulink>.</para> |
| 544 | |
| 545 | <para>Read the <ulink url="http://www.valgrind.org/docs/">Distribution Documents</ulink>.</para> |
| 546 | |
| 547 | <para><ulink url="http://search.gmane.org">Search</ulink> the |
| 548 | <ulink url="http://news.gmane.org/gmane.comp.debugging.valgrind">valgrind-users</ulink> mailing list archives, using the group name |
| 549 | <computeroutput>gmane.comp.debugging.valgrind</computeroutput>.</para> |
| 550 | |
| 551 | <para>Only when you have tried all of these things and are still stuck, |
| 552 | should you post to the <ulink url="&vg-users-list;">valgrind-users |
| 553 | mailing list</ulink>. In which case, please read the following |
| 554 | carefully. Making a complete posting will greatly increase the chances |
| 555 | that an expert or fellow user reading it will have enough information |
| 556 | and motivation to reply.</para> |
| 557 | |
| 558 | <para>Make sure you give full details of the problem, |
| 559 | including the full output of <computeroutput>valgrind |
| 560 | -v</computeroutput>, if applicable. Also which Linux distribution |
| 561 | you're using (Red Hat, Debian, etc) and its version number.</para> |
| 562 | |
| 563 | <para>You are in little danger of making your posting too long |
| 564 | unless you include large chunks of valgrind's (unsuppressed) |
| 565 | output, so err on the side of giving too much information.</para> |
| 566 | |
| 567 | <para>Clearly written subject lines and message bodies are appreciated, |
| 568 | too.</para> |
| 569 | |
| 570 | <para>Finally, remember that, despite the fact that most of the |
| 571 | community are very helpful and responsive to emailed questions, |
| 572 | you are probably requesting help from unpaid volunteers, so you |
| 573 | have no guarantee of receiving an answer.</para> |
| 574 | |
| 575 | </chapter> |
| 576 | |
| 577 | </book> |