|
From: <sv...@va...> - 2013-03-13 21:44:18
|
philippe 2013-03-13 21:44:07 +0000 (Wed, 13 Mar 2013)
New Revision: 13326
Log:
Fix 316535 Use of |signed int| instead of (unsigned) |size_t| in messages...
* when SEGV trapped, report the main thread size as an unsigned size_t
* Similar for memcheck overlap errors
For example, for the 2 calls:
memcpy(&a, &a, 2147483648UL);
memcpy(&a, &a, -1); // silently accepted by gcc 4.4.4 -Wall
// while the 3rd arg is supposed to be a size_t
we now obtain (on a 32 bit system)
Source and destination overlap in memcpy(0xbe97113f, 0xbe97113f, 2147483648)
Source and destination overlap in memcpy(0xbef6d13f, 0xbef6d13f, 4294967295)
instead of
Source and destination overlap in memcpy(0xbe8e012f, 0xbe8e012f, -2147483648)
Source and destination overlap in memcpy(0xbe8e012f, 0xbe8e012f, -1)
Do not ask me why
memcpy(&a, &a, -1);
is supposed to be accepted/acceptable/valid code.
Modified files:
trunk/NEWS
trunk/coregrind/m_signals.c
trunk/memcheck/mc_errors.c
Modified: trunk/coregrind/m_signals.c (+2 -2)
===================================================================
--- trunk/coregrind/m_signals.c 2013-03-12 01:32:40 +00:00 (rev 13325)
+++ trunk/coregrind/m_signals.c 2013-03-13 21:44:07 +00:00 (rev 13326)
@@ -1716,8 +1716,8 @@
// FIXME: assumes main ThreadId == 1
if (VG_(is_valid_tid)(1)) {
VG_(umsg)(
- " The main thread stack size used in this run was %d.\n",
- (Int)VG_(threads)[1].client_stack_szB);
+ " The main thread stack size used in this run was %lu.\n",
+ VG_(threads)[1].client_stack_szB);
}
}
}
Modified: trunk/memcheck/mc_errors.c (+5 -5)
===================================================================
--- trunk/memcheck/mc_errors.c 2013-03-12 01:32:40 +00:00 (rev 13325)
+++ trunk/memcheck/mc_errors.c 2013-03-13 21:44:07 +00:00 (rev 13326)
@@ -235,9 +235,9 @@
// Call to strcpy, memcpy, etc, with overlapping blocks.
struct {
- Addr src; // Source block
- Addr dst; // Destination block
- Int szB; // Size in bytes; 0 if unused.
+ Addr src; // Source block
+ Addr dst; // Destination block
+ SizeT szB; // Size in bytes; 0 if unused.
} Overlap;
// A memory leak.
@@ -845,7 +845,7 @@
extra->Err.Overlap.dst, extra->Err.Overlap.src );
} else {
emit( " <what>Source and destination overlap "
- "in %s(%#lx, %#lx, %d)</what>\n",
+ "in %s(%#lx, %#lx, %lu)</what>\n",
VG_(get_error_string)(err),
extra->Err.Overlap.dst, extra->Err.Overlap.src,
extra->Err.Overlap.szB );
@@ -857,7 +857,7 @@
VG_(get_error_string)(err),
extra->Err.Overlap.dst, extra->Err.Overlap.src );
} else {
- emit( "Source and destination overlap in %s(%#lx, %#lx, %d)\n",
+ emit( "Source and destination overlap in %s(%#lx, %#lx, %lu)\n",
VG_(get_error_string)(err),
extra->Err.Overlap.dst, extra->Err.Overlap.src,
extra->Err.Overlap.szB );
Modified: trunk/NEWS (+1 -0)
===================================================================
--- trunk/NEWS 2013-03-12 01:32:40 +00:00 (rev 13325)
+++ trunk/NEWS 2013-03-13 21:44:07 +00:00 (rev 13326)
@@ -217,6 +217,7 @@
FIXED 13294
315545 [390] (find_TTEntry_from_hcode): Assertion '(UChar*)sec->tt[tteNo].tcptr <= (UChar*)hcode' failed
+316535 [390] Use of |signed int| instead of (unsigned) |size_t| in valgrind messages...
315959 [390] valgrind man page has bogus SGCHECK (and no BBV) OPTIONS section
316144 [390] valgrind.1 manpage contains unknown ??? strings for some core option references
316145 [390] callgrind command line options in manpage reference (unknown) callgrind manual
|