just for pretty printing purposes. */
static Bool is_first_shown_context = True;
+static Int n_errs_shown = 0;
+
/* Top-level entry point to the error management subsystem.
All detected errors are notified here; this routine decides if/when the
user should see the error. */
VgRes exe_res = Vg_MedRes;
static Bool stopping_message = False;
static Bool slowdown_message = False;
- static Int n_errs_shown = 0;
/* After M_COLLECT_NO_ERRORS_AFTER_SHOWN different errors have
been found, or M_COLLECT_NO_ERRORS_AFTER_FOUND total errors
void* extra, ExeContext* where, Bool print_error,
Bool allow_db_attach, Bool count_error )
{
- Error err;
+ Error err;
+ Supp *su;
/* Build ourselves the error */
construct_error ( &err, tid, ekind, a, s, extra, where );
not copying 'extra'. */
(void)VG_TDICT_CALL(tool_update_extra, &err);
- if (NULL == is_suppressible_error(&err)) {
+ su = is_suppressible_error(&err);
+ if (NULL == su) {
if (count_error)
n_errs_found++;
VG_(message)(Vg_UserMsg, "");
pp_Error(&err);
is_first_shown_context = False;
+ n_errs_shown++;
+ do_actions_on_error(&err, allow_db_attach);
}
- do_actions_on_error(&err, allow_db_attach);
-
return False;
} else {
n_errs_suppressed++;
+ su->count++;
return True;
}
}
mmaptest.stderr.exp mmaptest.vgtest \
nanoleak.stderr.exp nanoleak.vgtest \
nanoleak_supp.stderr.exp nanoleak_supp.vgtest nanoleak.supp \
+ nanoleak2.stderr.exp nanoleak2.vgtest \
new_nothrow.stderr.exp new_nothrow.vgtest \
new_override.stderr.exp new_override.stdout.exp new_override.vgtest \
null_socket.stderr.exp null_socket.vgtest \
malloc_usable malloc1 malloc2 malloc3 manuel1 manuel2 manuel3 \
match-overrun \
memalign_test memalign2 memcmptest mempool mmaptest \
- nanoleak new_nothrow \
+ nanoleak nanoleak2 new_nothrow \
null_socket oset_test overlap \
partiallydefinedeq \
partial_load pdb-realloc pdb-realloc2 \
--- /dev/null
+
+// Bruce Lowekamp <lowekamp@sipeerior.com> reported that in a program with a
+// reachable leak, if you do:
+//
+// valgrind --leak-check=yes --gen-suppressions=yes --show-reachable=no -q
+//
+// it gives the y/n/c suppression prompt for errors that aren't shown. This
+// test checks that is fixed.
+
+#include <stdlib.h>
+
+int* a;
+
+int main ( void )
+{
+ a = malloc(1000); // Becomes a reachable leak.
+ a[0] = 0;
+ return a[0];
+}