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
(12) |
2
(11) |
3
(8) |
|
4
(9) |
5
(10) |
6
(18) |
7
(8) |
8
(12) |
9
(23) |
10
(14) |
|
11
(15) |
12
(31) |
13
(45) |
14
(28) |
15
(20) |
16
(16) |
17
(9) |
|
18
(18) |
19
(26) |
20
(49) |
21
(14) |
22
(18) |
23
(24) |
24
(28) |
|
25
(39) |
26
(17) |
27
(27) |
28
(27) |
29
(14) |
30
(44) |
|
|
From: <js...@ac...> - 2005-09-17 04:40:34
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-09-17 03:30:00 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 185 tests, 2 stderr failures, 0 stdout failures ================= none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <to...@co...> - 2005-09-17 02:41:12
|
Nightly build on dunsmere ( athlon, Fedora Core 4 ) started at 2005-09-17 03:30:07 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 187 tests, 5 stderr failures, 0 stdout failures ================= memcheck/tests/leak-tree (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-09-17 02:28:36
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-09-17 03:15:04 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 186 tests, 14 stderr failures, 1 stdout failure ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) none/tests/x86/yield (stdout) |
|
From: Tom H. <th...@cy...> - 2005-09-17 02:25:43
|
Nightly build on ginetta ( i686, Red Hat 8.0 ) started at 2005-09-17 03:10:07 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 186 tests, 2 stderr failures, 0 stdout failures ================= none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-09-17 02:21:16
|
Nightly build on dellow ( x86_64, Fedora Core 4 ) started at 2005-09-17 03:10:07 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 164 tests, 6 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) |
|
From: Tom H. <th...@cy...> - 2005-09-17 02:18:48
|
Nightly build on aston ( x86_64, Fedora Core 3 ) started at 2005-09-17 03:05:06 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 164 tests, 6 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) |
|
From: Tom H. <th...@cy...> - 2005-09-17 02:13:15
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2005-09-17 03:00:03 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 164 tests, 7 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_fcntl (stderr) |
|
From: <sv...@va...> - 2005-09-17 01:50:20
|
Author: sewardj
Date: 2005-09-17 02:50:15 +0100 (Sat, 17 Sep 2005)
New Revision: 4671
Log:
Reimplement wrapper for sys_mremap and attach to new aspacem.
Modified:
branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
branches/ASPACEM/coregrind/m_signals.c
branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
branches/ASPACEM/coregrind/pub_core_aspacemgr.h
Modified: branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-17 01:48:1=
8 UTC (rev 4670)
+++ branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-17 01:50:1=
5 UTC (rev 4671)
@@ -1471,7 +1471,8 @@
=20
//--------------------------------------------------------------
// Direct access to a handful of syscalls. This avoids dependence on
-// m_libc*.
+// m_libc*. THESE DO NOT UPDATE THE SEGMENT LIST. DO NOT USE THEM
+// UNLESS YOU KNOW WHAT YOU ARE DOING.
=20
SysRes VG_(am_do_mmap_NO_NOTIFY)( Addr start, SizeT length, UInt prot,=20
UInt flags, UInt fd, OffT offset)
@@ -1510,6 +1511,37 @@
return VG_(do_syscall2)(__NR_munmap, (UWord)start, length );
}
=20
+static SysRes do_extend_mapping_NO_NOTIFY( Addr old_addr, SizeT old_len=
,
+ SizeT new_len )
+{
+ /* Extend the mapping old_addr .. old_addr+old_len-1 to have length
+ new_len, WITHOUT moving it. If it can't be extended in place,
+ fail. */
+ return VG_(do_syscall5)(
+ __NR_mremap,=20
+ old_addr, old_len, new_len,=20
+ 0/*flags, meaning: must be at old_addr, else FAIL */,
+ 0/*new_addr, is ignored*/
+ );
+}
+
+static SysRes do_relocate_nooverlap_mapping_NO_NOTIFY(=20
+ Addr old_addr, Addr old_len,=20
+ Addr new_addr, Addr new_len=20
+ )
+{
+ /* Move the mapping old_addr .. old_addr+old_len-1 to the new
+ location and with the new length. Only needs to handle the case
+ where the two areas do not overlap, neither length is zero, and
+ all args are page aligned. */
+ return VG_(do_syscall5)(
+ __NR_mremap,=20
+ old_addr, old_len, new_len,=20
+ VKI_MREMAP_MAYMOVE|VKI_MREMAP_FIXED/*move-or-fail*/,
+ 0/*new_addr*/
+ );
+}
+
static Int aspacem_readlink(HChar* path, HChar* buf, UInt bufsiz)
{
SysRes res;
@@ -2007,8 +2039,8 @@
be consider part of the client's addressable space. It also
considers reservations to be allowable, since from the client's
point of view they don't exist. */
-Bool VG_(am_is_free_or_valid_for_client)( Addr start, SizeT len,=20
- UInt prot )
+Bool VG_(am_is_valid_for_client_or_free_or_resvn)
+ ( Addr start, SizeT len, UInt prot )
{
return is_valid_for_client( start, len, prot, True/*free is OK*/ );
}
@@ -2102,6 +2134,7 @@
aspacem_assert(sStart <=3D sEnd);
aspacem_assert(VG_IS_PAGE_ALIGNED(sStart));
aspacem_assert(VG_IS_PAGE_ALIGNED(sEnd+1));
+ /* if (!sane_NSegment(seg)) show_nsegment_full(0,seg); */
aspacem_assert(sane_NSegment(seg));
=20
split_nsegments_lo_and_hi( sStart, sEnd, &iLo, &iHi );
@@ -2528,14 +2561,15 @@
seg.hasR =3D toBool(prot & VKI_PROT_READ);
seg.hasW =3D toBool(prot & VKI_PROT_WRITE);
seg.hasX =3D toBool(prot & VKI_PROT_EXEC);
- /* TODO: what about seg.hasT ? */
- if (get_inode_for_fd(fd, &dev, &ino)) {
- seg.dev =3D dev;
- seg.ino =3D ino;
+ if (!(flags & VKI_MAP_ANONYMOUS)) {
+ if (get_inode_for_fd(fd, &dev, &ino)) {
+ seg.dev =3D dev;
+ seg.ino =3D ino;
+ }
+ if (get_name_for_fd(fd, buf, VKI_PATH_MAX)) {
+ seg.fnIdx =3D allocate_segname( buf );
+ }
}
- if (get_name_for_fd(fd, buf, VKI_PATH_MAX)) {
- seg.fnIdx =3D allocate_segname( buf );
- }
add_segment( &seg );
}
=20
@@ -2620,6 +2654,8 @@
/*--- ---*/
/*-----------------------------------------------------------------*/
=20
+/* --- --- --- map, unmap, protect --- --- --- */
+
/* Map a file at a fixed address for the client, and update the
segment array accordingly. */
=20
@@ -2857,9 +2893,54 @@
}
=20
=20
-/* See comment on prototype in pub_core_aspacemgr.h for a description
- of this. */
+/* Unmap the given address range an update the segment array
+ accordingly. This fails if the range isn't valid for the
+ client. */
=20
+SysRes VG_(am_munmap_client)( Addr start, SizeT len )
+{
+ SysRes sres;
+
+ if (!VG_IS_PAGE_ALIGNED(start))
+ goto eINVAL;
+
+ if (len =3D=3D 0)
+ return VG_(mk_SysRes_Success)( 0 );
+
+ if (start + len < len)
+ goto eINVAL;
+
+ len =3D VG_PGROUNDUP(len);
+ aspacem_assert(VG_IS_PAGE_ALIGNED(start));
+ aspacem_assert(VG_IS_PAGE_ALIGNED(len));
+
+ if (!VG_(am_is_valid_for_client_or_free_or_resvn)
+ ( start, len, VKI_PROT_NONE ))
+ goto eINVAL;
+
+ sres =3D do_munmap_NO_NOTIFY( start, len );
+ if (sres.isError)
+ return sres;
+
+ VG_(am_notify_munmap)( start, len );
+ return sres;
+
+ eINVAL:
+ return VG_(mk_SysRes_Error)( VKI_EINVAL );
+}
+
+
+/* --- --- --- reservations --- --- --- */
+
+/* Create a reservation from START .. START+LENGTH-1, with the given
+ ShrinkMode. When checking whether the reservation can be created,
+ also ensure that at least abs(EXTRA) extra free bytes will remain
+ above (> 0) or below (< 0) the reservation.
+
+ The reservation will only be created if it, plus the extra-zone,
+ falls entirely within a single free segment. The returned Bool
+ indicates whether the creation succeeded. */
+
Bool VG_(am_create_reservation) ( Addr start, SizeT length,=20
ShrinkMode smode, SSizeT extra )
{
@@ -2910,10 +2991,17 @@
}
=20
=20
-/* See comment on prototype in pub_core_aspacemgr.h for a description
- of this. */
+/* Let SEG be an anonymous client mapping. This fn extends the
+ mapping by DELTA bytes, taking the space from a reservation section
+ which must be adjacent. If DELTA is positive, the segment is
+ extended forwards in the address space, and the reservation must be
+ the next one along. If DELTA is negative, the segment is extended
+ backwards in the address space and the reservation must be the
+ previous one. DELTA must be page aligned and must not exceed the
+ size of the reservation segment. */
=20
-Bool VG_(am_extend_into_adjacent_reservation)( NSegment* seg, SSizeT del=
ta )
+Bool VG_(am_extend_into_adjacent_reservation_client) ( NSegment* seg,=20
+ SSizeT delta )
{
Int segA, segR;
UInt prot;
@@ -2924,7 +3012,7 @@
segA =3D segAddr_to_index( seg );
aspacem_assert(segA >=3D 0 && segA < nsegments_used);
=20
- if (nsegments[segA].kind !=3D SkAnonC && nsegments[segA].kind !=3D Sk=
AnonV)
+ if (nsegments[segA].kind !=3D SkAnonC)
return False;
=20
if (delta =3D=3D 0)
@@ -2958,7 +3046,7 @@
return False; /* kernel bug if this happens? */
if (sres.val !=3D nsegments[segR].start) {
/* kernel bug if this happens? */
- do_munmap_NO_NOTIFY( sres.val, delta );
+ (void)do_munmap_NO_NOTIFY( sres.val, delta );
return False;
}
=20
@@ -2992,7 +3080,7 @@
return False; /* kernel bug if this happens? */
if (sres.val !=3D nsegments[segA].start-delta) {
/* kernel bug if this happens? */
- do_munmap_NO_NOTIFY( sres.val, delta );
+ (void)do_munmap_NO_NOTIFY( sres.val, delta );
return False;
}
=20
@@ -3007,6 +3095,109 @@
}
=20
=20
+/* --- --- --- resizing/move a mapping --- --- --- */
+
+/* Let SEG be a client mapping (anonymous or file). This fn extends
+ the mapping forwards only by DELTA bytes, and trashes whatever was
+ in the new area. Fails if SEG is not a single client mapping or if
+ the new area is not accessible to the client. Fails if DELTA is
+ not page aligned. *seg is invalid after a successful return. */
+
+Bool VG_(am_extend_map_client)( NSegment* seg, SizeT delta )
+{
+ Addr xStart;
+ SysRes sres;
+ NSegment seg_copy;
+
+ if (seg->kind !=3D SkFileC && seg->kind !=3D SkAnonC)
+ return False;
+
+ if (delta =3D=3D 0 || !VG_IS_PAGE_ALIGNED(delta))=20
+ return False;
+
+ xStart =3D seg->end+1;
+ if (xStart + delta < delta)
+ return False;
+
+ if (!VG_(am_is_valid_for_client_or_free_or_resvn)( xStart, delta,=20
+ VKI_PROT_NONE ))
+ return False;
+
+ sres =3D do_extend_mapping_NO_NOTIFY( seg->start, seg->end+1-seg->sta=
rt,
+ delta );
+ if (sres.isError)
+ return False;
+
+ seg_copy =3D *seg;
+ seg_copy.end +=3D delta;
+ add_segment( &seg_copy );
+ return True;
+}
+
+
+/* Remap the old address range to the new address range. Fails if any
+ parameter is not page aligned, if the either size is zero, if any
+ wraparound is implied, if the old address range does not fall
+ entirely within a single segment, if the new address range overlaps
+ with the old one, or if the old address range is not a valid client
+ mapping. */
+
+Bool VG_(am_relocate_nooverlap_client)( Addr old_addr, SizeT old_len,
+ Addr new_addr, SizeT new_len )
+{
+ Int iLo, iHi;
+ SysRes sres;
+ NSegment seg, oldseg;
+
+ if (old_len =3D=3D 0 || new_len =3D=3D 0)
+ return False;
+
+ if (!VG_IS_PAGE_ALIGNED(old_addr) || !VG_IS_PAGE_ALIGNED(old_len)
+ || !VG_IS_PAGE_ALIGNED(new_addr) || !VG_IS_PAGE_ALIGNED(new_len))
+ return False;
+
+ if (old_addr + old_len < old_addr
+ || new_addr + new_len < new_addr)
+ return False;
+
+ if (old_addr + old_len - 1 < new_addr
+ || new_addr + new_len - 1 < old_addr) {
+ /* no overlap */
+ } else
+ return False;
+
+ iLo =3D find_nsegment_idx( old_addr );
+ iHi =3D find_nsegment_idx( old_addr + old_len - 1 );
+ if (iLo !=3D iHi)
+ return False;
+
+ if (nsegments[iLo].kind !=3D SkFileC && nsegments[iLo].kind !=3D SkAn=
onC)
+ return False;
+
+ sres =3D do_relocate_nooverlap_mapping_NO_NOTIFY( old_addr, old_len,=20
+ new_addr, new_len );
+ if (sres.isError)
+ return False;
+
+ oldseg =3D nsegments[iLo];
+
+ /* Create a free hole in the old location. */
+ init_nsegment( &seg );
+ seg.kind =3D SkFree;
+ seg.start =3D old_addr;
+ seg.end =3D old_addr + old_len - 1;
+ add_segment( &seg );
+
+ /* Mark the new area based on the old seg. */
+ oldseg.offset +=3D ((ULong)old_addr) - ((ULong)oldseg.start);
+ oldseg.start =3D new_addr;
+ oldseg.end =3D new_addr + new_len - 1;
+ add_segment( &seg );
+
+ return True;
+}
+
+
/*-----------------------------------------------------------------*/
/*--- ---*/
/*--- Manage stacks for Valgrind itself. ---*/
Modified: branches/ASPACEM/coregrind/m_signals.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_signals.c 2005-09-17 01:48:18 UTC (rev 4=
670)
+++ branches/ASPACEM/coregrind/m_signals.c 2005-09-17 01:50:15 UTC (rev 4=
671)
@@ -1339,6 +1339,11 @@
haveaddr =3D False;
break;
}
+ VG_(am_show_nsegments)(0,"post segfault");
+ {HChar buf[110];
+ VG_(sprintf)(buf, "/bin/cat /proc/%d/maps", VG_(getpid)());
+ VG_(system)(buf);
+ }
break;
=20
case VKI_SIGILL:
@@ -1726,15 +1731,14 @@
=20
udelta =3D VG_PGROUNDUP(seg_next->start - addr);
VG_(debugLog)(1, "signals",=20
- "extending a stack base 0x%llx down by %lld ..\n",
+ "extending a stack base 0x%llx down by %lld\n",
(ULong)seg_next->start, (ULong)udelta);
- if (! VG_(am_extend_into_adjacent_reservation)( seg_next, -(SSizeT)ud=
elta )) {
- VG_(debugLog)(1, "signals", " .. failure\n");
+ if (! VG_(am_extend_into_adjacent_reservation_client)
+ ( seg_next, -(SSizeT)udelta )) {
+ VG_(debugLog)(1, "signals", "extending a stack base: FAILED\n");
return False;
}
=20
- VG_(debugLog)(1, "signals", " .. success\n");
-
/* When we change the main stack, we have to let the stack handling
code know about it. */
/// FIXME VG_(change_stack)(VG_(clstk_id), base, VG_(clstk_end));
Modified: branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-17 01:=
48:18 UTC (rev 4670)
+++ branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-17 01:=
50:15 UTC (rev 4671)
@@ -59,7 +59,7 @@
=20
/* Returns True iff address range is something the client can
plausibly mess with: all of it is either already belongs to the
- client or is free. */
+ client or is free or a reservation. */
=20
Bool ML_(valid_client_addr)(Addr start, SizeT size, ThreadId tid,
const Char *syscallname)
@@ -69,7 +69,8 @@
if (size =3D=3D 0)
return True;
=20
- ret =3D VG_(am_is_free_or_valid_for_client)(start,size,VKI_PROT_NONE)=
;
+ ret =3D VG_(am_is_valid_for_client_or_free_or_resvn)
+ (start,size,VKI_PROT_NONE);
=20
if (0)
VG_(printf)("%s: test=3D%p-%p ret=3D%d\n",
@@ -149,140 +150,211 @@
VG_TRACK( new_mem_mmap, a, len, rr, ww, xx );
}
=20
-static=20
-SysRes mremap_segment ( Addr old_addr, SizeT old_size,
- Addr new_addr, SizeT new_size,
- UInt flags, ThreadId tid)
+/* Expand (or shrink) an existing mapping, potentially moving it at
+ the same time (controlled by the MREMAP_MAYMOVE flag). Nightmare.
+*/
+static
+SysRes do_mremap( Addr old_addr, SizeT old_len,=20
+ Addr new_addr, SizeT new_len,
+ UWord flags, ThreadId tid )
{
- SysRes ret;
- Segment *seg, *next;
+ Bool ok;
+ NSegment* old_seg;
+ Addr advised;
+ Bool f_fixed =3D toBool(flags & VKI_MREMAP_FIXED);
+ Bool f_maymove =3D toBool(flags & VKI_MREMAP_MAYMOVE);
=20
- old_size =3D VG_PGROUNDUP(old_size);
- new_size =3D VG_PGROUNDUP(new_size);
+ if (0)
+ VG_(printf)("do_remap (old %p %d) (new %p %d) %s %s\n",
+ old_addr,old_len,new_addr,new_len,=20
+ flags & VKI_MREMAP_MAYMOVE ? "MAYMOVE" : "",
+ flags & VKI_MREMAP_FIXED ? "FIXED" : "");
=20
- if (VG_PGROUNDDN(old_addr) !=3D old_addr)
- return VG_(mk_SysRes_Error)( VKI_EINVAL );
+ if (flags & ~(VKI_MREMAP_FIXED | VKI_MREMAP_MAYMOVE))
+ goto eINVAL;
=20
- if (!ML_(valid_client_addr)(old_addr, old_size, tid, "mremap(old_addr=
)"))
- return VG_(mk_SysRes_Error)( VKI_EFAULT );
+ if (!VG_IS_PAGE_ALIGNED(old_addr))
+ goto eINVAL;
=20
- /* fixed at the current address means we don't move it */
- if ((flags & VKI_MREMAP_FIXED) && (old_addr =3D=3D new_addr))
- flags &=3D ~(VKI_MREMAP_FIXED|VKI_MREMAP_MAYMOVE);
+ old_len =3D VG_PGROUNDUP(old_len);
+ new_len =3D VG_PGROUNDUP(new_len);
=20
- if (flags & VKI_MREMAP_FIXED) {
- if (VG_PGROUNDDN(new_addr) !=3D new_addr)
- return VG_(mk_SysRes_Error)( VKI_EINVAL );
+ if (new_len =3D=3D 0)
+ goto eINVAL;
=20
- if (!ML_(valid_client_addr)(new_addr, new_size, tid, "mremap(new_a=
ddr)"))
- return VG_(mk_SysRes_Error)( VKI_ENOMEM );
+ /* kernel doesn't reject this, but we do. */
+ if (old_len =3D=3D 0)
+ goto eINVAL;
=20
- /* check for overlaps */
- if ((old_addr < (new_addr+new_size) &&
- (old_addr+old_size) > new_addr) ||
- (new_addr < (old_addr+new_size) &&
- (new_addr+new_size) > old_addr))
- return VG_(mk_SysRes_Error)( VKI_EINVAL );
- }
+ /* reject wraparounds */
+ if (old_addr + old_len < old_addr
+ || new_addr + new_len < new_len)
+ goto eINVAL;
=20
- /* Do nothing */
- if (!(flags & VKI_MREMAP_FIXED) && new_size =3D=3D old_size)
- return VG_(mk_SysRes_Success)( old_addr );
+ /* kernel rejects all fixed, no-move requests (which are
+ meaningless). */
+ if (f_fixed =3D=3D True && f_maymove =3D=3D False)
+ goto eINVAL;
=20
- seg =3D VG_(find_segment)(old_addr);
+ /* Stay away from non-client areas. */
+ if (!ML_(valid_client_addr)(old_addr, old_len, tid, "mremap(old_addr)=
"))
+ goto eINVAL;
=20
- /* range must be contained within segment */
- if (seg =3D=3D NULL || !VG_(seg_contains)(seg, old_addr, old_size))
- return VG_(mk_SysRes_Error)( VKI_EINVAL );
+ /* In all remaining cases, if the old range does not fall within a
+ single segment, fail. */
+ old_seg =3D VG_(am_find_nsegment)( old_addr );
+ if (old_addr < old_seg->start || old_addr+old_len-1 > old_seg->end)
+ goto eINVAL;
+ if (old_seg->kind !=3D SkAnonC && old_seg->kind !=3D SkAnonV)
+ goto eINVAL;
=20
- next =3D VG_(find_segment_above_mapped)(old_addr);
+ vg_assert(old_len > 0);
+ vg_assert(new_len > 0);
+ vg_assert(VG_IS_PAGE_ALIGNED(old_len));
+ vg_assert(VG_IS_PAGE_ALIGNED(new_len));
+ vg_assert(VG_IS_PAGE_ALIGNED(old_addr));
=20
- if (0)
- VG_(printf)("mremap: old_addr+new_size=3D%p next->addr=3D%p flags=3D=
%d\n",
- old_addr+new_size, next->addr, flags);
- =20
- if ((flags & VKI_MREMAP_FIXED) ||
- (next !=3D NULL && (old_addr+new_size) > next->addr)) {
- /* we're moving the block */
- Addr a;
- =20
- if ((flags & (VKI_MREMAP_FIXED|VKI_MREMAP_MAYMOVE)) =3D=3D 0)
- /* not allowed to move */
- return VG_(mk_SysRes_Error)( VKI_ENOMEM );=20
+ /* There are 3 remaining cases:
=20
- if ((flags & VKI_MREMAP_FIXED) =3D=3D 0)
- new_addr =3D 0;
+ * maymove =3D=3D False
=20
- a =3D VG_(find_map_space)(new_addr, new_size, True);
+ new space has to be at old address, so:
+ - shrink -> unmap end
+ - same size -> do nothing
+ - grow -> if can grow in-place, do so, else fail
=20
- if ((flags & VKI_MREMAP_FIXED) && a !=3D new_addr)
- /* didn't find the place we wanted */
- return VG_(mk_SysRes_Error)( VKI_ENOMEM );
+ * maymove =3D=3D True, fixed =3D=3D False
=20
- new_addr =3D a;
+ new space can be anywhere, so:
+ - shrink -> unmap end
+ - same size -> do nothing
+ - grow -> if can grow in-place, do so, else=20
+ move to anywhere large enough, else fail
=20
- /* we've nailed down the location */
- flags |=3D VKI_MREMAP_FIXED|VKI_MREMAP_MAYMOVE;
+ * maymove =3D=3D True, fixed =3D=3D True
=20
- ret =3D VG_(do_syscall5)(__NR_mremap, old_addr, old_size, new_size=
,=20
- flags, new_addr);
+ new space must be at new address, so:
=20
- if (ret.isError) {
- return ret;
- }
+ - if new address is not page aligned, fail
+ - if new address range overlaps old one, fail
+ - if new address range cannot be allocated, fail
+ - else move to new address range with new size
+ - else fail
+ */
=20
- VG_TRACK(copy_mem_remap, old_addr, new_addr,=20
- (old_size < new_size) ? old_size : new_size);
+ if (f_maymove =3D=3D False) {
+ /* new space has to be at old address */
+ if (new_len < old_len)
+ goto shrink_in_place;
+ if (new_len > old_len)
+ goto grow_in_place_or_fail;
+ goto same_in_place;
+ }
=20
- if (new_size > old_size)
- VG_TRACK(new_mem_mmap, new_addr+old_size, new_size-old_size,
- seg->prot & VKI_PROT_READ,=20
- seg->prot & VKI_PROT_WRITE,=20
- seg->prot & VKI_PROT_EXEC);
- VG_TRACK(die_mem_munmap, old_addr, old_size);
+ if (f_maymove =3D=3D True && f_fixed =3D=3D False) {
+ /* new space can be anywhere */
+ if (new_len < old_len)
+ goto shrink_in_place;
+ if (new_len > old_len)
+ goto grow_in_place_or_move_anywhere_or_fail;
+ goto same_in_place;
+ }
=20
- VG_(map_file_segment)(new_addr, new_size,
- seg->prot,=20
- seg->flags,
- seg->dev, seg->ino,
- seg->offset, seg->filename);
-
- VG_(munmap)((void *)old_addr, old_size);
- } else {
- /* staying in place */
- ret =3D VG_(mk_SysRes_Success)( old_addr );
-
- if (new_size < old_size) {
- VG_TRACK(die_mem_munmap, old_addr+new_size, old_size-new_size);
- VG_(munmap)((void *)(old_addr+new_size), old_size-new_size);
+ if (f_maymove =3D=3D True && f_fixed =3D=3D True) {
+ /* new space can only be at the new address */
+ if (!VG_IS_PAGE_ALIGNED(new_addr))=20
+ goto eINVAL;
+ if (new_addr+new_len-1 < old_addr || new_addr > old_addr+old_len-1=
) {
+ /* no overlap */
} else {
- /* we've nailed down the location */
- flags &=3D ~VKI_MREMAP_MAYMOVE;
+ goto eINVAL;
+ }
+ if (new_addr =3D=3D 0)=20
+ goto eINVAL;=20
+ /* VG_(am_get_advisory_client_simple) interprets zero to mean
+ non-fixed, which is not what we want */
+ advised =3D VG_(am_get_advisory_client_simple)(new_addr, new_len, =
&ok);
+ if (!ok || advised !=3D new_addr)
+ goto eNOMEM;
+ ok =3D VG_(am_relocate_nooverlap_client)
+ ( old_addr, old_len, new_addr, new_len );
+ if (ok)=20
+ return VG_(mk_SysRes_Success)( new_addr );
+ goto eNOMEM;
+ }
=20
- if (0)
- VG_(printf)("mremap: old_addr=3D%p old_size=3D%d new_size=3D%d flag=
s=3D%d\n",
- old_addr, old_size, new_size, flags);
+ /* end of the 3 cases */
+ /*NOTREACHED*/ vg_assert(0);
=20
- ret =3D VG_(do_syscall5)(__NR_mremap, old_addr, old_size, new_size,=20
- flags, 0);
+ grow_in_place_or_move_anywhere_or_fail:=20
+ {=20
+ /* try growing it in-place */
+ Addr needA =3D old_addr + old_len;
+ SSizeT needL =3D new_len - old_len;
=20
- if (ret.isError || (!ret.isError && ret.val !=3D old_addr))
- return ret;
+ vg_assert(needL > 0);
+ if (needA =3D=3D 0)
+ goto eINVAL;=20
+ /* VG_(am_get_advisory_client_simple) interprets zero to mean
+ non-fixed, which is not what we want */
+ advised =3D VG_(am_get_advisory_client_simple)( needA, needL, &ok );
+ if (ok && advised =3D=3D needA) {
+ ok =3D VG_(am_extend_map_client)( old_seg, needL );
+ old_seg =3D NULL;
+ if (ok)
+ return VG_(mk_SysRes_Success)( old_addr );
+ }
=20
- VG_TRACK(new_mem_mmap, old_addr+old_size, new_size-old_size,
- seg->prot & VKI_PROT_READ,=20
- seg->prot & VKI_PROT_WRITE,=20
- seg->prot & VKI_PROT_EXEC);
+ /* that failed. Look elsewhere. */
+ advised =3D VG_(am_get_advisory_client_simple)( 0, new_len, &ok );
+ if (ok) {
+ /* assert new area does not overlap old */
+ vg_assert(advised+new_len-1 < old_addr=20
+ || advised > old_addr+old_len-1);
+ ok =3D VG_(am_relocate_nooverlap_client)
+ ( old_addr, old_len, advised, new_len );
+ if (ok) return VG_(mk_SysRes_Success)( advised );
+ }
+ goto eNOMEM;
+ }
+ /*NOTREACHED*/ vg_assert(0);
=20
- VG_(map_file_segment)(old_addr+old_size, new_size-old_size,
- seg->prot,=20
- seg->flags,
- seg->dev, seg->ino,
- seg->offset, seg->filename); =20
- }
+ grow_in_place_or_fail:
+ {
+ Addr needA =3D old_addr + old_len;
+ SizeT needL =3D new_len - old_len;
+ if (needA =3D=3D 0)=20
+ goto eINVAL;
+ /* VG_(am_get_advisory_client_simple) interprets zero to mean
+ non-fixed, which is not what we want */
+ advised =3D VG_(am_get_advisory_client_simple)( needA, needL, &ok );
+ if (!ok || advised !=3D needA)
+ goto eNOMEM;
+ ok =3D VG_(am_extend_map_client)( old_seg, needL );
+ old_seg =3D NULL;
+ if (!ok)
+ goto eNOMEM;
+ return VG_(mk_SysRes_Success)( old_addr );
}
+ /*NOTREACHED*/ vg_assert(0);
=20
- return ret;
+ shrink_in_place:
+ {
+ SysRes sres =3D VG_(am_munmap_client)( old_addr+new_len, old_len-new_=
len);
+ if (sres.isError)
+ return sres;
+ return VG_(mk_SysRes_Success)( old_addr );
+ }
+ /*NOTREACHED*/ vg_assert(0);
+
+ same_in_place:
+ return VG_(mk_SysRes_Success)( old_addr );
+ /*NOTREACHED*/ vg_assert(0);
+
+ eINVAL:
+ return VG_(mk_SysRes_Error)( VKI_EINVAL );
+ eNOMEM:
+ return VG_(mk_SysRes_Error)( VKI_ENOMEM );
}
=20
=20
@@ -851,7 +923,7 @@
vg_assert(delta > 0);
vg_assert(VG_IS_PAGE_ALIGNED(delta));
=20
- ok =3D VG_(am_extend_into_adjacent_reservation)( aseg, delta );
+ ok =3D VG_(am_extend_into_adjacent_reservation_client)( aseg, delta )=
;
if (!ok) goto bad;
=20
VG_(brk_limit) =3D newbrk;
@@ -2033,7 +2105,7 @@
unsigned long, new_size, unsigned long, flags,
unsigned long, new_addr);
SET_STATUS_from_SysRes(=20
- mremap_segment((Addr)ARG1, ARG2, (Addr)ARG5, ARG3, ARG4, tid)=20
+ do_mremap((Addr)ARG1, ARG2, (Addr)ARG5, ARG3, ARG4, tid)=20
);
}
=20
Modified: branches/ASPACEM/coregrind/pub_core_aspacemgr.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/pub_core_aspacemgr.h 2005-09-17 01:48:18 U=
TC (rev 4670)
+++ branches/ASPACEM/coregrind/pub_core_aspacemgr.h 2005-09-17 01:50:15 U=
TC (rev 4671)
@@ -263,15 +263,15 @@
VKI_PROT_NONE as 'prot'. Will return False if any part of the
area does not belong to the client or does not have at least
the stated permissions. */
-extern Bool VG_(am_is_valid_for_client)( Addr start, SizeT len,=20
- UInt prot );
+extern Bool VG_(am_is_valid_for_client)
+ ( Addr start, SizeT len, UInt prot );
=20
/* Variant of VG_(am_is_valid_for_client) which allows free areas to
be consider part of the client's addressable space. It also
considers reservations to be allowable, since from the client's
point of view they don't exist. */
-extern Bool VG_(am_is_free_or_valid_for_client)( Addr start, SizeT len,=20
- UInt prot );
+extern Bool VG_(am_is_valid_for_client_or_free_or_resvn)
+ ( Addr start, SizeT len, UInt prot );
=20
/* Trivial fn: return the total amount of space in anonymous mappings,
both for V and the client. Is used for printing stats in
@@ -349,6 +349,8 @@
// loading the client and building its stack/data segment, before
// execution begins. Also for V's own administrative use.
=20
+/* --- --- --- map, unmap, protect --- --- --- */
+
/* Map a file at a fixed address for the client, and update the
segment array accordingly. */
extern SysRes VG_(am_mmap_file_fixed_client)
@@ -368,6 +370,13 @@
itself more address space when needed. */
extern SysRes VG_(am_mmap_anon_float_valgrind)( SizeT cszB );
=20
+/* Unmap the given address range an update the segment array
+ accordingly. This fails if the range isn't valid for the
+ client. */
+extern SysRes VG_(am_munmap_client)( Addr start, SizeT length );
+
+/* --- --- --- reservations --- --- --- */
+
/* Create a reservation from START .. START+LENGTH-1, with the given
ShrinkMode. When checking whether the reservation can be created,
also ensure that at least abs(EXTRA) extra free bytes will remain
@@ -387,10 +396,27 @@
backwards in the address space and the reservation must be the
previous one. DELTA must be page aligned and must not exceed the
size of the reservation segment. */
-extern Bool VG_(am_extend_into_adjacent_reservation)=20
+extern Bool VG_(am_extend_into_adjacent_reservation_client)=20
( NSegment* seg, SSizeT delta );
=20
+/* --- --- --- resizing/move a mapping --- --- --- */
=20
+/* Let SEG be a client mapping (anonymous or file). This fn extends
+ the mapping forwards only by DELTA bytes, and trashes whatever was
+ in the new area. Fails if SEG is not a single client mapping or if
+ the new area is not accessible to the client. Fails if DELTA is
+ not page aligned. *seg is invalid after a successful return. */
+extern Bool VG_(am_extend_map_client)( NSegment* seg, SizeT delta );
+
+/* Remap the old address range to the new address range. Fails if any
+ parameter is not page aligned, if the either size is zero, if any
+ wraparound is implied, if the old address range does not fall
+ entirely within a single segment, if the new address range overlaps
+ with the old one, or if the old address range is not a valid client
+ mapping. */
+extern Bool VG_(am_relocate_nooverlap_client)( Addr old_addr, SizeT old_=
len,
+ Addr new_addr, SizeT new_=
len );
+
//--------------------------------------------------------------
// Valgrind (non-client) thread stacks. V itself runs on such
// stacks. The address space manager provides and suitably
|
|
From: <sv...@va...> - 2005-09-17 01:48:25
|
Author: sewardj
Date: 2005-09-17 02:48:18 +0100 (Sat, 17 Sep 2005)
New Revision: 4670
Log:
Rephrase hard-to-understand conditional.
Modified:
branches/ASPACEM/coregrind/m_translate.c
Modified: branches/ASPACEM/coregrind/m_translate.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_translate.c 2005-09-16 04:16:18 UTC (rev=
4669)
+++ branches/ASPACEM/coregrind/m_translate.c 2005-09-17 01:48:18 UTC (rev=
4670)
@@ -440,7 +440,7 @@
{
Addr64 redir, orig_addr0 =3D orig_addr;
Int tmpbuf_used, verbosity;
- Bool notrace_until_done, do_self_check, allowR;
+ Bool notrace_until_done, do_self_check, allowR, seg_ok;
UInt notrace_until_limit =3D 0;
NSegment* seg;
VexGuestExtents vge;
@@ -537,10 +537,12 @@
allowR =3D False;
# endif
=20
- if (seg =3D=3D NULL=20
- || !(seg->kind =3D=3D SkAnonC || seg->kind =3D=3D SkFileC)
- || !(seg->hasX || (seg->hasR && allowR)) ) {
+ seg_ok =3D seg !=3D NULL
+ && (seg->kind =3D=3D SkAnonC || seg->kind =3D=3D SkFileC)
+ && (seg->hasX || (seg->hasR && allowR));
=20
+ if (!seg_ok) {
+
/* U R busted, sonny. Place your hands on your head and step
away from the orig_addr. */
/* Code address is bad - deliver a signal instead */
|