|
From: <sv...@va...> - 2007-01-13 00:01:41
|
Author: njn
Date: 2007-01-13 00:01:39 +0000 (Sat, 13 Jan 2007)
New Revision: 6515
Log:
Merge r6514 (nanoleak2.c)
Added:
branches/VALGRIND_3_2_BRANCH/memcheck/tests/nanoleak2.c
branches/VALGRIND_3_2_BRANCH/memcheck/tests/nanoleak2.stderr.exp
branches/VALGRIND_3_2_BRANCH/memcheck/tests/nanoleak2.vgtest
Modified:
branches/VALGRIND_3_2_BRANCH/coregrind/m_errormgr.c
branches/VALGRIND_3_2_BRANCH/memcheck/tests/Makefile.am
Modified: branches/VALGRIND_3_2_BRANCH/coregrind/m_errormgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_2_BRANCH/coregrind/m_errormgr.c 2007-01-12 23:59:=
50 UTC (rev 6514)
+++ branches/VALGRIND_3_2_BRANCH/coregrind/m_errormgr.c 2007-01-13 00:01:=
39 UTC (rev 6515)
@@ -456,6 +456,8 @@
just for pretty printing purposes. */
static Bool is_first_shown_context =3D True;
=20
+static Int n_errs_shown =3D 0;
+
/* Top-level entry point to the error management subsystem.
All detected errors are notified here; this routine decides if/when t=
he
user should see the error. */
@@ -469,7 +471,6 @@
VgRes exe_res =3D Vg_MedRes;
static Bool stopping_message =3D False;
static Bool slowdown_message =3D False;
- static Int n_errs_shown =3D 0;
=20
/* After M_COLLECT_NO_ERRORS_AFTER_SHOWN different errors have
been found, or M_COLLECT_NO_ERRORS_AFTER_FOUND total errors
@@ -629,7 +630,8 @@
void* extra, ExeContext* where, Bool print_erro=
r,
Bool allow_db_attach, Bool count_error )
{
- Error err;
+ Error err;
+ Supp *su;
=20
/* Build ourselves the error */
construct_error ( &err, tid, ekind, a, s, extra, where );
@@ -643,7 +645,8 @@
not copying 'extra'. */
(void)VG_TDICT_CALL(tool_update_extra, &err);
=20
- if (NULL =3D=3D is_suppressible_error(&err)) {
+ su =3D is_suppressible_error(&err);
+ if (NULL =3D=3D su) {
if (count_error)
n_errs_found++;
=20
@@ -652,13 +655,14 @@
VG_(message)(Vg_UserMsg, "");
pp_Error(&err);
is_first_shown_context =3D False;
+ n_errs_shown++;
+ do_actions_on_error(&err, allow_db_attach);
}
- do_actions_on_error(&err, allow_db_attach);
-
return False;
=20
} else {
n_errs_suppressed++;
+ su->count++;
return True;
}
}
Modified: branches/VALGRIND_3_2_BRANCH/memcheck/tests/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_2_BRANCH/memcheck/tests/Makefile.am 2007-01-12 23=
:59:50 UTC (rev 6514)
+++ branches/VALGRIND_3_2_BRANCH/memcheck/tests/Makefile.am 2007-01-13 00=
:01:39 UTC (rev 6515)
@@ -75,6 +75,7 @@
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 \
@@ -149,7 +150,7 @@
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 \
Copied: branches/VALGRIND_3_2_BRANCH/memcheck/tests/nanoleak2.c (from rev=
6514, trunk/memcheck/tests/nanoleak2.c)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_2_BRANCH/memcheck/tests/nanoleak2.c =
(rev 0)
+++ branches/VALGRIND_3_2_BRANCH/memcheck/tests/nanoleak2.c 2007-01-13 00=
:01:39 UTC (rev 6515)
@@ -0,0 +1,19 @@
+
+// Bruce Lowekamp <low...@si...> reported that in a program wi=
th a
+// reachable leak, if you do:
+//
+// valgrind --leak-check=3Dyes --gen-suppressions=3Dyes --show-reachab=
le=3Dno -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 =3D malloc(1000); // Becomes a reachable leak.
+ a[0] =3D 0;
+ return a[0];
+}
Copied: branches/VALGRIND_3_2_BRANCH/memcheck/tests/nanoleak2.stderr.exp =
(from rev 6514, trunk/memcheck/tests/nanoleak2.stderr.exp)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Copied: branches/VALGRIND_3_2_BRANCH/memcheck/tests/nanoleak2.vgtest (fro=
m rev 6514, trunk/memcheck/tests/nanoleak2.vgtest)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_2_BRANCH/memcheck/tests/nanoleak2.vgtest =
(rev 0)
+++ branches/VALGRIND_3_2_BRANCH/memcheck/tests/nanoleak2.vgtest 2007-01-=
13 00:01:39 UTC (rev 6515)
@@ -0,0 +1,2 @@
+vgopts: --leak-check=3Dyes --gen-suppressions=3Dyes --show-reachable=3Dn=
o -q
+prog: nanoleak2
|