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
(5) |
2
(3) |
|
3
(2) |
4
(3) |
5
(16) |
6
(8) |
7
(6) |
8
(2) |
9
(4) |
|
10
(10) |
11
(22) |
12
(7) |
13
(10) |
14
(11) |
15
(8) |
16
(6) |
|
17
(11) |
18
|
19
(6) |
20
(8) |
21
(5) |
22
(11) |
23
(6) |
|
24
(1) |
25
(6) |
26
(4) |
27
(2) |
28
(1) |
29
|
30
(2) |
|
31
(5) |
|
|
|
|
|
|
|
From: <sv...@va...> - 2015-05-09 23:32:21
|
Author: rhyskidd
Date: Sun May 10 00:32:13 2015
New Revision: 15198
Log:
Use fxsave64 and fxrstor64 mnemonics instead of old-school rex64 prefix
bz#339636
Before:
== 591 tests, 232 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==
After:
== 591 tests, 232 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==
Modified:
trunk/NEWS
trunk/memcheck/tests/amd64/fxsave-amd64.c
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sun May 10 00:32:13 2015
@@ -87,6 +87,7 @@
339288 support Cavium Octeon MIPS specific BBIT*32 instructions
339442 Fix testsuite build failure on OS X 10.9
339542 Enable compilation with Intel's ICC compiler
+339636 Use fxsave64 and fxrstor64 mnemonics instead of old-school rex64 prefix
339688 Mac-specific ASM does not support .version directive (cpuid,
tronical and pushfpopf tests)
339745 Valgrind crash when check Marmalade app (partial fix)
Modified: trunk/memcheck/tests/amd64/fxsave-amd64.c
==============================================================================
--- trunk/memcheck/tests/amd64/fxsave-amd64.c (original)
+++ trunk/memcheck/tests/amd64/fxsave-amd64.c Sun May 10 00:32:13 2015
@@ -17,7 +17,11 @@
__attribute__((noinline))
void do_fxsave ( void* p, int rexw ) {
if (rexw) {
+#if defined(VGO_linux)
+ asm __volatile__("fxsave64 (%0)" : : "r" (p) : "memory" );
+#else
asm __volatile__("rex64/fxsave (%0)" : : "r" (p) : "memory" );
+#endif
} else {
asm __volatile__("fxsave (%0)" : : "r" (p) : "memory" );
}
@@ -26,7 +30,11 @@
__attribute__((noinline))
void do_fxrstor ( void* p, int rexw ) {
if (rexw) {
+#if defined(VGO_linux)
+ asm __volatile__("fxrstor64 (%0)" : : "r" (p) : "memory" );
+#else
asm __volatile__("rex64/fxrstor (%0)" : : "r" (p) : "memory" );
+#endif
} else {
asm __volatile__("fxrstor (%0)" : : "r" (p) : "memory" );
}
|
Author: florian
Date: Sat May 9 23:14:43 2015
New Revision: 15197
Log:
Make the return value of VG_(am_extend_client_stack) consistent with
VG_(am_resize_client_dataseg).
Modified:
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
branches/ASPACEM_TWEAKS/coregrind/m_signals.c
branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h
branches/ASPACEM_TWEAKS/none/tests/linux/stack-overflow.stderr.exp
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c Sat May 9 23:14:43 2015
@@ -3066,16 +3066,14 @@
/* Extend the client stack such that ADDR is mapped. Unless ADDR is already
- mapped in which case nothing happens. If the function fails, it returns
- an error and provides the address to which the stack should have been
- extended. OVERFLOW indicates whether this failure was due to an overflow
- or some other cause. */
-SysRes VG_(am_extend_client_stack) ( Addr addr, Bool *overflow )
+ mapped in which case nothing happens. Return an error if the stack could
+ not be extended. A +1 error code means "overflow" and 0 means some other
+ failure. */
+SysRes VG_(am_extend_client_stack) ( Addr addr, Addr *new_stack_base )
{
SizeT udelta;
SysRes sres = VG_(mk_SysRes_Success)(0);
-
- *overflow = False;
+ Bool overflow = False;
/* Get the segment containing addr. */
const NSegment *seg = VG_(am_find_nsegment)(addr);
@@ -3085,22 +3083,27 @@
because although it tests whether the segment is mapped
_somehow_, it doesn't check that it has the right permissions
(r,w, maybe x) ? */
- if (seg->kind == SkAnonC)
+ if (seg->kind == SkAnonC) {
/* ADDR is already mapped. Nothing to do. */
+ *new_stack_base = seg->start; // not really "new" :)
return sres;
+ }
const NSegment *anon_seg = VG_(am_next_nsegment)(seg, True/*fwds*/);
vg_assert(anon_seg != NULL);
udelta = VG_PGROUNDUP(anon_seg->start - addr);
+ *new_stack_base = anon_seg->start - udelta;
VG_(debugLog)(1, "signals",
"extending a stack base 0x%lx down by %lu\n",
anon_seg->start, udelta);
if (! VG_(am_extend_into_adjacent_reservation_client)
- ( anon_seg->start, -(SSizeT)udelta, overflow )) {
- Addr new_stack_base = anon_seg->start - udelta;
- sres = VG_(mk_SysRes_Error)(new_stack_base);
+ ( anon_seg->start, -(SSizeT)udelta, &overflow )) {
+ if (overflow)
+ sres = VG_(mk_SysRes_Error)(1);
+ else
+ sres = VG_(mk_SysRes_Error)(0);
}
return sres;
}
Modified: branches/ASPACEM_TWEAKS/coregrind/m_signals.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_signals.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_signals.c Sat May 9 23:14:43 2015
@@ -2275,15 +2275,16 @@
*/
Bool VG_(extend_stack)(ThreadId tid, Addr addr)
{
- Bool overflow;
- SysRes sres = VG_(am_extend_client_stack)(addr, &overflow);
+ Addr new_stack_base;
+ SysRes sres = VG_(am_extend_client_stack)(addr, &new_stack_base);
if (sr_isError(sres)) {
- Addr new_stack_base = sr_Err(sres);
- if (overflow)
+ if (sr_Err(sres) == 1) {
VG_(umsg)("Stack overflow in thread #%d: can't grow stack to %#lx\n",
tid, new_stack_base);
- else
+ VG_(umsg)("Increasing the size of the main thread stack with "
+ "--main-stacksize=<number> might help\n");
+ } else
VG_(umsg)("Cannot map memory to grow the stack for thread #%d "
"to %#lx\n", tid, new_stack_base);
return False;
Modified: branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h (original)
+++ branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h Sat May 9 23:14:43 2015
@@ -316,7 +316,7 @@
extern SysRes VG_(am_alloc_extensible_client_stack) ( Addr stack_end,
SizeT max_size,
UInt prot );
-extern SysRes VG_(am_extend_client_stack) ( Addr addr, Bool *overflow );
+extern SysRes VG_(am_extend_client_stack) ( Addr addr, Addr *new_stack_base );
//--------------------------------------------------------------
// Valgrind (non-client) thread stacks. V itself runs on such
Modified: branches/ASPACEM_TWEAKS/none/tests/linux/stack-overflow.stderr.exp
==============================================================================
--- branches/ASPACEM_TWEAKS/none/tests/linux/stack-overflow.stderr.exp (original)
+++ branches/ASPACEM_TWEAKS/none/tests/linux/stack-overflow.stderr.exp Sat May 9 23:14:43 2015
@@ -1,9 +1,11 @@
Stack overflow in thread #1: can't grow stack to 0x........
+Increasing the size of the main thread stack with --main-stacksize=<number> might help
Process terminating with default action of signal 11 (SIGSEGV)
Access not within mapped region at address 0x........
Stack overflow in thread #1: can't grow stack to 0x........
+Increasing the size of the main thread stack with --main-stacksize=<number> might help
at 0x........: main (stack-overflow.c:5)
If you believe this happened as a result of a stack
overflow in your program's main thread (unlikely but
|
|
From: <sv...@va...> - 2015-05-09 21:47:45
|
Author: florian
Date: Sat May 9 22:47:38 2015
New Revision: 15196
Log:
Fix a typo.
Modified:
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c Sat May 9 22:47:38 2015
@@ -2965,7 +2965,7 @@
}
/* Resize the client brk segment from OLDBRK to NEWBRK. Return an error if
- the resize operation could not be completed. A +1 error core means
+ the resize operation could not be completed. A +1 error code means
"overflow", a -1 error code means "underflow", and 0 means some other
failure. */
SysRes VG_(am_resize_client_dataseg) ( Addr oldbrk, Addr newbrk )
|
|
From: <sv...@va...> - 2015-05-09 21:28:34
|
Author: florian
Date: Sat May 9 22:28:24 2015
New Revision: 15195
Log:
New function VG_(am_resize_client_dataseg) to hide the implementation
details of the brk segment.
Improve memcheck/tests/linux/brk.c testcase.
Modified:
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
branches/ASPACEM_TWEAKS/coregrind/m_syswrap/syswrap-generic.c
branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h
branches/ASPACEM_TWEAKS/memcheck/tests/linux/brk.c
branches/ASPACEM_TWEAKS/memcheck/tests/linux/brk.stderr.exp
branches/ASPACEM_TWEAKS/memcheck/tests/linux/brk.vgtest
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c Sat May 9 22:28:24 2015
@@ -2964,6 +2964,71 @@
return VG_(am_mmap_anon_fixed_client)( anon_start, anon_size, prot );
}
+/* Resize the client brk segment from OLDBRK to NEWBRK. Return an error if
+ the resize operation could not be completed. A +1 error core means
+ "overflow", a -1 error code means "underflow", and 0 means some other
+ failure. */
+SysRes VG_(am_resize_client_dataseg) ( Addr oldbrk, Addr newbrk )
+{
+ static Addr brk_base = 0;
+
+ SysRes success = VG_(mk_SysRes_Success)(0);
+
+ if (newbrk == oldbrk) return success; // nothing to do
+
+ /* We rely on the caller to pass in the correct address here. Ideally,
+ we should keep the state (base/limit) in the address space manager and
+ not at the call site. */
+ if (brk_base == 0) brk_base = oldbrk;
+
+ const NSegment *aseg = VG_(am_find_nsegment)(brk_base);
+ aspacem_assert(aseg && aseg->kind == SkAnonC);
+
+ if (newbrk < oldbrk) {
+ /* Shrinking the data segment. Be lazy and don't munmap the
+ excess area. */
+
+ /* Test for underflow. */
+ if (newbrk < brk_base) return VG_(mk_SysRes_Error)(-1);
+
+ /* Since we're being lazy and not unmapping pages, we have to
+ zero out the area, so that if the area later comes back into
+ circulation, it will be filled with zeroes, as if it really
+ had been unmapped and later remapped. Be a bit paranoid and
+ try hard to ensure we're not going to segfault by doing the
+ write - check both ends of the range are in the same segment
+ and that segment is writable. */
+ const NSegment *nseg = VG_(am_find_nsegment)(newbrk);
+ aspacem_assert(nseg == aseg);
+ if (aseg->hasW)
+ VG_(memset)( (void*)newbrk, 0, oldbrk - newbrk );
+
+ return success;
+ }
+
+ /* Otherwise we're expanding the brk segment. */
+ if (newbrk <= aseg->end + 1) {
+ /* Still fits within the anon segment. */
+ return success;
+ }
+
+ Addr newbrkP = VG_PGROUNDUP(newbrk);
+ SizeT delta = newbrkP - (aseg->end + 1);
+ aspacem_assert(delta > 0);
+ aspacem_assert(VG_IS_PAGE_ALIGNED(delta));
+
+ Bool overflow;
+ if (! VG_(am_extend_into_adjacent_reservation_client)( aseg->start, delta,
+ &overflow)) {
+ if (overflow)
+ return VG_(mk_SysRes_Error)(1);
+ else
+ return VG_(mk_SysRes_Error)(0);
+ }
+
+ return success;
+}
+
/* Allocate the client stack segment beginning at STACK_END. The stack segment
can be at most MAX_SIZE bytes large. It is represented as an expandable
Modified: branches/ASPACEM_TWEAKS/coregrind/m_syswrap/syswrap-generic.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_syswrap/syswrap-generic.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_syswrap/syswrap-generic.c Sat May 9 22:28:24 2015
@@ -1187,9 +1187,6 @@
static Addr do_brk ( Addr newbrk, ThreadId tid )
{
- NSegment const* aseg;
- Addr newbrkP;
- SizeT delta;
Bool debug = False;
if (debug)
@@ -1198,76 +1195,37 @@
if (0) VG_(am_show_nsegments)(0, "in_brk");
- if (newbrk < VG_(brk_base))
- /* Clearly impossible. */
- goto bad;
+ /* Special case: a 0 argument means to return the current high water mark */
+ if (newbrk == 0) return VG_(brk_limit);
- if (newbrk < VG_(brk_limit)) {
- /* shrinking the data segment. Be lazy and don't munmap the
- excess area. */
- NSegment const * seg = VG_(am_find_nsegment)(newbrk);
- vg_assert(seg);
-
- if (seg->hasT)
- VG_(discard_translations)( newbrk, VG_(brk_limit) - newbrk,
- "do_brk(shrink)" );
- /* Since we're being lazy and not unmapping pages, we have to
- zero out the area, so that if the area later comes back into
- circulation, it will be filled with zeroes, as if it really
- had been unmapped and later remapped. Be a bit paranoid and
- try hard to ensure we're not going to segfault by doing the
- write - check both ends of the range are in the same segment
- and that segment is writable. */
- NSegment const * seg2;
-
- seg2 = VG_(am_find_nsegment)( VG_(brk_limit) - 1 );
- vg_assert(seg2);
-
- if (seg == seg2 && seg->hasW)
- VG_(memset)( (void*)newbrk, 0, VG_(brk_limit) - newbrk );
-
- VG_(brk_limit) = newbrk;
- return newbrk;
- }
-
- /* otherwise we're expanding the brk segment. */
- if (VG_(brk_limit) > VG_(brk_base))
- aseg = VG_(am_find_nsegment)( VG_(brk_limit)-1 );
- else
- aseg = VG_(am_find_nsegment)( VG_(brk_limit) );
+ SysRes sres = VG_(am_resize_client_dataseg)(VG_(brk_limit), newbrk);
- /* These should be assured by setup_client_dataseg in m_main. */
- vg_assert(aseg);
- vg_assert(aseg->kind == SkAnonC);
-
- if (newbrk <= aseg->end + 1) {
- /* still fits within the anon segment. */
- VG_(brk_limit) = newbrk;
- return newbrk;
- }
-
- newbrkP = VG_PGROUNDUP(newbrk);
- delta = newbrkP - (aseg->end + 1);
- vg_assert(delta > 0);
- vg_assert(VG_IS_PAGE_ALIGNED(delta));
-
- Bool overflow;
- if (! VG_(am_extend_into_adjacent_reservation_client)( aseg->start, delta,
- &overflow)) {
- if (overflow)
+ if (sr_isError(sres)) {
+ if (sr_Err(sres) == 1)
VG_(umsg)("brk segment overflow in thread #%d: can't grow to %#lx\n",
- tid, newbrkP);
+ tid, newbrk);
+ else if (sr_Err(sres) == -1)
+ VG_(umsg)("brk segment underflow in thread #%d: can't shrink to %#lx\n",
+ tid, newbrk);
else
- VG_(umsg)("Cannot map memory to grow brk segment in thread #%d "
- "to %#lx\n", tid, newbrkP);
- goto bad;
+ VG_(umsg)("Cannot map memory to %s brk segment in thread #%d "
+ "to %#lx\n", newbrk > VG_(brk_limit) ? "grow" : "shrink",
+ tid, newbrk);
+ return VG_(brk_limit);
+ }
+
+ /* If the brk segment was shrunk, discard translations if there were any. */
+ if (newbrk < VG_(brk_limit)) {
+ const NSegment *aseg = VG_(am_find_nsegment)(VG_(brk_limit) - 1);
+ vg_assert(aseg);
+
+ if (aseg->hasT)
+ VG_(discard_translations)(newbrk, VG_(brk_limit) - newbrk,
+ "do_brk(shrink)");
}
VG_(brk_limit) = newbrk;
return newbrk;
-
- bad:
- return VG_(brk_limit);
}
Modified: branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h (original)
+++ branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h Sat May 9 22:28:24 2015
@@ -312,6 +312,7 @@
// Client memory segments
extern SysRes VG_(am_alloc_client_dataseg) ( Addr base, SizeT max_size,
UInt prot );
+extern SysRes VG_(am_resize_client_dataseg) ( Addr oldbrk, Addr newbrk );
extern SysRes VG_(am_alloc_extensible_client_stack) ( Addr stack_end,
SizeT max_size,
UInt prot );
Modified: branches/ASPACEM_TWEAKS/memcheck/tests/linux/brk.c
==============================================================================
--- branches/ASPACEM_TWEAKS/memcheck/tests/linux/brk.c (original)
+++ branches/ASPACEM_TWEAKS/memcheck/tests/linux/brk.c Sat May 9 22:28:24 2015
@@ -11,29 +11,33 @@
int i;
void* orig_ds = sbrk(0);
void* ds = orig_ds;
- void* vals[10];
- void* res __attribute__((unused));
-#define EOL ((void*)( ~(long)0 ))
- vals[0] = (void*)0;
- vals[1] = (void*)1;
- vals[2] = ds - 0x1; // small shrink
- vals[3] = ds;
- vals[4] = ds + 0x1000; // small growth
- vals[5] = ds + 0x40000000; // too-big growth
- vals[6] = ds + 0x500; // shrink a little, but still above start size
- vals[7] = ds - 0x1; // shrink below start size
-// vals[8] = ds - 0x1000; // shrink a lot below start size (into text)
-// vals[9] = EOL;
- vals[8] = EOL;
+ struct {
+ void *brkval;
+ const char *what;
+ } vals[] = {
+ { (void *)0, "like sbrk(0)" },
+ { (void *)1, "shrink to 0x1 --> expect underflow" },
+ { ds - 0x1, "shrink just below current brk value --> expect underflow" },
+ { ds, "brk to current brk value" },
+ { ds + 0x1000,"grow by 0x1000" },
+ { ds + 0x40000000, "excessive growth --> expect overflow" },
+ { ds + 0x200, "shrink by 0x800" },
+ };
- for (i = 0; EOL != vals[i]; i++) {
- res = (void*)syscall(__NR_brk, vals[i]);
+ fprintf(stderr, "KERNEL __NR_brk\n");
+ for (i = 0; i < sizeof vals / sizeof vals[0]; i++) {
+ fprintf(stderr, "...%s\n", vals[i].what);
+ void *res = (void*)syscall(__NR_brk, vals[i].brkval);
+ fprintf(stderr, "res = %p\n", res);
}
+ fprintf(stderr, "LIBC brk\n");
assert( 0 == brk(orig_ds) ); // libc brk()
- for (i = 0; EOL != vals[i]; i++) {
- res = (void*)(long)brk(vals[i]);
+ for (i = 0; i < sizeof vals / sizeof vals[0]; i++) {
+ fprintf(stderr, "...%s\n", vals[i].what);
+ int rc = brk(vals[i].brkval);
+ fprintf(stderr, "rc = %d\n", rc);
}
return 0;
Modified: branches/ASPACEM_TWEAKS/memcheck/tests/linux/brk.stderr.exp
==============================================================================
--- branches/ASPACEM_TWEAKS/memcheck/tests/linux/brk.stderr.exp (original)
+++ branches/ASPACEM_TWEAKS/memcheck/tests/linux/brk.stderr.exp Sat May 9 22:28:24 2015
@@ -1,12 +1,36 @@
-
+KERNEL __NR_brk
+...like sbrk(0)
+res = 0x........
+...shrink to 0x........ --> expect underflow
+brk segment underflow in thread #1: can't shrink to 0x........
+res = 0x........
+...shrink just below current brk value --> expect underflow
+brk segment underflow in thread #1: can't shrink to 0x........
+res = 0x........
+...brk to current brk value
+res = 0x........
+...grow by 0x........
+res = 0x........
+...excessive growth --> expect overflow
brk segment overflow in thread #1: can't grow to 0x........
+res = 0x........
+...shrink by 0x........
+res = 0x........
+LIBC brk
+...like sbrk(0)
+rc = 0
+...shrink to 0x........ --> expect underflow
+brk segment underflow in thread #1: can't shrink to 0x........
+rc = 0
+...shrink just below current brk value --> expect underflow
+brk segment underflow in thread #1: can't shrink to 0x........
+rc = 0
+...brk to current brk value
+rc = 0
+...grow by 0x........
+rc = 0
+...excessive growth --> expect overflow
brk segment overflow in thread #1: can't grow to 0x........
-
-HEAP SUMMARY:
- in use at exit: ... bytes in ... blocks
- total heap usage: ... allocs, ... frees, ... bytes allocated
-
-For a detailed leak analysis, rerun with: --leak-check=full
-
-For counts of detected and suppressed errors, rerun with: -v
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
+rc = -1
+...shrink by 0x........
+rc = 0
Modified: branches/ASPACEM_TWEAKS/memcheck/tests/linux/brk.vgtest
==============================================================================
--- branches/ASPACEM_TWEAKS/memcheck/tests/linux/brk.vgtest (original)
+++ branches/ASPACEM_TWEAKS/memcheck/tests/linux/brk.vgtest Sat May 9 22:28:24 2015
@@ -1,2 +1,3 @@
prog: brk
+vgopts: -q
stderr_filter: ../filter_allocs
|