Both can be used for a better approximation of a "Cycle Estimation" as
derived event (you need to update the event formula in KCachegrind yourself).
+- Added new memcheck command-line option --show-possibly-lost.
+
Release 3.5.0 (19 August 2009)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
</listitem>
<listitem>
<para>"possibly lost" means your program is leaking
- memory, unless you're doing funny things with pointers.</para>
+ memory, unless you're doing funny things with pointers.
+ This is sometimes reasonable. Use
+ <option>--show-possibly-lost=no</option> if you don't want to see
+ these reports.</para>
</listitem>
<listitem>
<para>"still reachable" means your program is probably ok -- it
</listitem>
</varlistentry>
+ <varlistentry id="opt.show-possibly-lost" xreflabel="--show-possibly-lost">
+ <term>
+ <option><![CDATA[--show-possibly-lost=<yes|no> [default: yes] ]]></option>
+ </term>
+ <listitem>
+ <para>When disabled, the memory leak detector will not show "possibly lost" blocks.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="opt.leak-resolution" xreflabel="--leak-resolution">
<term>
<option><![CDATA[--leak-resolution=<low|med|high> [default: high] ]]></option>
/* In leak check, show reachable-but-not-freed blocks? default: NO */
extern Bool MC_(clo_show_reachable);
+/* In leak check, show possibly-lost blocks? default: YES */
+extern Bool MC_(clo_show_possibly_lost);
+
/* Assume accesses immediately below %esp are due to gcc-2.96 bugs.
* default: NO */
extern Bool MC_(clo_workaround_gcc296_bugs);
print_record = is_full_check &&
( MC_(clo_show_reachable) ||
Unreached == lr->key.state ||
- Possible == lr->key.state );
+ ( MC_(clo_show_possibly_lost) &&
+ Possible == lr->key.state ) );
// We don't count a leaks as errors with --leak-check=summary.
// Otherwise you can get high error counts with few or no error
// messages, which can be confusing. Also, you could argue that
LeakCheckMode MC_(clo_leak_check) = LC_Summary;
VgRes MC_(clo_leak_resolution) = Vg_HighRes;
Bool MC_(clo_show_reachable) = False;
+Bool MC_(clo_show_possibly_lost) = True;
Bool MC_(clo_workaround_gcc296_bugs) = False;
Int MC_(clo_malloc_fill) = -1;
Int MC_(clo_free_fill) = -1;
if VG_BOOL_CLO(arg, "--partial-loads-ok", MC_(clo_partial_loads_ok)) {}
else if VG_BOOL_CLO(arg, "--show-reachable", MC_(clo_show_reachable)) {}
+ else if VG_BOOL_CLO(arg, "--show-possibly-lost",
+ MC_(clo_show_possibly_lost)) {}
else if VG_BOOL_CLO(arg, "--workaround-gcc296-bugs",
MC_(clo_workaround_gcc296_bugs)) {}
" --leak-check=no|summary|full search for memory leaks at exit? [summary]\n"
" --leak-resolution=low|med|high differentiation of leak stack traces [high]\n"
" --show-reachable=no|yes show reachable blocks in leak check? [no]\n"
+" --show-possibly-lost=no|yes show possibly lost blocks in leak check?\n"
+" [yes]\n"
" --undef-value-errors=no|yes check for undefined value errors [yes]\n"
" --track-origins=no|yes show origins of undefined values? [no]\n"
" --partial-loads-ok=no|yes too hard to explain here; see manual [no]\n"
inline.stderr.exp inline.stdout.exp inline.vgtest \
leak-0.vgtest leak-0.stderr.exp \
leak-cases-full.vgtest leak-cases-full.stderr.exp \
+ leak-cases-possible.vgtest leak-cases-possible.stderr.exp \
leak-cases-summary.vgtest leak-cases-summary.stderr.exp \
leak-cycle.vgtest leak-cycle.stderr.exp \
leak-pool-0.vgtest leak-pool-0.stderr.exp \
--- /dev/null
+leaked: 80 bytes in 5 blocks
+dubious: 96 bytes in 6 blocks
+reachable: 64 bytes in 4 blocks
+suppressed: 0 bytes in 0 blocks
+16 bytes in 1 blocks are definitely lost in loss record ... of ...
+ at 0x........: malloc (vg_replace_malloc.c:...)
+ by 0x........: mk (leak-cases.c:52)
+ by 0x........: f (leak-cases.c:74)
+ by 0x........: main (leak-cases.c:107)
+
+32 (16 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record ... of ...
+ at 0x........: malloc (vg_replace_malloc.c:...)
+ by 0x........: mk (leak-cases.c:52)
+ by 0x........: f (leak-cases.c:76)
+ by 0x........: main (leak-cases.c:107)
+
+32 (16 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record ... of ...
+ at 0x........: malloc (vg_replace_malloc.c:...)
+ by 0x........: mk (leak-cases.c:52)
+ by 0x........: f (leak-cases.c:91)
+ by 0x........: main (leak-cases.c:107)
+
--- /dev/null
+prog: leak-cases
+vgopts: -q --leak-check=full --leak-resolution=high --show-possibly-lost=no