|
From: Paul F. <pa...@fr...> - 2006-11-15 21:46:02
|
Hi
I got a copy from svn. Here are the two changes that I needed to make:
svn diff mc_main.c
Index: mc_main.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
--- mc_main.c (revision 6354)
+++ mc_main.c (working copy)
@@ -3432,7 +3432,7 @@
return (ekind =3D=3D FreeErr || ekind =3D=3D FreeMismatchErr);
case OverlapSupp:
- return (ekind =3D OverlapErr);
+ return (ekind =3D=3D OverlapErr);
case LeakSupp:
return (ekind =3D=3D LeakErr);
(that one's a no-brainer)
svn diff m_errormgr.c
Index: 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
--- m_errormgr.c (revision 6354)
+++ m_errormgr.c (working copy)
@@ -1161,7 +1161,11 @@
// up comparing "malloc" in the suppression against
// "_vgrZU_libcZdsoZa_malloc" in the backtrace, and the
// two of them need to be made to match.
+/*
if (!VG_(get_fnname_Z_demangle_only)(a, caller_name, ERRTXT_=
LEN))
+*/
+ if (!VG_(get_fnname_nodemangle)(a, caller_name, ERRTXT_LEN))
+
VG_(strcpy)(caller_name, "???");
break;
default: VG_(tool_panic)("supp_matches_callers");
Here, su->callers[i].name was in mangled format, so getting caller_name i=
n
demangled format resulted in the function returning false, and the error =
that
was in my suppression file was printed.
A+
Paul
|
|
From: Julian S. <js...@ac...> - 2006-11-16 00:29:49
|
That's interesting. There is a bad interaction between demangling
and suppressions for functions below main(), and I wonder if this is
related. Can you send the error that you wanted to suppress + the
required suppression?
J
On Wednesday 15 November 2006 22:14, Paul Floyd wrote:
> Hi
>
> I got a copy from svn. Here are the two changes that I needed to make:
>
> svn diff mc_main.c
> Index: mc_main.c
> ===================================================================
> --- mc_main.c (revision 6354)
> +++ mc_main.c (working copy)
> @@ -3432,7 +3432,7 @@
> return (ekind == FreeErr || ekind == FreeMismatchErr);
>
> case OverlapSupp:
> - return (ekind = OverlapErr);
> + return (ekind == OverlapErr);
>
> case LeakSupp:
> return (ekind == LeakErr);
>
> (that one's a no-brainer)
>
> svn diff m_errormgr.c
> Index: m_errormgr.c
> ===================================================================
> --- m_errormgr.c (revision 6354)
> +++ m_errormgr.c (working copy)
> @@ -1161,7 +1161,11 @@
> // up comparing "malloc" in the suppression against
> // "_vgrZU_libcZdsoZa_malloc" in the backtrace, and the
> // two of them need to be made to match.
> +/*
> if (!VG_(get_fnname_Z_demangle_only)(a, caller_name,
> ERRTXT_LEN)) +*/
> + if (!VG_(get_fnname_nodemangle)(a, caller_name, ERRTXT_LEN))
> +
> VG_(strcpy)(caller_name, "???");
> break;
> default: VG_(tool_panic)("supp_matches_callers");
>
> Here, su->callers[i].name was in mangled format, so getting caller_name in
> demangled format resulted in the function returning false, and the error
> that was in my suppression file was printed.
>
> A+
> Paul
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
|
|
From: Paul F. <pa...@fr...> - 2006-11-16 08:50:25
|
Quoting Julian Seward <js...@ac...>:
> That's interesting. There is a bad interaction between demangling
> and suppressions for functions below main(), and I wonder if this is
> related. Can you send the error that you wanted to suppress + the
> required suppression?
Hi
When I resolved the problem, I just wrote a small testcase which reproduc=
ed the
problem quite easily.
#include <string.h>
#include <stdlib.h>
int main()
{
char *foo, *bar;
foo =3D strdup("this is some string");
bar =3D foo;
strcpy(foo, bar);
free(foo);
return 0;
}
This generates
=3D=3D13095=3D=3D Source and destination overlap in strcpy(0x416A028, 0x4=
16A028)
=3D=3D13095=3D=3D at 0x401C79F: strcpy (mc_replace_strmem.c:106)
=3D=3D13095=3D=3D by 0x80483CE: main (t.c:9)
{
<insert a suppression name here>
Memcheck:Overlap
fun:_vgrZU_libcZdsoZa_strcpy
fun:main
}
When I created the suppression file and ran
valgrind --suppressions=3D./supp ./t
the error was still displayed.
A+
Paul
|
|
From: Julian S. <js...@ac...> - 2006-12-06 03:40:51
|
Thanks for the investigation/diagnosis. I just committed a fix
which will be in 3.2.2. Re the Z-demangling, I think the root
problem is that --gen-suppressions= was not doing the right thing;
hence my fix is marginally different from yours.
J
Index: memcheck/mc_main.c
===================================================================
--- memcheck/mc_main.c (revision 6376)
+++ memcheck/mc_main.c (revision 6378)
@@ -3437,7 +3437,7 @@
return (ekind == FreeErr || ekind == FreeMismatchErr);
case OverlapSupp:
- return (ekind = OverlapErr);
+ return (ekind == OverlapErr);
case LeakSupp:
return (ekind == LeakErr);
Index: coregrind/m_errormgr.c
===================================================================
--- coregrind/m_errormgr.c (revision 6376)
+++ coregrind/m_errormgr.c (revision 6378)
@@ -402,7 +402,7 @@
{
static UChar buf[ERRTXT_LEN];
- if ( VG_(get_fnname_nodemangle) (ip, buf, ERRTXT_LEN) ) {
+ if ( VG_(get_fnname_Z_demangle_only) (ip, buf, ERRTXT_LEN) ) {
VG_(printf)(" fun:%s\n", buf);
} else if ( VG_(get_objname)(ip, buf, ERRTXT_LEN) ) {
VG_(printf)(" obj:%s\n", buf);
On Wednesday 15 November 2006 22:14, Paul Floyd wrote:
> Hi
>
> I got a copy from svn. Here are the two changes that I needed to make:
>
> svn diff mc_main.c
> Index: mc_main.c
> ===================================================================
> --- mc_main.c (revision 6354)
> +++ mc_main.c (working copy)
> @@ -3432,7 +3432,7 @@
> return (ekind == FreeErr || ekind == FreeMismatchErr);
>
> case OverlapSupp:
> - return (ekind = OverlapErr);
> + return (ekind == OverlapErr);
>
> case LeakSupp:
> return (ekind == LeakErr);
>
> (that one's a no-brainer)
>
> svn diff m_errormgr.c
> Index: m_errormgr.c
> ===================================================================
> --- m_errormgr.c (revision 6354)
> +++ m_errormgr.c (working copy)
> @@ -1161,7 +1161,11 @@
> // up comparing "malloc" in the suppression against
> // "_vgrZU_libcZdsoZa_malloc" in the backtrace, and the
> // two of them need to be made to match.
> +/*
> if (!VG_(get_fnname_Z_demangle_only)(a, caller_name,
> ERRTXT_LEN)) +*/
> + if (!VG_(get_fnname_nodemangle)(a, caller_name, ERRTXT_LEN))
> +
> VG_(strcpy)(caller_name, "???");
> break;
> default: VG_(tool_panic)("supp_matches_callers");
>
> Here, su->callers[i].name was in mangled format, so getting caller_name in
> demangled format resulted in the function returning false, and the error
> that was in my suppression file was printed.
>
> A+
> Paul
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
|