|
From: Nicholas N. <nj...@ca...> - 2003-11-02 17:45:39
|
CVS commit by nethercote:
Fixed bug in overlap check in strncpy() -- it was assuming the src was 'n'
bytes longs, when it could be shorter, which could cause false positives.
Added an example of this to the regtest.
MERGE TO STABLE
M +6 -4 mac_replace_strmem.c 1.5
M +9 -0 tests/overlap.c 1.3
--- valgrind/memcheck/mac_replace_strmem.c #1.4:1.5
@@ -187,11 +187,13 @@ char* strcpy ( char* dst, const char* sr
char* strncpy ( char* dst, const char* src, int n )
{
+ const Char* src_orig = src;
Char* dst_orig = dst;
Int m = 0;
- if (is_overlap(dst, src, n, n))
- complain3("strncpy", dst, src, n);
-
while (m < n && *src) { m++; *dst++ = *src++; }
+ /* Check for overlap after copying; all n bytes of dst are relevant,
+ but only m+1 bytes of src if terminator was found */
+ if (is_overlap(dst_orig, src_orig, n, (m < n) ? m+1 : n))
+ complain3("strncpy", dst, src, n);
while (m++ < n) *dst++ = 0; /* must pad remainder with nulls */
--- valgrind/memcheck/tests/overlap.c #1.2:1.3
@@ -113,4 +113,13 @@ int main(void)
strncat(a, a+20, 21);
+ /* This is ok, but once gave a warning when strncpy() was wrong,
+ and used 'n' for the length, even when the src was shorter than 'n' */
+ {
+ char dest[64];
+ char src [16];
+ strcpy( src, "short" );
+ strncpy( dest, src, 20 );
+ }
+
return 0;
}
|
|
From: Nicholas N. <nj...@ca...> - 2003-11-13 17:57:50
|
CVS commit by nethercote:
Remove the Memcheck==Valgrind fallacy from Memcheck's start-up message.
M +1 -1 mc_main.c 1.40
--- valgrind/memcheck/mc_main.c #1.39:1.40
@@ -1657,5 +1657,5 @@ void SK_(pre_clo_init)(void)
VG_(details_name) ("Memcheck");
VG_(details_version) (NULL);
- VG_(details_description) ("a.k.a. Valgrind, a memory error detector");
+ VG_(details_description) ("a memory error detector");
VG_(details_copyright_author)(
"Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.");
|
|
From: Nicholas N. <nj...@ca...> - 2003-12-02 10:18:15
|
CVS commit by nethercote:
Make --leak-check observe -q properly -- only prints out errors, not general
info and summaries.
MERGE TO STABLE
M +23 -19 mac_leakcheck.c 1.11
M +0 -11 tests/nanoleak.stderr.exp 1.9
M +0 -11 tests/nanoleak_supp.stderr.exp 1.3
M +0 -11 tests/trivialleak.stderr.exp 1.8
--- valgrind/memcheck/mac_leakcheck.c #1.10:1.11
@@ -422,5 +422,7 @@ void MAC_(do_detect_memory_leaks) (
}
- VG_(message)(Vg_UserMsg, "searching for pointers to %d not-freed blocks.",
+ if (VG_(clo_verbosity) > 0)
+ VG_(message)(Vg_UserMsg,
+ "searching for pointers to %d not-freed blocks.",
lc_n_shadows );
@@ -442,4 +444,5 @@ void MAC_(do_detect_memory_leaks) (
);
+ if (VG_(clo_verbosity) > 0)
VG_(message)(Vg_UserMsg, "checked %d bytes.", bytes_notified);
@@ -527,4 +530,5 @@ void MAC_(do_detect_memory_leaks) (
}
+ if (VG_(clo_verbosity) > 0) {
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "LEAK SUMMARY:");
@@ -543,5 +547,5 @@ void MAC_(do_detect_memory_leaks) (
"To see them, rerun with: --show-reachable=yes");
}
- VG_(message)(Vg_UserMsg, "");
+ }
VG_(free) ( lc_shadows );
--- valgrind/memcheck/tests/nanoleak.stderr.exp #1.8:1.9
@@ -1,15 +1,4 @@
-searching for pointers to 1 not-freed blocks.
-checked ... bytes.
1000 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: 1000 bytes in 1 blocks.
- possibly lost: 0 bytes in 0 blocks.
- still reachable: 0 bytes in 0 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
-
--- valgrind/memcheck/tests/nanoleak_supp.stderr.exp #1.2:1.3
@@ -1,11 +0,0 @@
-searching for pointers to 1 not-freed blocks.
-checked ... bytes.
-
-LEAK SUMMARY:
- definitely lost: 0 bytes in 0 blocks.
- possibly lost: 0 bytes in 0 blocks.
- still reachable: 0 bytes in 0 blocks.
- suppressed: 1000 bytes in 1 blocks.
-Reachable blocks (those to which a pointer was found) are not shown.
-To see them, rerun with: --show-reachable=yes
-
--- valgrind/memcheck/tests/trivialleak.stderr.exp #1.7:1.8
@@ -1,4 +1,2 @@
-searching for pointers to 1000 not-freed blocks.
-checked ... bytes.
1000 bytes in 1000 blocks are definitely lost in loss record 1 of 1
@@ -6,11 +4,2 @@
by 0x........: test (trivialleak.c:8)
by 0x........: main (trivialleak.c:12)
-
-LEAK SUMMARY:
- definitely lost: 1000 bytes in 1000 blocks.
- possibly lost: 0 bytes in 0 blocks.
- still reachable: 0 bytes in 0 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
-
|
|
From: Julian S. <js...@ac...> - 2003-12-21 23:29:47
|
CVS commit by jseward:
Add a vanilla implementation of stpcpy(). Does not do overlap checking
(it should).
M +17 -0 mac_replace_strmem.c 1.9
--- valgrind/memcheck/mac_replace_strmem.c #1.8:1.9
@@ -321,4 +321,21 @@ int memcmp ( const void *s1V, const void
}
+/* glibc-2.3.2/sysdeps/generic/stpcpy.c */
+/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */
+char *
+stpcpy (dest, src)
+ char *dest;
+ const char *src;
+{
+ register char *d = dest;
+ register const char *s = src;
+
+ do
+ *d++ = *s;
+ while (*s++ != '\0');
+
+ return d - 1;
+}
+
/*--------------------------------------------------------------------*/
/*--- end mac_replace_strmem.c ---*/
|
|
From: Julian S. <js...@ac...> - 2003-12-22 22:32:46
|
CVS commit by jseward:
Add overlap checking for stpcpy().
M +19 -12 mac_replace_strmem.c 1.10
--- valgrind/memcheck/mac_replace_strmem.c #1.9:1.10
@@ -321,19 +321,25 @@ int memcmp ( const void *s1V, const void
}
-/* glibc-2.3.2/sysdeps/generic/stpcpy.c */
-/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */
-char *
-stpcpy (dest, src)
- char *dest;
- const char *src;
+
+/* Copy SRC to DEST, returning the address of the terminating '\0' in
+ DEST. (minor variant of strcpy) */
+
+char* stpcpy ( char* dst, const char* src )
{
- register char *d = dest;
- register const char *s = src;
+ const Char* src_orig = src;
+ Char* dst_orig = dst;
- do
- *d++ = *s;
- while (*s++ != '\0');
+ while (*src) *dst++ = *src++;
+ *dst = 0;
- return d - 1;
+ /* This checks for overlap after copying, unavoidable without
+ pre-counting length... should be ok */
+ if (is_overlap(dst_orig,
+ src_orig,
+ (Addr)dst-(Addr)dst_orig+1,
+ (Addr)src-(Addr)src_orig+1))
+ complain2("stpcpy", dst_orig, src_orig);
+
+ return dst;
}
|
|
From: Dirk M. <mu...@kd...> - 2004-01-02 22:47:10
|
CVS commit by mueller:
fix comment
M +1 -1 mc_translate.c 1.32
--- valgrind/memcheck/mc_translate.c #1.31:1.32
@@ -1492,5 +1492,5 @@ static void vg_propagate_definedness ( U
sz = 1; goto do_ImproveAND;
do_ImproveAND:
- /* Implements Q = T OR Q. So if Q is entirely defined,
+ /* Implements Q = T AND Q. So if Q is entirely defined,
ie all 0s, we get MOV T, Q. */
if (def[u->val2] <= 4) {
|
|
From: Nicholas N. <nj...@ca...> - 2004-03-04 18:12:16
|
CVS commit by nethercote:
Remove comma from last element of enum; C++ apparently doesn't allow it.
M +1 -1 memcheck.h 1.19
--- valgrind/memcheck/memcheck.h #1.18:1.19
@@ -93,5 +93,5 @@ typedef
/* This is just for memcheck's internal use - don't use it */
- _VG_USERREQ__MEMCHECK_GET_RECORD_OVERLAP = VG_USERREQ_SKIN_BASE('M','C')+256,
+ _VG_USERREQ__MEMCHECK_GET_RECORD_OVERLAP = VG_USERREQ_SKIN_BASE('M','C')+256
} Vg_MemCheckClientRequest;
|
|
From: Nicholas N. <nj...@ca...> - 2004-03-08 15:46:38
|
CVS commit by nethercote:
Turn off warning with -q.
M +7 -5 mc_main.c 1.47
--- valgrind/memcheck/mc_main.c #1.46:1.47
@@ -285,4 +285,5 @@ static void set_address_range_perms ( Ad
return;
+ if (VG_(clo_verbosity) > 0) {
if (len > 100 * 1000 * 1000) {
VG_(message)(Vg_UserMsg,
@@ -291,4 +292,5 @@ static void set_address_range_perms ( Ad
len, example_a_bit, example_v_bit );
}
+ }
VGP_PUSHCC(VgpSetMem);
|
|
From: Tom H. <th...@cy...> - 2004-03-28 11:26:34
|
CVS commit by thughes:
For FPU/MMX/SSE instructions which don't reference any memory, make memcheck
look at whether the eflags are read or written and generate UCode to validate
and/or mark as valid the eflags when necessary.
CCMAIL: 785...@bu...
A tests/fpeflags.c 1.1 [no copyright]
A tests/fpeflags.stderr.exp 1.1
A tests/fpeflags.vgtest 1.1
M +18 -4 mc_translate.c 1.38
M +1 -0 tests/.cvsignore 1.11
M +5 -1 tests/Makefile.am 1.35
--- valgrind/memcheck/mc_translate.c #1.37:1.38
@@ -1179,9 +1179,23 @@ static UCodeBlock* memcheck_instrument (
}
- /* For FPU, MMX and SSE insns not referencing memory, just
- copy thru. */
+ /* For MMX and SSE insns not referencing memory, just
+ make sure the eflags are defined if the instruction
+ read them, and make them defined it it writes them. */
case SSE5: case SSE4: case SSE3:
case MMX1: case MMX2: case MMX3:
case FPU:
+ if (u_in->flags_r != FlagsEmpty) {
+ qt = create_GETVF(cb, 0);
+ uInstr1(cb, TESTV, 0, TempReg, qt);
+ /* qt should never be referred to again. Nevertheless
+ ... */
+ uInstr1(cb, SETV, 0, TempReg, qt);
+ }
+ if (u_in->flags_w != FlagsEmpty) {
+ qd = newTemp(cb);
+ uInstr2(cb, MOV, 4, Literal, 0, TempReg, qd);
+ uLiteral(cb, qd);
+ create_PUTVF(cb, 0, qd);
+ }
VG_(copy_UInstr)(cb, u_in);
break;
--- valgrind/memcheck/tests/.cvsignore #1.10:1.11
@@ -17,4 +17,5 @@
filter_leak_check_size
filter_stderr
+fpeflags
fprw
fwrite
--- valgrind/memcheck/tests/Makefile.am #1.34:1.35
@@ -28,4 +28,5 @@
exitprog.stderr.exp exitprog.vgtest \
execve.stderr.exp execve.vgtest \
+ fpeflags.stderr.exp fpeflags.vgtest \
fprw.stderr.exp fprw.vgtest \
fwrite.stderr.exp fwrite.stdout.exp fwrite.vgtest \
@@ -76,5 +77,5 @@
clientperm custom_alloc \
doublefree error_counts errs1 exitprog execve \
- fprw fwrite inits inline \
+ fpeflags fprw fwrite inits inline \
malloc1 malloc2 malloc3 manuel1 manuel2 manuel3 \
memalign_test memcmptest mmaptest nanoleak new_nothrow null_socket \
@@ -103,4 +104,5 @@
execve_SOURCES = execve.c
exitprog_SOURCES = exitprog.c
+fpeflags_SOURCES = fpeflags.c
fprw_SOURCES = fprw.c
fwrite_SOURCES = fwrite.c
@@ -142,2 +144,4 @@
new_override_SOURCES = new_override.cpp
+# must be built with these flags -- bug only occurred with them
+fpeflags.o: CFLAGS += -march=i686
|
|
From: Tom H. <th...@cy...> - 2004-03-28 11:36:27
|
CVS commit by thughes:
Fix typo in FPU eflags fix.
CCMAIL: 785...@bu...
M +1 -1 mc_translate.c 1.39
--- valgrind/memcheck/mc_translate.c #1.38:1.39
@@ -1195,5 +1195,5 @@ static UCodeBlock* memcheck_instrument (
qd = newTemp(cb);
uInstr2(cb, MOV, 4, Literal, 0, TempReg, qd);
- uLiteral(cb, qd);
+ uLiteral(cb, 0);
create_PUTVF(cb, 0, qd);
}
|
|
From: Nicholas N. <nj...@ca...> - 2004-04-13 08:47:39
|
CVS commit by nethercote:
Suppressions of jump errors were broken, because the size was zero and
so caused an assertion failure. So set size == 1 -- it's only used for
suppressions.
M +1 -0 mac_needs.c 1.24
--- valgrind/memcheck/mac_needs.c #1.23:1.24
@@ -474,4 +474,5 @@ void MAC_(record_jump_error) ( ThreadId
MAC_(clear_MAC_Error)( &err_extra );
err_extra.axskind = ExecAxs;
+ err_extra.size = 1; // size only used for suppressions
err_extra.addrinfo.akind = Undescribed;
VG_(maybe_record_error)( tid, AddrErr, a, /*s*/NULL, &err_extra );
|
|
From: Nicholas N. <nj...@ca...> - 2004-04-22 12:58:13
|
CVS commit by nethercote:
SETV and TESTV never have an ArchReg as their first argument.
M +1 -3 mc_translate.c 1.40
--- valgrind/memcheck/mc_translate.c #1.39:1.40
@@ -58,5 +58,4 @@ Bool SK_(sane_XUInstr)(Bool beforeRA, Bo
# define Ls3 (u->tag3 == Lit16)
# define TRL1 (TR1 || L1)
-# define TRA1 (TR1 || A1)
# define N2 (u->tag2 == NoValue)
# define N3 (u->tag3 == NoValue)
@@ -90,5 +89,5 @@ Bool SK_(sane_XUInstr)(Bool beforeRA, Bo
case PUTVF: return LIT0 && SZ0 && CC0 && TR1 && N2 && N3 && XOTHER;
case TESTV:
- case SETV: return LIT0 && SZj && CC0 && TRA1 && N2 && N3 && XOTHER;
+ case SETV: return LIT0 && SZj && CC0 && TR1 && N2 && N3 && XOTHER;
case TAG1: return LIT0 && SZ0 && CC0 && TR1 && N2 && Ls3 && XOTHER;
case TAG2: return LIT0 && SZ0 && CC0 && TR1 && TR2 && Ls3 && XOTHER;
@@ -112,5 +111,4 @@ Bool SK_(sane_XUInstr)(Bool beforeRA, Bo
# undef Ls3
# undef TRL1
-# undef TRA1
# undef N2
# undef N3
|
|
From: Nicholas N. <nj...@ca...> - 2004-04-26 13:06:22
|
CVS commit by nethercote:
Add missing SSE case for Memcheck's instrumentation (sigh).
M +2 -1 mc_translate.c 1.41
--- valgrind/memcheck/mc_translate.c #1.40:1.41
@@ -1111,5 +1111,6 @@ static UCodeBlock* memcheck_instrument (
/* Is it a read ? Better check the V bits right now. */
- if ( u_in->opcode == SSE3e_RegRd
+ if ( u_in->opcode == SSE2e1_RegRd
+ || u_in->opcode == SSE3e_RegRd
|| u_in->opcode == SSE3e1_RegRd )
uInstr1(cb, TESTV, u_in->size,
|
|
From: Tom H. <th...@cy...> - 2004-08-23 18:39:22
|
CVS commit by thughes:
Prevent a memcpy of zero bytes from complaining if one or both of the
pointers given as arguments is uninitialised.
CCMAIL: 869...@bu...
M +4 -1 mac_replace_strmem.c 1.13
--- valgrind/memcheck/mac_replace_strmem.c #1.12:1.13
@@ -274,4 +274,7 @@ void* memcpy( void *dst, const void *src
register char *s;
+ if (len == 0)
+ return dst;
+
if (is_overlap(dst, src, len, len))
complain3("memcpy", dst, src, len);
|
|
From: Nicholas N. <nj...@ca...> - 2004-08-25 13:33:31
|
CVS commit by nethercote:
Remove three unnecessary compile-time warnings.
Two were trivial. The one for strncmp is slightly trickier; you have to be
careful with the signedness of chars when comparing them... but the code
already casts s1 and s2 to (unsigned char*) before comparing them, so it's not
a problem.
M +5 -6 mac_replace_strmem.c 1.14
--- valgrind/memcheck/mac_replace_strmem.c #1.13:1.14
@@ -156,9 +156,9 @@ char* strcat ( char* dst, const char* sr
}
-char* strncat ( char* dst, const char* src, int n )
+char* strncat ( char* dst, const char* src, unsigned int n )
{
const Char* src_orig = src;
Char* dst_orig = dst;
- Int m = 0;
+ UInt m = 0;
while (*dst) dst++;
@@ -210,9 +210,9 @@ char* strcpy ( char* dst, const char* sr
}
-char* strncpy ( char* dst, const char* src, int n )
+char* strncpy ( char* dst, const char* src, unsigned int n )
{
const Char* src_orig = src;
Char* dst_orig = dst;
- Int m = 0;
+ UInt m = 0;
while (m < n && *src) { m++; *dst++ = *src++; }
@@ -226,6 +226,5 @@ char* strncpy ( char* dst, const char* s
}
-int strncmp ( const unsigned char* s1, const unsigned char* s2,
- unsigned int nmax )
+int strncmp ( const char* s1, const char* s2, unsigned int nmax )
{
unsigned int n = 0;
|
|
From: Tom H. <th...@cy...> - 2004-10-06 12:19:01
|
CVS commit by thughes:
Remove spurious (void) cast from VALGRIND_CHECK_DEFINED so that it
actually does what the comment says it does. Patch from Nathan Kurz.
CCMAIL: 907...@bu...
M +0 -1 memcheck.h 1.20
--- valgrind/memcheck/memcheck.h #1.19:1.20
@@ -178,5 +178,4 @@ typedef
zero. */
#define VALGRIND_CHECK_DEFINED(__lvalue) \
- (void) \
VALGRIND_CHECK_READABLE( \
(volatile unsigned char *)&(__lvalue), \
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-25 19:46:11
|
CVS commit by nethercote:
Avoid strange warnings about dereferencing type-punned pointers that occurs
with GCC 3.3+.
M +6 -6 mac_malloc_wrappers.c 1.14
M +1 -1 mc_clientreqs.c 1.22
--- valgrind/memcheck/mac_malloc_wrappers.c #1.13:1.14
@@ -291,5 +291,5 @@ void MAC_(handle_free) ( Addr p, UInt rz
mc = (MAC_Chunk*)VG_(HT_get_node) ( MAC_(malloc_list), (UInt)p,
- (VgHashNode***)&prev_chunks_next_ptr );
+ (void*)&prev_chunks_next_ptr );
if (mc == NULL) {
MAC_(record_free_error) ( tid, p );
@@ -343,5 +343,5 @@ void* SK_(realloc) ( void* p, Int new_si
/* First try and find the block. */
mc = (MAC_Chunk*)VG_(HT_get_node) ( MAC_(malloc_list), (UInt)p,
- (VgHashNode***)&prev_chunks_next_ptr );
+ (void*)&prev_chunks_next_ptr );
if (mc == NULL) {
@@ -450,5 +450,5 @@ void MAC_(destroy_mempool)(Addr pool)
mp = (MAC_Mempool*)VG_(HT_get_node) ( MAC_(mempool_list),
(UInt)pool,
- (VgHashNode***)&prev_next );
+ (void*)&prev_next );
if (mp == NULL) {
@@ -472,5 +472,5 @@ void MAC_(mempool_alloc)(Addr pool, Addr
mp = (MAC_Mempool*)VG_(HT_get_node) ( MAC_(mempool_list), (UInt)pool,
- (VgHashNode***)&prev_next );
+ (void*)&prev_next );
if (mp == NULL) {
@@ -495,5 +495,5 @@ void MAC_(mempool_free)(Addr pool, Addr
mp = (MAC_Mempool*)VG_(HT_get_node)(MAC_(mempool_list), (UInt)pool,
- (VgHashNode***)&prev_pool);
+ (void*)&prev_pool);
if (mp == NULL) {
@@ -503,5 +503,5 @@ void MAC_(mempool_free)(Addr pool, Addr
mc = (MAC_Chunk*)VG_(HT_get_node)(mp->chunks, (UInt)addr,
- (VgHashNode***)&prev_chunk);
+ (void*)&prev_chunk);
if (mc == NULL) {
--- valgrind/memcheck/mc_clientreqs.c #1.21:1.22
@@ -148,5 +148,5 @@ Bool MC_(client_perm_maybe_describe)( Ad
mp = (MAC_Mempool*)VG_(HT_get_node)(MAC_(mempool_list),
(UInt)vg_cgbs[i].start,
- (VgHashNode***)&d);
+ (void*)&d);
if(mp != NULL) {
if(mp->chunks != NULL) {
|
|
From: Jeremy F. <je...@go...> - 2005-02-23 02:33:34
|
CVS commit by fitzhardinge:
Make the leak-checker handle references to 0-byte allocations properly.
BUGS:99923
M +10 -5 mac_leakcheck.c 1.18
--- valgrind/memcheck/mac_leakcheck.c #1.17:1.18
@@ -201,5 +201,5 @@ Int find_shadow_for_OLD ( Addr pt
PROF_EVENT(71);
a_lo = shadows[i]->data;
- a_hi = ((Addr)shadows[i]->data) + shadows[i]->size - 1;
+ a_hi = ((Addr)shadows[i]->data) + shadows[i]->size;
if (a_lo <= ptr && ptr <= a_hi)
return i;
@@ -227,5 +227,5 @@ Int find_shadow_for ( Addr ptr,
mid = (lo + hi) / 2;
a_mid_lo = shadows[mid]->data;
- a_mid_hi = shadows[mid]->data + shadows[mid]->size - 1;
+ a_mid_hi = shadows[mid]->data + shadows[mid]->size;
if (ptr < a_mid_lo) {
@@ -277,16 +277,21 @@ void vg_detect_memory_leaks_notify_addr
line.
*/
- if (!VG_(is_client_addr)(a)) return;
+ if (!VG_(is_client_addr)(a))
+ return;
/* OK, let's get on and do something Useful for a change. */
ptr = (Addr)word_at_a;
+ if (0)
+ VG_(printf)("notify %p -> %x; min=%p max=%p\n", a, word_at_a,
+ lc_min_mallocd_addr, lc_max_mallocd_addr);
if (ptr >= lc_min_mallocd_addr && ptr <= lc_max_mallocd_addr) {
/* Might be legitimate; we'll have to investigate further. */
sh_no = find_shadow_for ( ptr, lc_shadows, lc_n_shadows );
+ if (0) VG_(printf)("find_shadow_for(%p) -> %d\n", ptr, sh_no);
if (sh_no != -1) {
/* Found a block at/into which ptr points. */
sk_assert(sh_no >= 0 && sh_no < lc_n_shadows);
- sk_assert(ptr < lc_shadows[sh_no]->data + lc_shadows[sh_no]->size);
+ sk_assert(ptr <= lc_shadows[sh_no]->data + lc_shadows[sh_no]->size);
/* Decide whether Proper-ly or Interior-ly reached. */
if (ptr == lc_shadows[sh_no]->data) {
@@ -391,5 +396,5 @@ void MAC_(do_detect_memory_leaks) (
lc_min_mallocd_addr = lc_shadows[0]->data;
lc_max_mallocd_addr = lc_shadows[lc_n_shadows-1]->data
- + lc_shadows[lc_n_shadows-1]->size - 1;
+ + lc_shadows[lc_n_shadows-1]->size;
lc_reachedness = VG_(malloc)( lc_n_shadows * sizeof(Reachedness) );
|
|
From: Jeremy F. <je...@go...> - 2005-02-25 01:54:13
|
CVS commit by fitzhardinge:
Group leaked blocks, so that only the "head" of linked blocks is reported.
For each of those, it also reports the amount of indirect leaking, so
you can tell what the total amount of leaked memory due to a particular
allocation site is. --show-reachable=yes will show both reachable allocated
blocks and indirectly leaked blocks.
M +109 -48 mac_leakcheck.c 1.20
--- valgrind/memcheck/mac_leakcheck.c #1.19:1.20
@@ -35,5 +35,6 @@
/* Define to debug the memory-leak-detector. */
-/* #define VG_DEBUG_LEAKCHECK */
+#define VG_DEBUG_LEAKCHECK 0
+#define VG_DEBUG_CLIQUE 0
#define ROUNDDN(p, a) ((Addr)(p) & ~((a)-1))
@@ -104,5 +105,5 @@ typedef
has been sorted on the ->data field. */
-#ifdef VG_DEBUG_LEAKCHECK
+#if VG_DEBUG_LEAKCHECK
/* Used to sanity-check the fast binary-search mechanism. */
static
@@ -159,5 +160,5 @@ Int find_shadow_for ( Addr ptr,
}
-# ifdef VG_DEBUG_LEAKCHECK
+# if VG_DEBUG_LEAKCHECK
sk_assert(retVal == find_shadow_for_OLD ( ptr, shadows, n_shadows ));
# endif
@@ -173,16 +174,14 @@ static Int lc_markstack_top;
static Addr lc_min_mallocd_addr;
static Addr lc_max_mallocd_addr;
+static SizeT lc_scanned;
static Bool (*lc_is_valid_chunk) (UInt chunk);
static Bool (*lc_is_valid_address)(Addr addr);
-/* Used for printing leak errors, avoids exposing the LossRecord type (which
- comes in as void*, requiring a cast. */
-void MAC_(pp_LeakError)(void* vl, UInt n_this_record, UInt n_total_records)
+static const Char *pp_lossmode(Reachedness lossmode)
{
- LossRecord* l = (LossRecord*)vl;
const Char *loss = "?";
- switch(l->loss_mode) {
+ switch(lossmode) {
case Unreached: loss = "definitely lost"; break;
case IndirectLeak: loss = "indirectly lost"; break;
@@ -191,9 +190,27 @@ void MAC_(pp_LeakError)(void* vl, UInt n
}
+ return loss;
+}
+
+/* Used for printing leak errors, avoids exposing the LossRecord type (which
+ comes in as void*, requiring a cast. */
+void MAC_(pp_LeakError)(void* vl, UInt n_this_record, UInt n_total_records)
+{
+ LossRecord* l = (LossRecord*)vl;
+ const Char *loss = pp_lossmode(l->loss_mode);
+
VG_(message)(Vg_UserMsg, "");
+ if (l->indirect_bytes) {
VG_(message)(Vg_UserMsg,
- "%d+%d bytes in %d blocks are %s in loss record %d of %d",
+ "%d (%d+%d) bytes in %d blocks are %s in loss record %d of %d",
+ l->total_bytes + l->indirect_bytes,
l->total_bytes, l->indirect_bytes, l->num_blocks,
loss, n_this_record, n_total_records);
+ } else {
+ VG_(message)(Vg_UserMsg,
+ "%d bytes in %d blocks are %s in loss record %d of %d",
+ l->total_bytes, l->num_blocks,
+ loss, n_this_record, n_total_records);
+ }
VG_(pp_ExeContext)(l->allocated_at);
}
@@ -213,8 +230,17 @@ static Int lc_compar(void* n1, void* n2)
/* If ptr is pointing to a heap-allocated block which hasn't been seen
- before, push it onto the mark stack. */
-static void _lc_markstack_push(Addr ptr, Bool mopup)
+ before, push it onto the mark stack. Clique is the index of the
+ clique leader; -1 if none. */
+static void _lc_markstack_push(Addr ptr, Int clique)
{
- Int sh_no = find_shadow_for(ptr, lc_shadows, lc_n_shadows);
+ Int sh_no;
+
+ if (!VG_(is_client_addr)(ptr)) /* quick filter */
+ return;
+
+ sh_no = find_shadow_for(ptr, lc_shadows, lc_n_shadows);
+
+ if (VG_DEBUG_LEAKCHECK)
+ VG_(printf)("ptr=%p -> block %d\n", ptr, sh_no);
if (sh_no == -1)
@@ -234,11 +260,35 @@ static void _lc_markstack_push(Addr ptr,
}
- if (mopup) {
+ if (clique != -1) {
if (0)
VG_(printf)("mopup: %d: %p is %d\n",
sh_no, lc_shadows[sh_no]->data, lc_markstack[sh_no].state);
- if (lc_markstack[sh_no].state == Unreached)
+ /* An unmarked block - add it to the clique. Add its size to
+ the clique-leader's indirect size. If the new block was
+ itself a clique leader, it isn't any more, so add its
+ indirect to the new clique leader.
+
+ If this block *is* the clique leader, it means this is a
+ cyclic structure, so none of this applies. */
+ if (lc_markstack[sh_no].state == Unreached) {
lc_markstack[sh_no].state = IndirectLeak;
+
+ if (sh_no != clique) {
+ if (VG_DEBUG_CLIQUE) {
+ if (lc_markstack[sh_no].indirect)
+ VG_(printf)(" clique %d joining clique %d adding %d+%d bytes\n",
+ sh_no, clique,
+ lc_shadows[sh_no]->size, lc_markstack[sh_no].indirect);
+ else
+ VG_(printf)(" %d joining %d adding %d\n",
+ sh_no, clique, lc_shadows[sh_no]->size);
+ }
+
+ lc_markstack[clique].indirect += lc_shadows[sh_no]->size;
+ lc_markstack[clique].indirect += lc_markstack[sh_no].indirect;
+ lc_markstack[sh_no].indirect = 0; /* shouldn't matter */
+ }
+ }
} else if (ptr == lc_shadows[sh_no]->data) {
lc_markstack[sh_no].state = Proper;
@@ -251,5 +301,5 @@ static void _lc_markstack_push(Addr ptr,
static void lc_markstack_push(Addr ptr)
{
- _lc_markstack_push(ptr, False);
+ _lc_markstack_push(ptr, -1);
}
@@ -268,6 +318,9 @@ static Int lc_markstack_pop(void)
/* Scan a block of memory between [start, start+len). This range may
- be bogus, inaccessable, or otherwise strange; we deal with it. */
-static void _lc_scan_memory(Addr start, SizeT len, Bool mopup)
+ be bogus, inaccessable, or otherwise strange; we deal with it.
+
+ If clique != -1, it means we're gathering leaked memory into
+ cliques, and clique is the index of the current clique leader. */
+static void _lc_scan_memory(Addr start, SizeT len, Int clique)
{
Addr ptr = ROUNDUP(start, sizeof(Addr));
@@ -275,7 +328,11 @@ static void _lc_scan_memory(Addr start,
vki_sigset_t sigmask;
+ if (VG_DEBUG_LEAKCHECK)
+ VG_(printf)("scan %p-%p\n", start, len);
VG_(sigprocmask)(VKI_SIG_SETMASK, NULL, &sigmask);
VG_(set_fault_catcher)(vg_scan_all_valid_memory_catcher);
+ lc_scanned += end-ptr;
+
if (!VG_(is_client_addr)(ptr) ||
!VG_(is_addressable)(ptr, sizeof(Addr), VKI_PROT_READ))
@@ -301,6 +358,7 @@ static void _lc_scan_memory(Addr start,
if ((*lc_is_valid_address)(ptr)) {
addr = *(Addr *)ptr;
- _lc_markstack_push(addr, mopup);
- }
+ _lc_markstack_push(addr, clique);
+ } else if (0 && VG_DEBUG_LEAKCHECK)
+ VG_(printf)("%p not valid\n", ptr);
ptr += sizeof(Addr);
} else {
@@ -309,5 +367,5 @@ static void _lc_scan_memory(Addr start,
VG_(sigprocmask)(VKI_SIG_SETMASK, &sigmask, NULL);
- ptr = PGROUNDUP(ptr); /* bad page - skip it */
+ ptr = PGROUNDUP(ptr+1); /* bad page - skip it */
}
}
@@ -319,5 +377,5 @@ static void _lc_scan_memory(Addr start,
static void lc_scan_memory(Addr start, SizeT len)
{
- _lc_scan_memory(start, len, False);
+ _lc_scan_memory(start, len, -1);
}
@@ -325,7 +383,6 @@ static void lc_scan_memory(Addr start, S
actually gathering leaked blocks, so they should be marked
IndirectLeak. */
-static SizeT lc_do_leakcheck(Bool mopup)
+static void lc_do_leakcheck(Int clique)
{
- Int scanned = 0;
Int top;
@@ -334,10 +391,6 @@ static SizeT lc_do_leakcheck(Bool mopup)
sk_assert(lc_markstack[top].state != Unreached);
- scanned += lc_shadows[top]->size;
-
- _lc_scan_memory(lc_shadows[top]->data, lc_shadows[top]->size, mopup);
+ _lc_scan_memory(lc_shadows[top]->data, lc_shadows[top]->size, clique);
}
-
- return scanned;
}
@@ -363,5 +416,4 @@ void MAC_(do_detect_memory_leaks) (
Int blocks_suppressed;
Int n_lossrecords;
- UInt bytes_notified;
Bool is_suppressed;
@@ -416,4 +468,6 @@ void MAC_(do_detect_memory_leaks) (
lc_is_valid_address = is_valid_address;
+ lc_scanned = 0;
+
/* Do the scan of memory, pushing any pointers onto the mark stack */
VG_(find_root_memory)(lc_scan_memory);
@@ -423,14 +477,19 @@ void MAC_(do_detect_memory_leaks) (
/* Keep walking the heap until everything is found */
- bytes_notified = lc_do_leakcheck(False);
+ lc_do_leakcheck(-1);
if (VG_(clo_verbosity) > 0)
- VG_(message)(Vg_UserMsg, "checked %d bytes.", bytes_notified);
+ VG_(message)(Vg_UserMsg, "checked %d bytes.", lc_scanned);
- /* Go through and find the heads of lost data-structures; we don't
- want to report every single lost block individually. */
+ /* Go through and group lost structures into cliques. For each
+ Unreached block, push it onto the mark stack, and find all the
+ blocks linked to it. These are marked IndirectLeak, and their
+ size is added to the clique leader's indirect size. If one of
+ the found blocks was itself a clique leader (from a previous
+ pass), then the cliques are merged. */
for (i = 0; i < lc_n_shadows; i++) {
- SizeT indirect = 0;
-
+ if (VG_DEBUG_CLIQUE)
+ VG_(printf)("cliques: %d at %p -> %s\n",
+ i, lc_shadows[i]->data, pp_lossmode(lc_markstack[i].state));
if (lc_markstack[i].state != Unreached)
continue;
@@ -438,16 +497,17 @@ void MAC_(do_detect_memory_leaks) (
sk_assert(lc_markstack_top == -1);
- if (0)
- VG_(printf)("%d: mopping up from %p\n", i, lc_shadows[i]->data);
+ if (VG_DEBUG_CLIQUE)
+ VG_(printf)("%d: gathering clique %p\n", i, lc_shadows[i]->data);
- _lc_markstack_push(lc_shadows[i]->data, True);
+ _lc_markstack_push(lc_shadows[i]->data, i);
- indirect = lc_do_leakcheck(True);
+ lc_do_leakcheck(i);
sk_assert(lc_markstack_top == -1);
sk_assert(lc_markstack[i].state == IndirectLeak);
- lc_markstack[i].state = Unreached; /* return to unreached state */
- lc_markstack[i].indirect = indirect;
+ lc_markstack[i].state = Unreached; /* Return to unreached state,
+ to indicate its a clique
+ leader */
}
@@ -496,5 +556,5 @@ void MAC_(do_detect_memory_leaks) (
for (p = errlist; p != NULL; p = p->next) {
if (p->num_blocks > 0 && p->total_bytes < n_min) {
- n_min = p->total_bytes;
+ n_min = p->total_bytes + p->indirect_bytes;
p_min = p;
}
@@ -505,8 +565,9 @@ void MAC_(do_detect_memory_leaks) (
we disallow that when --leak-check=yes.
- Prints the error if not suppressed, unless it's reachable (Proper)
+ Prints the error if not suppressed, unless it's reachable (Proper or IndirectLeak)
and --show-reachable=no */
- print_record = ( MAC_(clo_show_reachable) || Proper != p_min->loss_mode );
+ print_record = ( MAC_(clo_show_reachable) ||
+ Unreached == p_min->loss_mode || Interior == p_min->loss_mode );
is_suppressed =
VG_(unique_error) ( VG_(get_VCPU_tid)(), LeakErr, (UInt)i+1,
|
|
From: Dirk M. <mu...@kd...> - 2005-02-27 00:16:06
|
CVS commit by mueller:
these are used as function pointers, can't use regparms here, as gcc
tries to tell you:
mc_main.c:1968: warning: passing arg 1 of `vgPlain_init_new_mem_stack_4' from incompatible pointer type
M +22 -22 mac_shared.h 1.33
--- valgrind/memcheck/mac_shared.h #1.32:1.33
@@ -364,14 +364,14 @@ extern void MAC_(do_detect_memory_leaks)
);
-extern REGPARM(1) void MAC_(new_mem_stack_4) ( Addr old_ESP );
-extern REGPARM(1) void MAC_(die_mem_stack_4) ( Addr old_ESP );
-extern REGPARM(1) void MAC_(new_mem_stack_8) ( Addr old_ESP );
-extern REGPARM(1) void MAC_(die_mem_stack_8) ( Addr old_ESP );
-extern REGPARM(1) void MAC_(new_mem_stack_12) ( Addr old_ESP );
-extern REGPARM(1) void MAC_(die_mem_stack_12) ( Addr old_ESP );
-extern REGPARM(1) void MAC_(new_mem_stack_16) ( Addr old_ESP );
-extern REGPARM(1) void MAC_(die_mem_stack_16) ( Addr old_ESP );
-extern REGPARM(1) void MAC_(new_mem_stack_32) ( Addr old_ESP );
-extern REGPARM(1) void MAC_(die_mem_stack_32) ( Addr old_ESP );
+extern void MAC_(new_mem_stack_4) ( Addr old_ESP );
+extern void MAC_(die_mem_stack_4) ( Addr old_ESP );
+extern void MAC_(new_mem_stack_8) ( Addr old_ESP );
+extern void MAC_(die_mem_stack_8) ( Addr old_ESP );
+extern void MAC_(new_mem_stack_12) ( Addr old_ESP );
+extern void MAC_(die_mem_stack_12) ( Addr old_ESP );
+extern void MAC_(new_mem_stack_16) ( Addr old_ESP );
+extern void MAC_(die_mem_stack_16) ( Addr old_ESP );
+extern void MAC_(new_mem_stack_32) ( Addr old_ESP );
+extern void MAC_(die_mem_stack_32) ( Addr old_ESP );
extern void MAC_(die_mem_stack) ( Addr a, SizeT len);
extern void MAC_(new_mem_stack) ( Addr a, SizeT len);
@@ -394,5 +394,5 @@ extern void MAC_(new_mem_stac
UNALIGNED_NEW, UNALIGNED_DIE) \
\
-void REGPARM(1) MAC_(new_mem_stack_4)(Addr new_ESP) \
+void MAC_(new_mem_stack_4)(Addr new_ESP) \
{ \
PROF_EVENT(110); \
@@ -404,5 +404,5 @@ void REGPARM(1) MAC_(new_mem_stack_4)(Ad
} \
\
-void REGPARM(1) MAC_(die_mem_stack_4)(Addr new_ESP) \
+void MAC_(die_mem_stack_4)(Addr new_ESP) \
{ \
PROF_EVENT(120); \
@@ -414,5 +414,5 @@ void REGPARM(1) MAC_(die_mem_stack_4)(Ad
} \
\
-void REGPARM(1) MAC_(new_mem_stack_8)(Addr new_ESP) \
+void MAC_(new_mem_stack_8)(Addr new_ESP) \
{ \
PROF_EVENT(111); \
@@ -427,5 +427,5 @@ void REGPARM(1) MAC_(new_mem_stack_8)(Ad
} \
\
-void REGPARM(1) MAC_(die_mem_stack_8)(Addr new_ESP) \
+void MAC_(die_mem_stack_8)(Addr new_ESP) \
{ \
PROF_EVENT(121); \
@@ -440,5 +440,5 @@ void REGPARM(1) MAC_(die_mem_stack_8)(Ad
} \
\
-void REGPARM(1) MAC_(new_mem_stack_12)(Addr new_ESP) \
+void MAC_(new_mem_stack_12)(Addr new_ESP) \
{ \
PROF_EVENT(112); \
@@ -454,5 +454,5 @@ void REGPARM(1) MAC_(new_mem_stack_12)(A
} \
\
-void REGPARM(1) MAC_(die_mem_stack_12)(Addr new_ESP) \
+void MAC_(die_mem_stack_12)(Addr new_ESP) \
{ \
PROF_EVENT(122); \
@@ -469,5 +469,5 @@ void REGPARM(1) MAC_(die_mem_stack_12)(A
} \
\
-void REGPARM(1) MAC_(new_mem_stack_16)(Addr new_ESP) \
+void MAC_(new_mem_stack_16)(Addr new_ESP) \
{ \
PROF_EVENT(113); \
@@ -484,5 +484,5 @@ void REGPARM(1) MAC_(new_mem_stack_16)(A
} \
\
-void REGPARM(1) MAC_(die_mem_stack_16)(Addr new_ESP) \
+void MAC_(die_mem_stack_16)(Addr new_ESP) \
{ \
PROF_EVENT(123); \
@@ -499,5 +499,5 @@ void REGPARM(1) MAC_(die_mem_stack_16)(A
} \
\
-void REGPARM(1) MAC_(new_mem_stack_32)(Addr new_ESP) \
+void MAC_(new_mem_stack_32)(Addr new_ESP) \
{ \
PROF_EVENT(114); \
@@ -518,5 +518,5 @@ void REGPARM(1) MAC_(new_mem_stack_32)(A
} \
\
-void REGPARM(1) MAC_(die_mem_stack_32)(Addr new_ESP) \
+void MAC_(die_mem_stack_32)(Addr new_ESP) \
{ \
PROF_EVENT(124); \
|
|
From: Jeremy F. <je...@go...> - 2005-02-27 01:35:59
|
Dirk Mueller wrote:
>CVS commit by mueller:
>
>these are used as function pointers, can't use regparms here, as gcc
>tries to tell you:
>
>mc_main.c:1968: warning: passing arg 1 of `vgPlain_init_new_mem_stack_4' from incompatible pointer type
>
>
Ah, no, surely the fix is to change the type of the pointer to include
the regparm? [ I see you reverted it. ]
I wish you'd given us a heads-up before checking all this stuff. It's
causing masses of conflicts with my pending changes, and it will just
make the Vex merge even more of a pain; it would be better to hold off
this cosmetic stuff until after the merge. Also, someone (Nick?) went
through and converted a lot of the comments to C99/C++ not long ago;
what's the motive behind converting them all back? gcc has always
supported them, no?
J
|
|
From: Julian S. <js...@ac...> - 2005-02-27 01:51:57
|
> I wish you'd given us a heads-up before checking all this stuff. It's > causing masses of conflicts with my pending changes, and it will just > make the Vex merge even more of a pain; it would be better to hold off > this cosmetic stuff until after the merge. I completely agree; this is going to cause a huge amount of difficulty in merging the cvs head and the amd64/etc dev line, something which looked difficult even before this. Please back these out. Cleaning up for gcc4 is obviously a good thing to do (there was a discussion on the list only yesterday) but now is not a good time to do it. J |
|
From: Dirk M. <mu...@kd...> - 2005-02-27 14:07:53
|
On Sunday 27 February 2005 02:51, Julian Seward wrote: > Please back these out. Cleaning up for gcc4 is obviously a good > thing to do (there was a discussion on the list only yesterday) > but now is not a good time to do it. Reverted the comment-only changes. I hope the two changes to configure.in are okay, still? If its causing headaches I'm more than willing to merge them into the vex branch myself to avoid the merging trouble for you. -- Dirk//\ |
|
From: Julian S. <js...@ac...> - 2005-02-27 14:35:53
|
Thanks Dirk. Appreciated. Sorry for the unfortunate timing of this. J On Sunday 27 February 2005 14:07, Dirk Mueller wrote: > On Sunday 27 February 2005 02:51, Julian Seward wrote: > > Please back these out. Cleaning up for gcc4 is obviously a good > > thing to do (there was a discussion on the list only yesterday) > > but now is not a good time to do it. > > Reverted the comment-only changes. I hope the two changes to configure.in > are okay, still? If its causing headaches I'm more than willing to merge > them into the vex branch myself to avoid the merging trouble for you. |
|
From: Dirk M. <mu...@kd...> - 2005-02-27 00:40:06
|
CVS commit by mueller:
cvsrevertlast
M +22 -22 mac_shared.h 1.34
--- valgrind/memcheck/mac_shared.h #1.33:1.34
@@ -364,14 +364,14 @@ extern void MAC_(do_detect_memory_leaks)
);
-extern void MAC_(new_mem_stack_4) ( Addr old_ESP );
-extern void MAC_(die_mem_stack_4) ( Addr old_ESP );
-extern void MAC_(new_mem_stack_8) ( Addr old_ESP );
-extern void MAC_(die_mem_stack_8) ( Addr old_ESP );
-extern void MAC_(new_mem_stack_12) ( Addr old_ESP );
-extern void MAC_(die_mem_stack_12) ( Addr old_ESP );
-extern void MAC_(new_mem_stack_16) ( Addr old_ESP );
-extern void MAC_(die_mem_stack_16) ( Addr old_ESP );
-extern void MAC_(new_mem_stack_32) ( Addr old_ESP );
-extern void MAC_(die_mem_stack_32) ( Addr old_ESP );
+extern REGPARM(1) void MAC_(new_mem_stack_4) ( Addr old_ESP );
+extern REGPARM(1) void MAC_(die_mem_stack_4) ( Addr old_ESP );
+extern REGPARM(1) void MAC_(new_mem_stack_8) ( Addr old_ESP );
+extern REGPARM(1) void MAC_(die_mem_stack_8) ( Addr old_ESP );
+extern REGPARM(1) void MAC_(new_mem_stack_12) ( Addr old_ESP );
+extern REGPARM(1) void MAC_(die_mem_stack_12) ( Addr old_ESP );
+extern REGPARM(1) void MAC_(new_mem_stack_16) ( Addr old_ESP );
+extern REGPARM(1) void MAC_(die_mem_stack_16) ( Addr old_ESP );
+extern REGPARM(1) void MAC_(new_mem_stack_32) ( Addr old_ESP );
+extern REGPARM(1) void MAC_(die_mem_stack_32) ( Addr old_ESP );
extern void MAC_(die_mem_stack) ( Addr a, SizeT len);
extern void MAC_(new_mem_stack) ( Addr a, SizeT len);
@@ -394,5 +394,5 @@ extern void MAC_(new_mem_stack) ( Addr a
UNALIGNED_NEW, UNALIGNED_DIE) \
\
-void MAC_(new_mem_stack_4)(Addr new_ESP) \
+void REGPARM(1) MAC_(new_mem_stack_4)(Addr new_ESP) \
{ \
PROF_EVENT(110); \
@@ -404,5 +404,5 @@ void MAC_(new_mem_stack_4)(Addr new_ESP)
} \
\
-void MAC_(die_mem_stack_4)(Addr new_ESP) \
+void REGPARM(1) MAC_(die_mem_stack_4)(Addr new_ESP) \
{ \
PROF_EVENT(120); \
@@ -414,5 +414,5 @@ void MAC_(die_mem_stack_4)(Addr new_ESP)
} \
\
-void MAC_(new_mem_stack_8)(Addr new_ESP) \
+void REGPARM(1) MAC_(new_mem_stack_8)(Addr new_ESP) \
{ \
PROF_EVENT(111); \
@@ -427,5 +427,5 @@ void MAC_(new_mem_stack_8)(Addr new_ESP)
} \
\
-void MAC_(die_mem_stack_8)(Addr new_ESP) \
+void REGPARM(1) MAC_(die_mem_stack_8)(Addr new_ESP) \
{ \
PROF_EVENT(121); \
@@ -440,5 +440,5 @@ void MAC_(die_mem_stack_8)(Addr new_ESP)
} \
\
-void MAC_(new_mem_stack_12)(Addr new_ESP) \
+void REGPARM(1) MAC_(new_mem_stack_12)(Addr new_ESP) \
{ \
PROF_EVENT(112); \
@@ -454,5 +454,5 @@ void MAC_(new_mem_stack_12)(Addr new_ESP
} \
\
-void MAC_(die_mem_stack_12)(Addr new_ESP) \
+void REGPARM(1) MAC_(die_mem_stack_12)(Addr new_ESP) \
{ \
PROF_EVENT(122); \
@@ -469,5 +469,5 @@ void MAC_(die_mem_stack_12)(Addr new_ESP
} \
\
-void MAC_(new_mem_stack_16)(Addr new_ESP) \
+void REGPARM(1) MAC_(new_mem_stack_16)(Addr new_ESP) \
{ \
PROF_EVENT(113); \
@@ -484,5 +484,5 @@ void MAC_(new_mem_stack_16)(Addr new_ESP
} \
\
-void MAC_(die_mem_stack_16)(Addr new_ESP) \
+void REGPARM(1) MAC_(die_mem_stack_16)(Addr new_ESP) \
{ \
PROF_EVENT(123); \
@@ -499,5 +499,5 @@ void MAC_(die_mem_stack_16)(Addr new_ESP
} \
\
-void MAC_(new_mem_stack_32)(Addr new_ESP) \
+void REGPARM(1) MAC_(new_mem_stack_32)(Addr new_ESP) \
{ \
PROF_EVENT(114); \
@@ -518,5 +518,5 @@ void MAC_(new_mem_stack_32)(Addr new_ESP
} \
\
-void MAC_(die_mem_stack_32)(Addr new_ESP) \
+void REGPARM(1) MAC_(die_mem_stack_32)(Addr new_ESP) \
{ \
PROF_EVENT(124); \
|