/* Stats only: the number of times the system was searched to locate a
context. */
-static UInt ec_searchreqs;
+static ULong ec_searchreqs;
/* Stats only: the number of full context comparisons done. */
-static UInt ec_searchcmps;
+static ULong ec_searchcmps;
/* Stats only: total number of stored contexts. */
-static UInt ec_totstored;
+static ULong ec_totstored;
/* Number of 2, 4 and (fast) full cmps done. */
-static UInt ec_cmp2s;
-static UInt ec_cmp4s;
-static UInt ec_cmpAlls;
+static ULong ec_cmp2s;
+static ULong ec_cmp4s;
+static ULong ec_cmpAlls;
/*------------------------------------------------------------*/
{
init_ExeContext_storage();
VG_(message)(Vg_DebugMsg,
- " exectx: %d lists, %d contexts (avg %d per list)",
- N_EC_LISTS, ec_totstored,
- ec_totstored / N_EC_LISTS
+ " exectx: %,lu lists, %,llu contexts (avg %,llu per list)",
+ N_EC_LISTS, ec_totstored, ec_totstored / N_EC_LISTS
);
VG_(message)(Vg_DebugMsg,
- " exectx: %d searches, %d full compares (%d per 1000)",
+ " exectx: %,llu searches, %,llu full compares (%,llu per 1000)",
ec_searchreqs, ec_searchcmps,
ec_searchreqs == 0
- ? 0
- : (UInt)( (((ULong)ec_searchcmps) * 1000)
- / ((ULong)ec_searchreqs ))
+ ? 0L
+ : ( (ec_searchcmps * 1000) / ec_searchreqs )
);
VG_(message)(Vg_DebugMsg,
- " exectx: %d cmp2, %d cmp4, %d cmpAll",
+ " exectx: %,llu cmp2, %,llu cmp4, %,llu cmpAll",
ec_cmp2s, ec_cmp4s, ec_cmpAlls
);
}
static void mostly_clear_thread_record ( ThreadId tid );
/* Stats. */
-static UInt n_scheduling_events_MINOR = 0;
-static UInt n_scheduling_events_MAJOR = 0;
+static ULong n_scheduling_events_MINOR = 0;
+static ULong n_scheduling_events_MAJOR = 0;
/* Sanity checking counts. */
static UInt sanity_fast_count = 0;
void VG_(print_scheduler_stats)(void)
{
VG_(message)(Vg_DebugMsg,
- "scheduler: %llu jumps (bb entries).", bbs_done );
+ "scheduler: %,llu jumps (bb entries).", bbs_done );
VG_(message)(Vg_DebugMsg,
- "scheduler: %d/%d major/minor sched events.",
+ "scheduler: %,llu/%,llu major/minor sched events.",
n_scheduling_events_MAJOR, n_scheduling_events_MINOR);
VG_(message)(Vg_DebugMsg,
" sanity: %d cheap, %d expensive checks.",
void VG_(print_tt_tc_stats) ( void )
{
VG_(message)(Vg_DebugMsg,
- " tt/tc: %llu tt lookups requiring %llu probes",
+ " tt/tc: %,llu tt lookups requiring %,llu probes",
n_full_lookups, n_lookup_probes );
VG_(message)(Vg_DebugMsg,
- " tt/tc: %llu fast-cache updates, %llu flushes",
+ " tt/tc: %,llu fast-cache updates, %,llu flushes",
n_fast_updates, n_fast_flushes );
VG_(message)(Vg_DebugMsg,
- "translate: new %lld "
- "(%lld -> %lld; ratio %lld:10) [%lld scs]",
+ "translate: new %,lld "
+ "(%,llu -> %,llu; ratio %,llu:10) [%,llu scs]",
n_in_count, n_in_osize, n_in_tsize,
safe_idiv(10*n_in_tsize, n_in_osize),
n_in_sc_count);
VG_(message)(Vg_DebugMsg,
- "translate: dumped %lld (%lld -> ?" "?)",
+ "translate: dumped %,llu (%,llu -> ?" "?)",
n_dump_count, n_dump_osize );
VG_(message)(Vg_DebugMsg,
- "translate: discarded %lld (%lld -> ?" "?)",
+ "translate: discarded %,llu (%,llu -> ?" "?)",
n_disc_count, n_disc_osize );
}
/* Their reachability. */
Reachedness loss_mode;
/* Number of blocks and total # bytes involved. */
- UInt total_bytes;
- UInt indirect_bytes;
+ SizeT total_bytes;
+ SizeT indirect_bytes;
UInt num_blocks;
}
LossRecord;
if (l->indirect_bytes) {
VG_(message)(Vg_UserMsg,
- "%s%d (%d direct, %d indirect) bytes in %d blocks"
- " are %s in loss record %d of %d%s",
+ "%s%,lu (%,lu direct, %,lu indirect) bytes in %,u blocks"
+ " are %s in loss record %,u of %,u%s",
xpre,
l->total_bytes + l->indirect_bytes,
l->total_bytes, l->indirect_bytes, l->num_blocks,
xpost
);
if (VG_(clo_xml)) {
- VG_(message)(Vg_UserMsg, " <leakedbytes>%d</leakedbytes>",
+ // Nb: don't put commas in these XML numbers
+ VG_(message)(Vg_UserMsg, " <leakedbytes>%lu</leakedbytes>",
l->total_bytes + l->indirect_bytes);
- VG_(message)(Vg_UserMsg, " <leakedblocks>%d</leakedblocks>",
+ VG_(message)(Vg_UserMsg, " <leakedblocks>%u</leakedblocks>",
l->num_blocks);
}
} else {
VG_(message)(
Vg_UserMsg,
- "%s%d bytes in %d blocks are %s in loss record %d of %d%s",
+ "%s%,lu bytes in %,u blocks are %s in loss record %,u of %,u%s",
xpre,
l->total_bytes, l->num_blocks,
loss, extra->n_this_record, extra->n_total_records,
VG_(pp_ExeContext)(l->allocated_at);
}
-Int MAC_(bytes_leaked) = 0;
-Int MAC_(bytes_indirect) = 0;
-Int MAC_(bytes_dubious) = 0;
-Int MAC_(bytes_reachable) = 0;
-Int MAC_(bytes_suppressed) = 0;
+SizeT MAC_(bytes_leaked) = 0;
+SizeT MAC_(bytes_indirect) = 0;
+SizeT MAC_(bytes_dubious) = 0;
+SizeT MAC_(bytes_reachable) = 0;
+SizeT MAC_(bytes_suppressed) = 0;
static Int lc_compar(void* n1, void* n2)
{
}
}
-static Int blocks_leaked;
-static Int blocks_indirect;
-static Int blocks_dubious;
-static Int blocks_reachable;
-static Int blocks_suppressed;
+static SizeT blocks_leaked;
+static SizeT blocks_indirect;
+static SizeT blocks_dubious;
+static SizeT blocks_reachable;
+static SizeT blocks_suppressed;
static void full_report(ThreadId tid)
{
for (i = 0; i < n_lossrecords; i++) {
Bool print_record;
LossRecord* p_min = NULL;
- UInt n_min = 0xFFFFFFFF;
+ SizeT n_min = ~(0x0L);
for (p = errlist; p != NULL; p = p->next) {
if (p->num_blocks > 0 && p->total_bytes < n_min) {
n_min = p->total_bytes + p->indirect_bytes;
if (VG_(clo_verbosity) > 0 && !VG_(clo_xml))
VG_(message)(Vg_UserMsg,
- "searching for pointers to %d not-freed blocks.",
+ "searching for pointers to %,d not-freed blocks.",
lc_n_shadows );
lc_min_mallocd_addr = lc_shadows[0]->data;
lc_do_leakcheck(-1);
if (VG_(clo_verbosity) > 0 && !VG_(clo_xml))
- VG_(message)(Vg_UserMsg, "checked %d bytes.", lc_scanned);
+ VG_(message)(Vg_UserMsg, "checked %,lu bytes.", lc_scanned);
blocks_leaked = MAC_(bytes_leaked) = 0;
blocks_indirect = MAC_(bytes_indirect) = 0;
if (VG_(clo_verbosity) > 0 && !VG_(clo_xml)) {
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "LEAK SUMMARY:");
- VG_(message)(Vg_UserMsg, " definitely lost: %d bytes in %d blocks.",
+ VG_(message)(Vg_UserMsg, " definitely lost: %,lu bytes in %,lu blocks.",
MAC_(bytes_leaked), blocks_leaked );
if (blocks_indirect > 0)
- VG_(message)(Vg_UserMsg, " indirectly lost: %d bytes in %d blocks.",
+ VG_(message)(Vg_UserMsg, " indirectly lost: %,lu bytes in %,lu blocks.",
MAC_(bytes_indirect), blocks_indirect );
- VG_(message)(Vg_UserMsg, " possibly lost: %d bytes in %d blocks.",
+ VG_(message)(Vg_UserMsg, " possibly lost: %,lu bytes in %,lu blocks.",
MAC_(bytes_dubious), blocks_dubious );
- VG_(message)(Vg_UserMsg, " still reachable: %d bytes in %d blocks.",
+ VG_(message)(Vg_UserMsg, " still reachable: %,lu bytes in %,lu blocks.",
MAC_(bytes_reachable), blocks_reachable );
- VG_(message)(Vg_UserMsg, " suppressed: %d bytes in %d blocks.",
+ VG_(message)(Vg_UserMsg, " suppressed: %,lu bytes in %,lu blocks.",
MAC_(bytes_suppressed), blocks_suppressed );
if (mode == LC_Summary && blocks_leaked > 0)
VG_(message)(Vg_UserMsg,
void MAC_(print_malloc_stats) ( void )
{
MAC_Chunk* mc;
- UInt nblocks = 0;
+ SizeT nblocks = 0;
SizeT nbytes = 0;
if (VG_(clo_verbosity) == 0)
}
VG_(message)(Vg_UserMsg,
- "malloc/free: in use at exit: %d bytes in %d blocks.",
+ "malloc/free: in use at exit: %,lu bytes in %,lu blocks.",
nbytes, nblocks);
VG_(message)(Vg_UserMsg,
- "malloc/free: %d allocs, %d frees, %u bytes allocated.",
+ "malloc/free: %,lu allocs, %,lu frees, %,lu bytes allocated.",
cmalloc_n_mallocs,
cmalloc_n_frees, cmalloc_bs_mallocd);
if (VG_(clo_verbosity) > 1)
relative = "inside";
}
VG_(message)(Vg_UserMsg,
- "%sAddress 0x%llx is %llu bytes %s a %s of size %d %s%s",
+ "%sAddress 0x%lx is %,lu bytes %s a %s of size %,lu %s%s",
xpre,
- (ULong)a, (ULong)delta, relative, kind,
+ a, delta, relative, kind,
ai->blksize,
ai->akind==Mallocd ? "alloc'd"
: ai->akind==Freed ? "free'd"
extern Bool (*MAC_(describe_addr_supp)) ( Addr a, AddrInfo* ai );
/* For VALGRIND_COUNT_LEAKS client request */
-extern Int MAC_(bytes_leaked);
-extern Int MAC_(bytes_indirect);
-extern Int MAC_(bytes_dubious);
-extern Int MAC_(bytes_reachable);
-extern Int MAC_(bytes_suppressed);
+extern SizeT MAC_(bytes_leaked);
+extern SizeT MAC_(bytes_indirect);
+extern SizeT MAC_(bytes_dubious);
+extern SizeT MAC_(bytes_reachable);
+extern SizeT MAC_(bytes_suppressed);
/*------------------------------------------------------------*/
/*--- Functions ---*/
Invalid write of size 1
at 0x........: main (describe-block.c:6)
- Address 0x........ is 0 bytes inside a magic foople zone of size 4096 client-defined
+ Address 0x........ is 0 bytes inside a magic foople zone of size 4,096 client-defined
at 0x........: main (describe-block.c:5)
Process terminating with default action of signal 11 (SIGSEGV)
Invalid write of size 1
at 0x........: main (exitprog.c:18)
- Address 0x........ is 0 bytes after a block of size 1000000 alloc'd
+ Address 0x........ is 0 bytes after a block of size 1,000,000 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (exitprog.c:15)
#! /bin/sh
./filter_stderr |
-sed "s/checked [0-9]* bytes./checked ... bytes./"
+sed "s/checked [0-9,]* bytes./checked ... bytes./"
Invalid free() / delete / delete[]
at 0x........: free (vg_replace_malloc.c:...)
by 0x........: main (memalign_test.c:17)
- Address 0x........ is 0 bytes inside a block of size 111110 free'd
+ Address 0x........ is 0 bytes inside a block of size 111,110 free'd
at 0x........: free (vg_replace_malloc.c:...)
by 0x........: main (memalign_test.c:15)
Invalid write of size 1
at 0x........: test (mempool.c:124)
by 0x........: main (mempool.c:148)
- Address 0x........ is 7 bytes inside a block of size 100000 alloc'd
+ Address 0x........ is 7 bytes inside a block of size 100,000 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: make_pool (mempool.c:38)
by 0x........: test (mempool.c:111)
Invalid write of size 1
at 0x........: test (mempool.c:125)
by 0x........: main (mempool.c:148)
- Address 0x........ is 18 bytes inside a block of size 100000 alloc'd
+ Address 0x........ is 18 bytes inside a block of size 100,000 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: make_pool (mempool.c:38)
by 0x........: test (mempool.c:111)
Invalid write of size 1
at 0x........: test (mempool.c:129)
by 0x........: main (mempool.c:148)
- Address 0x........ is 70 bytes inside a block of size 100000 alloc'd
+ Address 0x........ is 70 bytes inside a block of size 100,000 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: make_pool (mempool.c:38)
by 0x........: test (mempool.c:111)
Invalid write of size 1
at 0x........: test (mempool.c:130)
by 0x........: main (mempool.c:148)
- Address 0x........ is 96 bytes inside a block of size 100000 alloc'd
+ Address 0x........ is 96 bytes inside a block of size 100,000 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: make_pool (mempool.c:38)
by 0x........: test (mempool.c:111)
by 0x........: main (mempool.c:148)
-100028 (20 direct, 100008 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 3
+100,028 (20 direct, 100,008 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 3
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: make_pool (mempool.c:37)
by 0x........: test (mempool.c:111)
by 0x........: main (mempool.c:148)
-100048 (32 direct, 100016 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 3
+100,048 (32 direct, 100,016 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 3
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: make_pool (mempool.c:37)
by 0x........: test (mempool.c:111)
-1000 bytes in 1 blocks are definitely lost in loss record 1 of 1
+1,000 bytes in 1 blocks are definitely lost in loss record 1 of 1
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (nanoleak.c:6)
LEAK SUMMARY:
definitely lost: 0 bytes in 0 blocks.
possibly lost: 0 bytes in 0 blocks.
- still reachable: 1048576 bytes in 1 blocks.
+ still reachable: 1,048,576 bytes in 1 blocks.
suppressed: 0 bytes in 0 blocks.
Reachable blocks (those to which a pointer was found) are not shown.
To see them, rerun with: --show-reachable=yes
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
-malloc/free: in use at exit: 1048576 bytes in 1 blocks.
-malloc/free: 1 allocs, 0 frees, 1048576 bytes allocated.
+malloc/free: in use at exit: 1,048,576 bytes in 1 blocks.
+malloc/free: 1 allocs, 0 frees, 1,048,576 bytes allocated.
For counts of detected errors, rerun with: -v
searching for pointers to 1 not-freed blocks.
checked ... bytes.
-1048576 bytes in 1 blocks are definitely lost in loss record 1 of 1
+1,048,576 bytes in 1 blocks are definitely lost in loss record 1 of 1
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (pointer-trace.c:24)
LEAK SUMMARY:
- definitely lost: 1048576 bytes in 1 blocks.
+ definitely lost: 1,048,576 bytes in 1 blocks.
possibly lost: 0 bytes in 0 blocks.
still reachable: 0 bytes in 0 blocks.
suppressed: 0 bytes in 0 blocks.
definitely lost: 0 bytes in 0 blocks.
indirectly lost: 0 bytes in 0 blocks.
possibly lost: 0 bytes in 0 blocks.
- still reachable: 1048600 bytes in 2 blocks.
+ still reachable: 1,048,600 bytes in 2 blocks.
suppressed: 0 bytes in 0 blocks.
Reachable blocks (those to which a pointer was found) are not shown.
To see them, rerun with: --show-reachable=yes
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
-malloc/free: in use at exit: 1048576 bytes in 1 blocks.
-malloc/free: 2 allocs, 1 frees, 1048600 bytes allocated.
+malloc/free: in use at exit: 1,048,576 bytes in 1 blocks.
+malloc/free: 2 allocs, 1 frees, 1,048,600 bytes allocated.
For counts of detected errors, rerun with: -v
searching for pointers to 1 not-freed blocks.
checked ... bytes.
-1048576 bytes in 1 blocks are definitely lost in loss record 1 of 1
+1,048,576 bytes in 1 blocks are definitely lost in loss record 1 of 1
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (pointer-trace.c:24)
LEAK SUMMARY:
- definitely lost: 1048576 bytes in 1 blocks.
+ definitely lost: 1,048,576 bytes in 1 blocks.
indirectly lost: 0 bytes in 0 blocks.
possibly lost: 0 bytes in 0 blocks.
still reachable: 0 bytes in 0 blocks.
LEAK SUMMARY:
definitely lost: 0 bytes in 0 blocks.
possibly lost: 0 bytes in 0 blocks.
- still reachable: 2097152 bytes in 1 blocks.
+ still reachable: 2,097,152 bytes in 1 blocks.
suppressed: 0 bytes in 0 blocks.
Reachable blocks (those to which a pointer was found) are not shown.
To see them, rerun with: --show-reachable=yes
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
-malloc/free: in use at exit: 2097152 bytes in 1 blocks.
-malloc/free: 1 allocs, 0 frees, 2097152 bytes allocated.
+malloc/free: in use at exit: 2,097,152 bytes in 1 blocks.
+malloc/free: 1 allocs, 0 frees, 2,097,152 bytes allocated.
For counts of detected errors, rerun with: -v
searching for pointers to 1 not-freed blocks.
checked ... bytes.
-2097152 bytes in 1 blocks are definitely lost in loss record 1 of 1
+2,097,152 bytes in 1 blocks are definitely lost in loss record 1 of 1
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (pointer-trace.c:24)
LEAK SUMMARY:
- definitely lost: 2097152 bytes in 1 blocks.
+ definitely lost: 2,097,152 bytes in 1 blocks.
possibly lost: 0 bytes in 0 blocks.
still reachable: 0 bytes in 0 blocks.
suppressed: 0 bytes in 0 blocks.
-1000 bytes in 1000 blocks are definitely lost in loss record 1 of 1
+1,000 bytes in 1,000 blocks are definitely lost in loss record 1 of 1
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: test (trivialleak.c:8)
by 0x........: main (trivialleak.c:12)