You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
(11) |
2
(13) |
3
(7) |
|
4
(9) |
5
(23) |
6
(19) |
7
(18) |
8
(2) |
9
(7) |
10
(21) |
|
11
(13) |
12
|
13
(8) |
14
(17) |
15
(19) |
16
(25) |
17
(43) |
|
18
(22) |
19
(12) |
20
(19) |
21
(12) |
22
(9) |
23
(12) |
24
(5) |
|
25
(16) |
26
(25) |
27
(24) |
28
(19) |
29
(26) |
30
(25) |
31
(6) |
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 18:08:19
|
CVS commit by nethercote:
Removed some unnecessary is_kerror() checks.
Fixed nanosleep's formatting.
M +20 -27 vg_syscalls.c 1.109
--- valgrind/coregrind/vg_syscalls.c #1.108:1.109
@@ -3950,8 +3950,6 @@ PRE(mmap2)
POST(mmap2)
{
- if (!VG_(is_kerror)(res)) {
vg_assert(valid_client_addr(res, arg2, tid, "mmap2"));
mmap_segment( (Addr)res, arg2, arg3, arg4, arg5, arg6 * (ULong)VKI_BYTES_PER_PAGE );
- }
}
@@ -4062,5 +4060,4 @@ PRE(mincore)
POST(mincore)
{
- if (!VG_(is_kerror)(res))
VG_TRACK( post_mem_write, arg3, (arg2 + 4096 - 1) / 4096 );
}
@@ -5164,5 +5161,4 @@ PRE(clock_gettime)
POST(clock_gettime)
{
- if (!VG_(is_kerror)(res) && res == 0)
VG_TRACK( post_mem_write, arg2, sizeof(struct timespec) );
}
@@ -5192,5 +5188,4 @@ PRE(futex)
POST(futex)
{
- if (!VG_(is_kerror)(res)) {
VG_TRACK( post_mem_write, arg1, sizeof(int) );
if (arg2 == VKI_FUTEX_FD) {
@@ -5203,5 +5198,4 @@ POST(futex)
}
}
- }
}
@@ -5359,5 +5353,4 @@ PRE(sigpending)
POST(sigpending)
{
- if ( !VG_( is_kerror )( res ) && res == 0 )
VG_TRACK( post_mem_write, arg1, sizeof( vki_ksigset_t ) ) ;
}
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 17:49:26
|
CVS commit by nethercote:
Added assertion checking to a whole bunch of mmap() and munmap() calls. I used
assertions because if these calls fail, it's a bug in Valgrind.
M +18 -11 vg_main.c 1.167
M +2 -1 vg_scheduler.c 1.155
M +11 -4 vg_symtab2.c 1.82
M +2 -1 vg_syscalls.c 1.108
--- valgrind/coregrind/vg_main.c #1.166:1.167
@@ -502,4 +502,7 @@ static void layout_client_space(Addr arg
static void layout_remaining_space(float ratio)
{
+ Int ires;
+ void* vres;
+
/* This tries to give the client as large as possible address space while
* taking into account the tool's shadow needs. */
@@ -543,15 +546,19 @@ static void layout_remaining_space(float
// Ban redzone
- mmap((void *)VG_(client_end), REDZONE_SIZE, PROT_NONE,
+ vres = mmap((void *)VG_(client_end), REDZONE_SIZE, PROT_NONE,
MAP_FIXED|MAP_ANON|MAP_PRIVATE, -1, 0);
+ vg_assert((void*)-1 != vres);
// Make client hole
- munmap((void*)VG_(client_base), client_size);
+ ires = munmap((void*)VG_(client_base), client_size);
+ vg_assert(0 == ires);
// Map shadow memory.
// Initially all inaccessible, incrementally initialized as it is used
- if (shadow_size != 0)
- mmap((char *)VG_(shadow_base), shadow_size, PROT_NONE,
+ if (shadow_size != 0) {
+ vres = mmap((char *)VG_(shadow_base), shadow_size, PROT_NONE,
MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0);
+ vg_assert((void*)-1 != vres);
+ }
}
@@ -981,4 +988,5 @@ static Addr setup_client_stack(char **or
UInt** client_auxv)
{
+ void* res;
char **cpp;
char *strtab; /* string table */
@@ -1067,9 +1075,8 @@ static Addr setup_client_stack(char **or
/* allocate a stack - mmap enough space for the stack */
- mmap((void *)PGROUNDDN(cl_esp),
- VG_(client_end) - PGROUNDDN(cl_esp),
+ res = mmap((void *)PGROUNDDN(cl_esp), VG_(client_end) - PGROUNDDN(cl_esp),
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
-
+ vg_assert((void*)-1 != res);
/* ==================== copy client stack ==================== */
--- valgrind/coregrind/vg_scheduler.c #1.154:1.155
@@ -1940,6 +1940,7 @@ void do__apply_in_new_thread ( ThreadId
VG_(client_free)(VG_(threads)[tid].stack_base);
new_stack = VG_(client_alloc)(0, new_stk_szb,
- VKI_PROT_READ | VKI_PROT_WRITE | VKI_PROT_EXEC,
+ VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC,
SF_STACK);
+ vg_assert(0 != new_stack);
VG_(threads)[tid].stack_base = new_stack;
VG_(threads)[tid].stack_size = new_stk_szb;
--- valgrind/coregrind/vg_symtab2.c #1.81:1.82
@@ -1106,5 +1106,6 @@ Addr open_debug_file( Char* name, UInt c
if (calc_gnu_debuglink_crc32(0, (UChar*)addr, *size) != crc) {
- VG_(munmap)((void*)addr, *size);
+ int res = VG_(munmap)((void*)addr, *size);
+ vg_assert(0 == res);
return 0;
}
@@ -1493,9 +1494,15 @@ Bool vg_read_lib_symbols ( SegInfo* si )
res = True;
- out:
+ out: {
+ Int m_res;
/* Last, but not least, heave the image(s) back overboard. */
- if (dimage) VG_(munmap) ( (void*)dimage, n_dimage );
- VG_(munmap) ( (void*)oimage, n_oimage );
+ if (dimage) {
+ m_res = VG_(munmap) ( (void*)dimage, n_dimage );
+ vg_assert(0 == m_res);
+ }
+ m_res = VG_(munmap) ( (void*)oimage, n_oimage );
+ vg_assert(0 == m_res);
return res;
+ }
}
--- valgrind/coregrind/vg_syscalls.c #1.107:1.108
@@ -999,5 +999,6 @@ static Addr do_brk(Addr newbrk)
if (newaddr != current) {
- VG_(munmap)((void *)newaddr, current - newaddr);
+ int res = VG_(munmap)((void *)newaddr, current - newaddr);
+ vg_assert(0 == res);
}
ret = newbrk;
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 17:36:57
|
CVS commit by nethercote: Format wibble. M +1 -1 vg_mylibc.c 1.79 |
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 17:30:17
|
CVS commit by nethercote:
Format wibble
M +1 -2 vg_syscalls.c 1.107
--- valgrind/coregrind/vg_syscalls.c #1.106:1.107
@@ -2752,6 +2752,5 @@ POST(ipc)
/* we don't distinguish whether it's read-only or
* read-write -- it doesn't matter really. */
- VG_TRACK( new_mem_mmap, addr, segmentSize,
- True, True, False );
+ VG_TRACK( new_mem_mmap, addr, segmentSize, True, True, False );
if (!(shmflag & 010000)) /* = SHM_RDONLY */
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 17:27:28
|
CVS commit by nethercote: Whoops, fix comment. M +1 -1 vg_memory.c 1.57 --- valgrind/coregrind/vg_memory.c #1.56:1.57 @@ -760,5 +760,5 @@ Addr VG_(get_shadow_size)(void) /*--------------------------------------------------------------------*/ -/*--- manage allocation of memory on behalf of the client ---*/ +/*--- Handling shadow memory ---*/ /*--------------------------------------------------------------------*/ |
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 17:22:36
|
CVS commit by nethercote:
Remove out-of-date comment.
M +0 -3 vg_syscalls.c 1.106
--- valgrind/coregrind/vg_syscalls.c #1.105:1.106
@@ -4027,7 +4027,4 @@ POST(mprotect)
Bool xx = prot & VKI_PROT_EXEC;
- // if removing exe permission, should check and remove from exe_seg list
- // if adding, should check and add to exe_seg list
- // easier to ignore both cases -- both v. unlikely?
mash_addr_and_len(&a, &len);
VG_(mprotect_range)(a, len, prot);
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 17:21:27
|
CVS commit by nethercote:
A few changes:
- removed an unnecessary VG_(unmap_range)() call in do_brk() -- the
VG_(munmap)() just before it does it anyway.
- inlined mprotect_segment() and munmap_segment() because it's more concise and
easier to understand that way.
- a couple of minor formatting changes
- added and cleaned up a couple of comments
M +31 -55 vg_syscalls.c 1.105
--- valgrind/coregrind/vg_syscalls.c #1.104:1.105
@@ -216,5 +216,5 @@ void VG_(mash_colon_env)(Char *varp, con
/* ---------------------------------------------------------------------
- Doing mmap, munmap, mremap, mprotect
+ Doing mmap, mremap
------------------------------------------------------------------ */
@@ -268,41 +268,4 @@ void mmap_segment ( Addr a, UInt len, UI
static
-void munmap_segment ( Addr a, UInt len )
-{
- /* Addr orig_a = a;
- Addr orig_len = len; */
-
- mash_addr_and_len(&a, &len);
-
- VG_(unmap_range)(a, len);
-
- /*
- VG_(printf)("MUNMAP: correct (%p for %d) to (%p for %d) %s\n",
- orig_a, orig_len, a, len, (orig_a!=start || orig_len!=length)
- ? "CHANGE" : "");
- */
-
- VG_TRACK( die_mem_munmap, a, len );
-}
-
-static
-void mprotect_segment ( Addr a, UInt len, Int prot )
-{
- Bool rr, ww, xx;
-
- VG_(mprotect_range)(a, len, prot);
-
- rr = prot & VKI_PROT_READ;
- ww = prot & VKI_PROT_WRITE;
- xx = prot & VKI_PROT_EXEC;
-
- // if removing exe permission, should check and remove from exe_seg list
- // if adding, should check and add to exe_seg list
- // easier to ignore both cases -- both v. unlikely?
- mash_addr_and_len(&a, &len);
- VG_TRACK( change_mem_mprotect, a, len, rr, ww, xx );
-}
-
-static
Addr mremap_segment ( Addr old_addr, UInt old_size,
Addr new_addr, UInt new_size,
@@ -1037,5 +1000,4 @@ static Addr do_brk(Addr newbrk)
if (newaddr != current) {
VG_(munmap)((void *)newaddr, current - newaddr);
- VG_(unmap_range)(newaddr, current-newaddr);
}
ret = newbrk;
@@ -1556,4 +1518,6 @@ PRE(madvise)
PRE(mremap)
{
+ // Nb: this is different to the glibc version described in the man pages,
+ // which lacks the fifth 'new_address' argument.
/* void* mremap(void * old_address, size_t old_size,
size_t new_size, unsigned long flags, void * new_address); */
@@ -2785,5 +2749,5 @@ POST(ipc)
UInt segmentSize = get_shm_size ( shmid );
if ( segmentSize > 0 ) {
- UInt prot;
+ UInt prot = VKI_PROT_READ|VKI_PROT_WRITE;
/* we don't distinguish whether it's read-only or
* read-write -- it doesn't matter really. */
@@ -2791,9 +2755,7 @@ POST(ipc)
True, True, False );
- prot = VKI_PROT_READ|VKI_PROT_WRITE;
if (!(shmflag & 010000)) /* = SHM_RDONLY */
prot &= ~VKI_PROT_WRITE;
- VG_(map_segment)(addr, segmentSize, prot,
- SF_SHARED | SF_SHM);
+ VG_(map_segment)(addr, segmentSize, prot, SF_SHARED|SF_SHM);
}
}
@@ -3964,12 +3926,8 @@ PRE(mkdir)
PRE(mmap2)
{
- /* My impression is that this is exactly like __NR_mmap
- except that all 6 args are passed in regs, rather than in
- a memory-block.
-
- Almost. The big difference is that the file offset is specified
- in pagesize units rather than bytes, so that it can be used for
- files bigger than 2^32 bytes. - JSGF
- */
+ // Exactly like __NR_mmap except:
+ // - all 6 args are passed in regs, rather than in a memory-block.
+ // - the file offset is specified in pagesize units rather than bytes,
+ // so that it can be used for files bigger than 2^32 bytes.
/* void* mmap(void *start, size_t length, int prot,
int flags, int fd, off_t offset);
@@ -3983,7 +3941,8 @@ PRE(mmap2)
} else {
arg1 = VG_(find_map_space)(arg1, arg2, True);
- arg4 |= VKI_MAP_FIXED;
if (arg1 == 0)
res = -VKI_ENOMEM;
+ else
+ arg4 |= VKI_MAP_FIXED;
}
}
@@ -4061,5 +4020,17 @@ PRE(mprotect)
POST(mprotect)
{
- mprotect_segment( arg1, arg2, arg3 );
+ Addr a = arg1;
+ UInt len = arg2;
+ Int prot = arg3;
+ Bool rr = prot & VKI_PROT_READ;
+ Bool ww = prot & VKI_PROT_WRITE;
+ Bool xx = prot & VKI_PROT_EXEC;
+
+ // if removing exe permission, should check and remove from exe_seg list
+ // if adding, should check and add to exe_seg list
+ // easier to ignore both cases -- both v. unlikely?
+ mash_addr_and_len(&a, &len);
+ VG_(mprotect_range)(a, len, prot);
+ VG_TRACK( change_mem_mprotect, a, len, rr, ww, xx );
}
@@ -4076,5 +4047,10 @@ PRE(munmap)
POST(munmap)
{
- munmap_segment( arg1, arg2 );
+ Addr a = arg1;
+ UInt len = arg2;
+
+ mash_addr_and_len(&a, &len);
+ VG_(unmap_range)(a, len);
+ VG_TRACK( die_mem_munmap, a, len );
}
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 16:59:33
|
CVS commit by nethercote:
Comment changes only.
M +8 -1 vg_memory.c 1.56
--- valgrind/coregrind/vg_memory.c #1.55:1.56
@@ -673,5 +673,5 @@ Bool VG_(is_addressable)(Addr p, Int siz
/*--------------------------------------------------------------------*/
-/*--- manage allocation of memory on behalf of the client ---*/
+/*--- Manage allocation of memory on behalf of the client ---*/
/*--------------------------------------------------------------------*/
@@ -710,4 +710,8 @@ void VG_(client_free)(Addr addr)
}
+/*--------------------------------------------------------------------*/
+/*--- Querying memory layout ---*/
+/*--------------------------------------------------------------------*/
+
Bool VG_(is_client_addr)(Addr a)
{
@@ -755,4 +759,7 @@ Addr VG_(get_shadow_size)(void)
}
+/*--------------------------------------------------------------------*/
+/*--- manage allocation of memory on behalf of the client ---*/
+/*--------------------------------------------------------------------*/
void VG_(init_shadow_range)(Addr p, UInt sz, Bool call_init)
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 16:57:26
|
CVS commit by nethercote:
Remove out-of-date comment -- should have been removed when VG_(mmap)() was
changed to accept the sf_flags argument.
M +0 -1 vg_memory.c 1.55
--- valgrind/coregrind/vg_memory.c #1.54:1.55
@@ -336,5 +336,4 @@ void VG_(map_file_segment)(Addr addr, UI
if (s != NULL && s->addr == addr && s->len == len) {
- /* This probably means we're just updating the flags */
recycled = True;
recycleseg(s);
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 16:50:17
|
CVS commit by nethercote:
Removed the 'place-holder' behaviour of VG_(mmap). Previously, VG_(mmap) would
add a segment mapping to the segment skip-list, and then often the caller of
VG_(mmap) would do another one for the same segment, just to change the SF_*
flags. Now VG_(mmap) gets passed the appropriate SF_* flags so it can do it
directly. This results in shorter, simpler code, and less work at runtime.
Also, strengthened checking in VG_(mmap), POST(mmap), POST(mmap2) -- now if the
result is not in the right place, it aborts rather than unmapping and
continuing. This is because if it's not in the right place, something has
gone badly wrong.
M +2 -2 vg_include.h 1.200
M +4 -6 vg_memory.c 1.54
M +17 -29 vg_mylibc.c 1.78
M +7 -9 vg_signals.c 1.71
M +5 -2 vg_symtab2.c 1.81
M +9 -16 vg_syscalls.c 1.104
--- valgrind/coregrind/vg_include.h #1.199:1.200
@@ -1151,6 +1151,6 @@ extern Int VG_(nanosleep)( const struct
/* system/mman.h */
-extern void* VG_(mmap)( void* start, UInt length,
- UInt prot, UInt flags, UInt fd, UInt offset );
+extern void* VG_(mmap)( void* start, UInt length, UInt prot, UInt flags,
+ UInt sf_flags, UInt fd, UInt offset );
extern Int VG_(munmap)( void* start, Int length );
extern Int VG_(mprotect)( void *start, Int length, UInt prot );
--- valgrind/coregrind/vg_memory.c #1.53:1.54
@@ -678,9 +678,9 @@ Bool VG_(is_addressable)(Addr p, Int siz
// Returns 0 on failure.
-Addr VG_(client_alloc)(Addr addr, UInt len, UInt prot, UInt flags)
+Addr VG_(client_alloc)(Addr addr, UInt len, UInt prot, UInt sf_flags)
{
len = PGROUNDUP(len);
- if (!(flags & SF_FIXED))
+ if (!(sf_flags & SF_FIXED))
addr = VG_(find_map_space)(addr, len, True);
@@ -689,10 +689,8 @@ Addr VG_(client_alloc)(Addr addr, UInt l
return 0;
- flags |= SF_CORE;
-
if (VG_(mmap)((void *)addr, len, prot,
VKI_MAP_FIXED | VKI_MAP_PRIVATE | VKI_MAP_ANONYMOUS | VKI_MAP_CLIENT,
- -1, 0) == (void *)addr) {
- VG_(map_segment)(addr, len, prot, flags);
+ sf_flags | SF_CORE, -1, 0) == (void *)addr)
+ {
return addr;
}
--- valgrind/coregrind/vg_mylibc.c #1.77:1.78
@@ -266,5 +266,5 @@ static Addr mmap_inner(void *start, UInt
/* Returns -1 on failure. */
void* VG_(mmap)( void* start, UInt length,
- UInt prot, UInt flags, UInt fd, UInt offset)
+ UInt prot, UInt flags, UInt sf_flags, UInt fd, UInt offset)
{
Addr res;
@@ -272,43 +272,31 @@ void* VG_(mmap)( void* start, UInt lengt
if (!(flags & VKI_MAP_FIXED)) {
start = (void *)VG_(find_map_space)((Addr)start, length, !!(flags & VKI_MAP_CLIENT));
- if (start == 0)
- return (void *)-1;
flags |= VKI_MAP_FIXED;
}
+ if (start == 0)
+ return (void *)-1;
res = mmap_inner(start, length, prot, flags, fd, offset);
+ // Check it ended up in the right place.
if (!VG_(is_kerror)(res)) {
- UInt sf_flags = SF_MMAP;
-
- if (flags & VKI_MAP_FIXED)
- sf_flags |= SF_FIXED;
- if (flags & VKI_MAP_SHARED)
- sf_flags |= SF_SHARED;
- if (!(flags & VKI_MAP_ANONYMOUS))
- sf_flags |= SF_FILE;
- if (!(flags & VKI_MAP_CLIENT))
- sf_flags |= SF_VALGRIND;
- if (flags & VKI_MAP_NOSYMS)
- sf_flags |= SF_NOSYMS;
-
- /* placeholder - caller will update flags etc if they want */
- VG_(map_fd_segment)(res, length, prot, sf_flags, fd, offset, NULL);
-
if (flags & VKI_MAP_CLIENT) {
- if (res < VG_(client_base) || res >= VG_(client_end)) {
- VG_(munmap)((void *)res, length);
- res = -1;
- }
+ vg_assert(VG_(client_base) <= res && res+length < VG_(client_end));
} else {
- if (res < VG_(valgrind_base) || res >= VG_(valgrind_end)) {
- VG_(munmap)((void *)res, length);
- res = -1;
- }
+ vg_assert(VG_(valgrind_base) <= res && res+length < VG_(valgrind_end));
}
}
+ if (!VG_(is_kerror)(res)) {
+ sf_flags |= SF_MMAP;
+ if ( flags & VKI_MAP_FIXED) sf_flags |= SF_FIXED;
+ if ( flags & VKI_MAP_SHARED) sf_flags |= SF_SHARED;
+ if (!(flags & VKI_MAP_ANONYMOUS)) sf_flags |= SF_FILE;
+ if (!(flags & VKI_MAP_CLIENT)) sf_flags |= SF_VALGRIND;
+ if ( flags & VKI_MAP_NOSYMS) sf_flags |= SF_NOSYMS;
+ VG_(map_fd_segment)(res, length, prot, sf_flags, fd, offset, NULL);
+ }
return VG_(is_kerror)(res) ? ((void*)(-1)) : (void*)res;
--- valgrind/coregrind/vg_signals.c #1.70:1.71
@@ -2142,13 +2142,11 @@ void vg_sync_signalhandler ( Int sigNo,
*/
Addr base = PGROUNDDN(esp);
- Char *ret = VG_(mmap)((Char *)base, seg->addr - base,
- VKI_PROT_READ | VKI_PROT_WRITE | VKI_PROT_EXEC,
- VKI_MAP_PRIVATE | VKI_MAP_FIXED | VKI_MAP_ANONYMOUS | VKI_MAP_CLIENT,
- -1, 0);
- if ((Addr)ret == base) {
- VG_(map_segment)(base, seg->addr - base,
+ if ((void*)-1 != VG_(mmap)((Char *)base, seg->addr - base,
VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC,
- SF_STACK|SF_GROWDOWN);
- return; /* restart instruction */
+ VKI_MAP_PRIVATE|VKI_MAP_FIXED|VKI_MAP_ANONYMOUS|VKI_MAP_CLIENT,
+ SF_STACK|SF_GROWDOWN,
+ -1, 0))
+ {
+ return; // extension succeeded, restart instruction
}
/* Otherwise fall into normal signal handling */
--- valgrind/coregrind/vg_symtab2.c #1.80:1.81
@@ -1096,5 +1096,7 @@ Addr open_debug_file( Char* name, UInt c
if ((addr = (Addr)VG_(mmap)(NULL, *size, VKI_PROT_READ,
- VKI_MAP_PRIVATE|VKI_MAP_NOSYMS, fd, 0)) == (Addr)-1) {
+ VKI_MAP_PRIVATE|VKI_MAP_NOSYMS,
+ 0, fd, 0)) == (Addr)-1)
+ {
VG_(close)(fd);
return 0;
@@ -1183,5 +1185,6 @@ Bool vg_read_lib_symbols ( SegInfo* si )
oimage = (Addr)VG_(mmap)( NULL, n_oimage,
- VKI_PROT_READ, VKI_MAP_PRIVATE|VKI_MAP_NOSYMS, fd, 0 );
+ VKI_PROT_READ, VKI_MAP_PRIVATE|VKI_MAP_NOSYMS,
+ 0, fd, 0 );
VG_(close)(fd);
--- valgrind/coregrind/vg_syscalls.c #1.103:1.104
@@ -1021,10 +1021,9 @@ static Addr do_brk(Addr newbrk)
if (newaddr == current) {
ret = newbrk;
- } else if (VG_(mmap)((void *)current , newaddr-current,
- VKI_PROT_READ | VKI_PROT_WRITE | VKI_PROT_EXEC,
- VKI_MAP_PRIVATE | VKI_MAP_ANONYMOUS | VKI_MAP_FIXED | VKI_MAP_CLIENT,
- -1, 0) >= 0) {
- VG_(map_segment)(current, newaddr-current, VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC,
- SF_FIXED|SF_BRK);
+ } else if ((void*)-1 != VG_(mmap)((void*)current, newaddr-current,
+ VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC,
+ VKI_MAP_PRIVATE|VKI_MAP_ANONYMOUS|VKI_MAP_FIXED|VKI_MAP_CLIENT,
+ SF_FIXED|SF_BRK, -1, 0))
+ {
ret = newbrk;
}
@@ -3993,8 +3992,5 @@ POST(mmap2)
{
if (!VG_(is_kerror)(res)) {
- if (!valid_client_addr(res, arg2, tid, "mmap2")) {
- VG_(munmap)((void *)res, arg2);
- res = -VKI_ENOMEM;
- } else
+ vg_assert(valid_client_addr(res, arg2, tid, "mmap2"));
mmap_segment( (Addr)res, arg2, arg3, arg4, arg5, arg6 * (ULong)VKI_BYTES_PER_PAGE );
}
@@ -4047,8 +4043,5 @@ PRE(mmap)
if (!VG_(is_kerror)(res)) {
- if (!valid_client_addr(res, a2, tid, "mmap")) {
- VG_(munmap)((void *)res, a2);
- res = -VKI_ENOMEM;
- } else
+ vg_assert(valid_client_addr(res, a2, tid, "mmap"));
mmap_segment( (Addr)res, a2, a3, a4, a5, a6 );
}
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 16:17:57
|
CVS commit by nethercote:
Change allocation failure message which is no longer true thanks to FV.
M +2 -9 vg_mylibc.c 1.77
--- valgrind/coregrind/vg_mylibc.c #1.76:1.77
@@ -1709,13 +1709,6 @@ void* VG_(get_memory_from_mmap) ( Int nB
tot_alloc);
VG_(printf)("\n");
- VG_(printf)("This may mean that you have run out of swap space,\n");
- VG_(printf)("since running programs on valgrind increases their memory\n");
- VG_(printf)("usage at least 3 times. You might want to use 'top'\n");
- VG_(printf)("to determine whether you really have run out of swap.\n");
- VG_(printf)("If so, you may be able to work around it by adding a\n");
- VG_(printf)("temporary swap file -- this is easier than finding a\n");
- VG_(printf)("new swap partition. Go ask your sysadmin(s) [politely!]\n");
- VG_(printf)("\n");
- VG_(printf)("VG_(get_memory_from_mmap): out of memory! Fatal! Bye!\n");
+ VG_(printf)("Sorry. You could try using a tool that uses less memory;\n");
+ VG_(printf)("eg. addrcheck instead of memcheck.\n");
VG_(printf)("\n");
VG_(exit)(1);
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 16:11:05
|
CVS commit by nethercote: Minor Makefile.am fix (doesn't actually change behaviour, because automake's default rules meant 'execve' was being built anyway... but the fix at least avoids confusion). M +1 -1 Makefile.am 1.41 --- valgrind/none/tests/Makefile.am #1.40:1.41 @@ -92,5 +92,5 @@ discard_SOURCES = discard.c exec_sigmask_SOURCES = exec-sigmask.c -execve = execve.c +execve_SOURCES = execve.c fork_SOURCES = fork.c floored_SOURCES = floored.c |
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 16:01:58
|
CVS commit by nethercote:
Don't force tool redzones to be multiples of 8.
M +2 -2 coregrind/vg_default.c 1.22
M +1 -2 coregrind/vg_malloc2.c 1.26
M +1 -1 helgrind/hg_main.c 1.79
--- valgrind/coregrind/vg_default.c #1.21:1.22
@@ -67,7 +67,7 @@ void malloc_panic ( const Char* fn )
/*------------------------------------------------------------*/
-/* Default redzone for CLIENT arena of Valgrind's malloc() is 4 bytes */
+/* Default redzone size for CLIENT arena of Valgrind's malloc() */
__attribute__ ((weak))
-UInt VG_(vg_malloc_redzone_szB) = 4;
+UInt VG_(vg_malloc_redzone_szB) = 8;
Bool VG_(sk_malloc_called_by_scheduler) = False;
--- valgrind/coregrind/vg_malloc2.c #1.25:1.26
@@ -252,5 +252,5 @@ void ensure_mm_init ( void )
if (init_done) return;
- /* Use a checked red zone size of 1 word for our internal stuff,
+ /* Use checked red zones (of various sizes) for our internal stuff,
and an unchecked zone of arbitrary size for the client. Of
course the client's red zone can be checked by the tool, eg.
@@ -271,5 +271,4 @@ void ensure_mm_init ( void )
sk_assert(VG_(vg_malloc_redzone_szB) >= 0);
client_rz_szW = VG_(vg_malloc_redzone_szB)/4;
- if (client_rz_szW % 2 == 1) client_rz_szW++;
arena_init ( &vg_arena[VG_AR_CLIENT], "client",
--- valgrind/helgrind/hg_main.c #1.78:1.79
@@ -1809,5 +1809,5 @@ static HG_Chunk *freechunks[N_FREED_CHUN
/* Use a small redzone (paranoia) */
-UInt VG_(vg_malloc_redzone_szB) = 4;
+UInt VG_(vg_malloc_redzone_szB) = 8;
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 14:56:39
|
CVS commit by nethercote:
Fix for bug #78048.
Problem was that the malloc-replacing tools (memcheck, addrcheck, massif,
helgrind) would assert if a too-big malloc was attempted. Now they return 0 to
the client. I also cleaned up the code handling heap-block-metadata in Massif
and Addrcheck/Memcheck a little.
This exposed a nasty bug in VG_(client_alloc)() which wasn't checking if
find_map_space() was succeeding before attempting an mmap(). Before I added
the check, very big mallocs (eg 2GB) for Addrcheck were overwriting the client
space at address 0 and causing crashes.
Added a regtest to all the affected skins for this.
A addrcheck/tests/toobig-allocs.stderr.exp 1.1
A addrcheck/tests/toobig-allocs.vgtest 1.1
A helgrind/tests/toobig-allocs.stderr.exp 1.1
A helgrind/tests/toobig-allocs.vgtest 1.1
A massif/tests/toobig-allocs.stderr.exp 1.1
A massif/tests/toobig-allocs.vgtest 1.1
A memcheck/tests/toobig-allocs.stderr.exp 1.1
A memcheck/tests/toobig-allocs.vgtest 1.1
A tests/toobig-allocs.c 1.1 [POSSIBLY UNSAFE: printf] [no copyright]
M +3 -1 addrcheck/tests/Makefile.am 1.9
M +14 -3 coregrind/vg_malloc2.c 1.25
M +5 -0 coregrind/vg_memory.c 1.53
M +3 -0 helgrind/hg_main.c 1.78
M +2 -1 helgrind/tests/Makefile.am 1.8
M +38 -44 massif/ms_main.c 1.12
M +1 -0 massif/tests/Makefile.am 1.2
M +35 -46 memcheck/mac_malloc_wrappers.c 1.13
M +2 -2 memcheck/mac_needs.c 1.29
M +3 -3 memcheck/mac_shared.h 1.20
M +1 -0 memcheck/tests/Makefile.am 1.37
M +1 -0 tests/.cvsignore 1.5
M +6 -4 tests/Makefile.am 1.36
--- valgrind/addrcheck/tests/Makefile.am #1.8:1.9
@@ -10,3 +10,5 @@
$(addsuffix .stdout.exp,$(INSN_TESTS)) \
$(addsuffix .vgtest,$(INSN_TESTS)) \
- overlap.stderr.exp overlap.stdout.exp overlap.vgtest
+ overlap.stderr.exp overlap.stdout.exp overlap.vgtest \
+ toobig-allocs.stderr.exp toobig-allocs.vgtest
+
--- valgrind/coregrind/vg_malloc2.c #1.24:1.25
@@ -327,10 +327,16 @@ Superblock* newSuperblock ( Arena* a, In
if (a->clientmem) {
+ // client allocation -- return 0 to client if it fails
sb = (Superblock *)
VG_(client_alloc)(0, cszW * sizeof(Word),
VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC, 0);
- } else
+ if (NULL == sb) {
+ return 0;
+ }
+ } else {
+ // non-client allocation -- abort if it fails
sb = VG_(get_memory_from_mmap) ( cszW * sizeof(Word),
"newSuperblock" );
+ }
sb->n_payload_words = cszW - 2;
a->bytes_mmaped += cszW * sizeof(Word);
@@ -1024,5 +1030,10 @@ void* VG_(arena_malloc) ( ArenaId aid, I
req_bszW = pszW_to_bszW(a, req_pszW);
new_sb = newSuperblock(a, req_bszW);
- vg_assert(new_sb != NULL);
+ if (NULL == new_sb) {
+ // Should only fail if for client, otherwise, should have aborted
+ // already.
+ vg_assert(VG_AR_CLIENT == aid);
+ return NULL;
+ }
new_sb->next = a->sblocks;
a->sblocks = new_sb;
--- valgrind/coregrind/vg_memory.c #1.52:1.53
@@ -677,4 +677,5 @@ Bool VG_(is_addressable)(Addr p, Int siz
/*--------------------------------------------------------------------*/
+// Returns 0 on failure.
Addr VG_(client_alloc)(Addr addr, UInt len, UInt prot, UInt flags)
{
@@ -684,4 +685,8 @@ Addr VG_(client_alloc)(Addr addr, UInt l
addr = VG_(find_map_space)(addr, len, True);
+ // Don't do the mapping if we couldn't find space!
+ if (0 == addr)
+ return 0;
+
flags |= SF_CORE;
--- valgrind/helgrind/hg_main.c #1.77:1.78
@@ -1839,4 +1839,7 @@ void* alloc_and_new_mem ( Int size, UInt
p = (Addr)VG_(cli_malloc)(alignment, size);
+ if (!p) {
+ return NULL;
+ }
if (is_zeroed) VG_(memset)((void*)p, 0, size);
add_HG_Chunk ( VG_(get_current_or_recent_tid)(), p, size );
--- valgrind/helgrind/tests/Makefile.am #1.7:1.8
@@ -12,5 +12,6 @@
race.stderr.exp race.vgtest \
race2.stderr.exp race2.vgtest \
- readshared.stderr.exp readshared.vgtest
+ readshared.stderr.exp readshared.vgtest \
+ toobig-allocs.stderr.exp toobig-allocs.vgtest
check_PROGRAMS = \
--- valgrind/massif/ms_main.c #1.11:1.12
@@ -665,25 +665,36 @@ static void hp_census(void);
static __inline__
-void new_block_meta ( void* p, Int size, Bool custom_malloc )
+void* new_block ( void* p, Int size, UInt align, Bool is_zeroed )
{
HP_Chunk* hc;
+ Bool custom_alloc = (NULL == p);
+ if (size < 0) return NULL;
VGP_PUSHCC(VgpCliMalloc);
+ // Update statistics
+ n_allocs++;
if (0 == size) n_zero_allocs++;
+ // Allocate and zero if necessary
+ if (!p) {
+ p = VG_(cli_malloc)( align, size );
+ if (!p) {
+ VGP_POPCC(VgpCliMalloc);
+ return NULL;
+ }
+ if (is_zeroed) VG_(memset)(p, 0, size);
+ }
+
// Make new HP_Chunk node, add to malloclist
hc = VG_(malloc)(sizeof(HP_Chunk));
hc->size = size;
hc->data = (Addr)p;
-
+ hc->where = NULL; // paranoia
if (clo_heap) {
- hc->where = get_XCon( VG_(get_current_or_recent_tid)(), custom_malloc );
- if (size != 0)
+ hc->where = get_XCon( VG_(get_current_or_recent_tid)(), custom_alloc );
+ if (0 != size)
update_XCon(hc->where, size);
- } else {
- hc->where = NULL; // paranoia
}
-
add_HP_Chunk( hc );
@@ -688,24 +699,6 @@ void new_block_meta ( void* p, Int size,
add_HP_Chunk( hc );
- hp_census(); // do a census!
-
- VGP_POPCC(VgpCliMalloc);
-}
-
-static __inline__
-void* new_block ( Int size, UInt align, Bool is_zeroed )
-{
- void* p;
-
- if (size < 0) return NULL;
-
- VGP_PUSHCC(VgpCliMalloc);
-
- // Update statistics
- n_allocs++;
-
- p = VG_(cli_malloc)( align, size );
- if (is_zeroed) VG_(memset)(p, 0, size);
- new_block_meta(p, size, /*custom_malloc*/False);
+ // do a census!
+ hp_census();
VGP_POPCC(VgpCliMalloc);
@@ -716,6 +709,5 @@ static __inline__
void die_block ( void* p, Bool custom_free )
{
- HP_Chunk* hc;
- HP_Chunk** remove_handle;
+ HP_Chunk *hc, **remove_handle;
VGP_PUSHCC(VgpCliMalloc);
@@ -724,5 +716,6 @@ void die_block ( void* p, Bool custom_fr
n_frees++;
- hc = get_HP_Chunk ( p, &remove_handle );
+ // Remove HP_Chunk from malloclist
+ hc = get_HP_Chunk( p, &remove_handle );
if (hc == NULL)
return; // must have been a bogus free(), or p==NULL
@@ -727,20 +720,19 @@ void die_block ( void* p, Bool custom_fr
if (hc == NULL)
return; // must have been a bogus free(), or p==NULL
-
sk_assert(hc->data == (Addr)p);
+ remove_HP_Chunk(hc, remove_handle);
if (clo_heap && hc->size != 0)
update_XCon(hc->where, -hc->size);
- // Actually free the heap block
+ VG_(free)( hc );
+
+ // Actually free the heap block, if necessary
if (!custom_free)
VG_(cli_free)( p );
- // Remove HP_Chunk from malloclist, destroy
- remove_HP_Chunk(hc, remove_handle);
-
- hp_census(); // do a census!
+ // do a census!
+ hp_census();
- VG_(free)( hc );
VGP_POPCC(VgpCliMalloc);
}
@@ -749,25 +741,25 @@ void die_block ( void* p, Bool custom_fr
void* SK_(malloc) ( Int n )
{
- return new_block( n, VG_(clo_alignment), /*is_zeroed*/False );
+ return new_block( NULL, n, VG_(clo_alignment), /*is_zeroed*/False );
}
void* SK_(__builtin_new) ( Int n )
{
- return new_block( n, VG_(clo_alignment), /*is_zeroed*/False );
+ return new_block( NULL, n, VG_(clo_alignment), /*is_zeroed*/False );
}
void* SK_(__builtin_vec_new) ( Int n )
{
- return new_block( n, VG_(clo_alignment), /*is_zeroed*/False );
+ return new_block( NULL, n, VG_(clo_alignment), /*is_zeroed*/False );
}
void* SK_(calloc) ( Int m, Int size )
{
- return new_block( m*size, VG_(clo_alignment), /*is_zeroed*/True );
+ return new_block( NULL, m*size, VG_(clo_alignment), /*is_zeroed*/True );
}
void *SK_(memalign)( Int align, Int n )
{
- return new_block( n, align, False );
+ return new_block( NULL, n, align, False );
}
@@ -1134,8 +1126,10 @@ Bool SK_(handle_client_request) ( Thread
switch (argv[0]) {
case VG_USERREQ__MALLOCLIKE_BLOCK: {
+ void* res;
void* p = (void*)argv[1];
UInt sizeB = argv[2];
*ret = 0;
- new_block_meta( p, sizeB, /*custom_malloc*/True );
+ res = new_block( p, sizeB, /*align -- ignored*/0, /*is_zeroed*/False );
+ sk_assert(res == p);
return True;
}
--- valgrind/massif/tests/Makefile.am #1.1:1.2
@@ -2,4 +2,5 @@
EXTRA_DIST = $(noinst_SCRIPTS) \
+ toobig-allocs.stderr.exp toobig-allocs.vgtest \
true_html.stderr.exp true_html.vgtest \
true_text.stderr.exp true_text.vgtest
--- valgrind/memcheck/mac_malloc_wrappers.c #1.12:1.13
@@ -133,6 +133,5 @@ MAC_Chunk* MAC_(first_matching_freed_MAC
/* Allocate its shadow chunk, put it on the appropriate list. */
static
-MAC_Chunk* add_MAC_Chunk ( Addr p, UInt size, MAC_AllocKind kind,
- VgHashTable table)
+void add_MAC_Chunk ( Addr p, UInt size, MAC_AllocKind kind, VgHashTable table)
{
MAC_Chunk* mc;
@@ -154,6 +153,4 @@ MAC_Chunk* add_MAC_Chunk ( Addr p, UInt
VG_(HT_add_node)( table, (VgHashNode*)mc );
-
- return mc;
}
@@ -164,12 +161,8 @@ MAC_Chunk* add_MAC_Chunk ( Addr p, UInt
/* Allocate memory and note change in memory available */
__inline__
-MAC_Chunk* MAC_(new_block) ( Addr p, UInt size,
- UInt rzB, Bool is_zeroed, MAC_AllocKind kind,
- VgHashTable table)
+void* MAC_(new_block) ( Addr p, UInt size, UInt align, UInt rzB,
+ Bool is_zeroed, MAC_AllocKind kind, VgHashTable table)
{
- MAC_Chunk *mc;
-
VGP_PUSHCC(VgpCliMalloc);
-
cmalloc_n_mallocs ++;
cmalloc_bs_mallocd += size;
@@ -175,5 +168,18 @@ MAC_Chunk* MAC_(new_block) ( Addr p, UIn
cmalloc_bs_mallocd += size;
- mc = add_MAC_Chunk( p, size, kind, table );
+ // Allocate and zero if necessary
+ if (p) {
+ sk_assert(MAC_AllocCustom == kind);
+ } else {
+ sk_assert(MAC_AllocCustom != kind);
+ p = (Addr)VG_(cli_malloc)( align, size );
+ if (!p) {
+ VGP_POPCC(VgpCliMalloc);
+ return NULL;
+ }
+ if (is_zeroed) VG_(memset)((void*)p, 0, size);
+ }
+
+ add_MAC_Chunk( p, size, kind, table );
MAC_(ban_mem_heap)( p-rzB, rzB );
@@ -183,5 +189,5 @@ MAC_Chunk* MAC_(new_block) ( Addr p, UIn
VGP_POPCC(VgpCliMalloc);
- return mc;
+ return (void*)p;
}
@@ -192,9 +198,7 @@ void* SK_(malloc) ( Int n )
return NULL;
} else {
- Addr p = (Addr)VG_(cli_malloc)( VG_(clo_alignment), n );
- MAC_(new_block) ( p, n, VG_(vg_malloc_redzone_szB),
- /*is_zeroed*/False, MAC_AllocMalloc,
+ return MAC_(new_block) ( 0, n, VG_(clo_alignment),
+ VG_(vg_malloc_redzone_szB), /*is_zeroed*/False, MAC_AllocMalloc,
MAC_(malloc_list));
- return (void*)p;
}
}
@@ -206,9 +210,7 @@ void* SK_(__builtin_new) ( Int n )
return NULL;
} else {
- Addr p = (Addr)VG_(cli_malloc)( VG_(clo_alignment), n );
- MAC_(new_block) ( p, n, VG_(vg_malloc_redzone_szB),
- /*is_zeroed*/False, MAC_AllocNew,
+ return MAC_(new_block) ( 0, n, VG_(clo_alignment),
+ VG_(vg_malloc_redzone_szB), /*is_zeroed*/False, MAC_AllocNew,
MAC_(malloc_list));
- return (void*)p;
}
}
@@ -221,9 +223,7 @@ void* SK_(__builtin_vec_new) ( Int n )
return NULL;
} else {
- Addr p = (Addr)VG_(cli_malloc)( VG_(clo_alignment), n );
- MAC_(new_block) ( p, n, VG_(vg_malloc_redzone_szB),
- /*is_zeroed*/False, MAC_AllocNewVec,
+ return MAC_(new_block) ( 0, n, VG_(clo_alignment),
+ VG_(vg_malloc_redzone_szB), /*is_zeroed*/False, MAC_AllocNewVec,
MAC_(malloc_list));
- return (void*)p;
}
}
@@ -235,9 +235,7 @@ void* SK_(memalign) ( Int align, Int n )
return NULL;
} else {
- Addr p = (Addr)VG_(cli_malloc)( align, n );
- MAC_(new_block) ( p, n, VG_(vg_malloc_redzone_szB),
- /*is_zeroed*/False, MAC_AllocMalloc,
+ return MAC_(new_block) ( 0, n, align,
+ VG_(vg_malloc_redzone_szB), /*is_zeroed*/False, MAC_AllocMalloc,
MAC_(malloc_list));
- return (void*)p;
}
}
@@ -245,8 +243,4 @@ void* SK_(memalign) ( Int align, Int n )
void* SK_(calloc) ( Int nmemb, Int size1 )
{
- Int n, i;
-
- n = nmemb * size1;
-
if (nmemb < 0 || size1 < 0) {
VG_(message)(Vg_UserMsg, "Warning: silly args (%d,%d) to calloc()",
@@ -254,11 +248,7 @@ void* SK_(calloc) ( Int nmemb, Int size1
return NULL;
} else {
- Addr p = (Addr)VG_(cli_malloc)( VG_(clo_alignment), n );
- MAC_(new_block) ( p, n, VG_(vg_malloc_redzone_szB),
- /*is_zeroed*/True, MAC_AllocMalloc,
+ return MAC_(new_block) ( 0, nmemb*size1, VG_(clo_alignment),
+ VG_(vg_malloc_redzone_szB), /*is_zeroed*/True, MAC_AllocMalloc,
MAC_(malloc_list));
- for (i = 0; i < n; i++)
- ((UChar*)p)[i] = 0;
- return (void*)p;
}
}
@@ -480,5 +470,4 @@ void MAC_(mempool_alloc)(Addr pool, Addr
MAC_Mempool* mp;
MAC_Mempool** prev_next;
- MAC_Chunk* mc;
mp = (MAC_Mempool*)VG_(HT_get_node) ( MAC_(mempool_list), (UInt)pool,
@@ -492,6 +481,6 @@ void MAC_(mempool_alloc)(Addr pool, Addr
}
- mc = MAC_(new_block)(addr, size, mp->rzB, mp->is_zeroed, MAC_AllocCustom,
- mp->chunks);
+ MAC_(new_block)(addr, size, /*ignored*/0, mp->rzB, mp->is_zeroed,
+ MAC_AllocCustom, mp->chunks);
}
--- valgrind/memcheck/mac_needs.c #1.28:1.29
@@ -881,6 +881,6 @@ Bool MAC_(handle_common_client_requests)
Bool is_zeroed = (Bool)arg[4];
- MAC_(new_block) ( p, sizeB, rzB, is_zeroed, MAC_AllocCustom,
- MAC_(malloc_list) );
+ MAC_(new_block) ( p, sizeB, /*ignored*/0, rzB, is_zeroed,
+ MAC_AllocCustom, MAC_(malloc_list) );
return True;
}
--- valgrind/memcheck/mac_shared.h #1.19:1.20
@@ -318,5 +318,5 @@ extern void MAC_(clear_MAC_Error)
extern Bool MAC_(shared_recognised_suppression) ( Char* name, Supp* su );
-extern MAC_Chunk* MAC_(new_block) ( Addr p, UInt size, UInt rzB,
+extern void* MAC_(new_block) ( Addr p, UInt size, UInt align, UInt rzB,
Bool is_zeroed, MAC_AllocKind kind,
VgHashTable table);
--- valgrind/memcheck/tests/Makefile.am #1.36:1.37
@@ -65,4 +65,5 @@
supp.supp \
suppfree.stderr.exp suppfree.vgtest \
+ toobig-allocs.stderr.exp toobig-allocs.vgtest \
trivialleak.stderr.exp trivialleak.vgtest \
tronical.stderr.exp tronical.vgtest \
--- valgrind/tests/.cvsignore #1.4:1.5
@@ -3,3 +3,4 @@
cputest
vg_regtest
+toobig-allocs
true
--- valgrind/tests/Makefile.am #1.35:1.36
@@ -13,6 +13,7 @@
check_PROGRAMS = \
- true \
- cputest
+ cputest \
+ toobig-allocs \
+ true
AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g
@@ -20,5 +21,6 @@
# generic C ones
-true_SOURCES = true.c
-cputest_SOURCES = cputest.c
+cputest_SOURCES = cputest.c
+toobig_allocs_SOURCES = toobig-allocs.c
+true_SOURCES = true.c
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 13:57:14
|
CVS commit by nethercote:
Fixed --sloppy-malloc and --trace-malloc, debugging options that I broke a
while back (sorry).
M +2 -2 vg_malloc2.c 1.24
--- valgrind/coregrind/vg_malloc2.c #1.23:1.24
@@ -67,6 +67,6 @@ Bool VG_(replacement_malloc_process_cmd_
}
- else VG_BOOL_CLO("--sloppy-malloc=yes", VG_(clo_sloppy_malloc))
- else VG_BOOL_CLO("--trace-malloc=yes", VG_(clo_trace_malloc))
+ else VG_BOOL_CLO("--sloppy-malloc", VG_(clo_sloppy_malloc))
+ else VG_BOOL_CLO("--trace-malloc", VG_(clo_trace_malloc))
else
return False;
|
|
From: <js...@ac...> - 2004-07-10 03:02:12
|
Nightly build on nemesis ( SuSE 9.1 ) started at 2004-07-10 03:50:00 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow memcheck/tests/null_socket (stderr) memcheck/tests/overlap (stderr) memcheck/tests/pth_once (stderr) memcheck/tests/pushfpopf (stderr) memcheck/tests/realloc1 (stderr) memcheck/tests/realloc2 (stderr) memcheck/tests/realloc3 (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/signal2 (stderr) memcheck/tests/supp1 (stderr) memcheck/tests/supp2 (stderr) memcheck/tests/suppfree (stderr) memcheck/tests/threadederrno (stderr) memcheck/tests/trivialleak (stderr) memcheck/tests/tronical (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/writev (stderr) memcheck/tests/zeropage (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <to...@co...> - 2004-07-10 02:26:14
|
Nightly build on dunsmere ( Fedora Core 2 ) started at 2004-07-10 03:20:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 169 tests, 7 stderr failures, 1 stdout failure ================= corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_socketpair (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/execve (stderr) memcheck/tests/writev (stderr) none/tests/exec-sigmask (stdout) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-07-10 02:19:23
|
Nightly build on audi ( Red Hat 9 ) started at 2004-07-10 03:15:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow shortpush: valgrind ./shortpush shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 169 tests, 7 stderr failures, 0 stdout failures ================= corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_socketpair (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/execve (stderr) memcheck/tests/writev (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-07-10 02:13:17
|
Nightly build on ginetta ( Red Hat 8.0 ) started at 2004-07-10 03:10:03 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow sem: valgrind ./sem semlimit: valgrind ./semlimit sha1_test: valgrind ./sha1_test shortpush: valgrind ./shortpush shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 169 tests, 4 stderr failures, 0 stdout failures ================= helgrind/tests/deadlock (stderr) helgrind/tests/race (stderr) helgrind/tests/race2 (stderr) memcheck/tests/writev (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-07-10 02:08:19
|
Nightly build on alvis ( Red Hat 7.3 ) started at 2004-07-10 03:05:03 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow sha1_test: valgrind ./sha1_test shortpush: valgrind ./shortpush shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 169 tests, 5 stderr failures, 1 stdout failure ================= memcheck/tests/badfree-2trace (stderr) memcheck/tests/badjump (stderr) memcheck/tests/brk (stderr) memcheck/tests/error_counts (stdout) memcheck/tests/new_nothrow (stderr) memcheck/tests/writev (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-07-10 02:07:07
|
Nightly build on standard ( Red Hat 7.2 ) started at 2004-07-10 03:00:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow resolv: valgrind ./resolv rlimit_nofile: valgrind ./rlimit_nofile seg_override: valgrind ./seg_override sem: valgrind ./sem semlimit: valgrind ./semlimit sha1_test: valgrind ./sha1_test shortpush: valgrind ./shortpush shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 169 tests, 1 stderr failure, 0 stdout failures ================= memcheck/tests/badfree-2trace (stderr) make: *** [regtest] Error 1 |