- The default value for the --leak-resolution option has been changed from
"low" to "high". In general, this means that more leak reports will be
produced, but each leak report will describe fewer leaked blocks.
+ - "Definitely lost" and "possibly lost" leaks are now considered as normal
+ errors, ie. they are counted for the "ERROR SUMMARY" and
+ --error-exitcode. This is true even if their loss records aren't
+ printed, ie. if you run with --leak-check=summary.
- The documentation for the leak checker has also been improved.
* XXX: Atomic instructions are now handled properly...
/* Running count of suppressed errors detected. */
static UInt n_errs_suppressed = 0;
+/* Running count of unsuppressed error contexts. */
+static UInt n_err_contexts = 0;
+
+/* Running count of suppressed error contexts. */
+static UInt n_supp_contexts = 0;
+
+
/* forwards ... */
static Supp* is_suppressible_error ( Error* err );
p->supp = is_suppressible_error(&err);
errors = p;
if (p->supp == NULL) {
+ n_err_contexts++;
n_errs_found++;
/* A bit of prettyprinting, to ensure there's a blank line
in between each error. */
is_first_shown_context = False;
n_errs_shown++;
} else {
+ n_supp_contexts++;
n_errs_suppressed++;
p->supp->count++;
}
su = is_suppressible_error(&err);
if (NULL == su) {
- if (count_error)
+ if (count_error) {
n_errs_found++;
+ n_err_contexts++;
+ }
if (print_error) {
/* A bit of prettyprinting, to ensure there's a blank line
} else {
n_errs_suppressed++;
+ n_supp_contexts++;
su->count++;
return True;
}
void VG_(show_all_errors) ( void )
{
Int i, n_min;
- Int n_err_contexts, n_supp_contexts;
Error *p, *p_min;
- Supp *su;
Bool any_supp;
if (VG_(clo_verbosity) == 0)
return;
- n_err_contexts = 0;
- for (p = errors; p != NULL; p = p->next) {
- if (p->supp == NULL)
- n_err_contexts++;
- }
-
- n_supp_contexts = 0;
- for (su = suppressions; su != NULL; su = su->next) {
- if (su->count > 0)
- n_supp_contexts++;
- }
-
- /* If we're printing XML, just show the suppressions and stop.
- */
+ /* If we're printing XML, just show the suppressions and stop. */
if (VG_(clo_xml)) {
(void)show_used_suppressions();
return;
// includes indirectly lost blocks!
//
lr = lr_array[i];
+ // You could argue that indirect leaks should be counted as errors, but
+ // it seems better to make the counting criteria similar to the printing
+ // criteria. So we don't count them.
count_as_error = Unreached == lr->key.state ||
Possible == lr->key.state;
print_record = is_full_check &&