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
(8) |
2
(2) |
3
(1) |
4
(2) |
|
5
(1) |
6
(4) |
7
(6) |
8
(5) |
9
(3) |
10
(5) |
11
(1) |
|
12
(6) |
13
(4) |
14
(1) |
15
(4) |
16
(1) |
17
|
18
|
|
19
|
20
|
21
(2) |
22
(28) |
23
(17) |
24
(6) |
25
(4) |
|
26
(2) |
27
(2) |
28
|
29
(5) |
30
(8) |
31
(14) |
|
|
From: <sv...@va...> - 2015-07-08 17:13:53
|
Author: sewardj
Date: Wed Jul 8 18:13:46 2015
New Revision: 15405
Log:
Minor updates; also note the fixing of 346411.
Modified:
trunk/NEWS
trunk/docs/internals/3_10_BUGSTATUS.txt
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Wed Jul 8 18:13:46 2015
@@ -225,6 +225,7 @@
none/tests/test_isa_2_07_part2 have failures on PPC64 little endian
346307 fuse filesystem syscall deadlocks
346324 PPC64 missing support for lbarx, lharx, stbcx and sthcx instructions
+346411 MIPS: SysRes::_valEx handling is incorrect
346416 Add support for LL_IOC_PATH2FID and LL_IOC_GETPARENT Lustre ioctls
346474 PPC64 Power 8, spr TEXASRU register not supported
346487 Compiler generates "note" about a future ABI change for PPC64
Modified: trunk/docs/internals/3_10_BUGSTATUS.txt
==============================================================================
--- trunk/docs/internals/3_10_BUGSTATUS.txt (original)
+++ trunk/docs/internals/3_10_BUGSTATUS.txt Wed Jul 8 18:13:46 2015
@@ -6,10 +6,6 @@
338602 AVX2 bit in CPUID missing
need to do XSAVE, XRSTOR
-
-339218 AVX2 binaries compiled with the Intel compiler fail to
- run under Valgrind 3.10.0
- FIXME: should we enable this now?
== 338602
339596 vex amd64->IR: 0x8F 0xE8 0x78 0xCD 0xC1 0x4 0xC5 0xF9
@@ -42,6 +38,7 @@
348574 vex amd64->IR pcmpistri SSE4.2 instruction is unsupported
349304 vex amd64->IR: 0xF 0x33 0x89 0x45 0xFC 0x89 0x55 0xF8
+ rdpmc?
=== VEX/arm ============================================================
@@ -114,8 +111,6 @@
346031 MIPS: Implement support for the CvmCount register (rhwr %0, 31)
has patch
-346411 MIPS: SysRes::_valEx handling is incorrect
-
=== VEX/ppc ============================================================
342610 disInstr(ppc): declined to decode an AltiVec insn.
@@ -452,6 +447,6 @@
Check: space recovery in aspacemgr segnames array re-implemented?
Check: missing copyright notices in include/vki/*xen*.h
-Check: 346411 MIPS: SysRes::_valEx handling is incorrect
+Check: update copyright dates in source files
Tue 7 Jul 15:27:23 CEST 2015
|
Author: sewardj
Date: Wed Jul 8 18:08:23 2015
New Revision: 15404
Log:
Fix "346411 MIPS: SysRes::_valEx handling is incorrect"
Specialise type SysRes for mips{32,64}-linux to enable
meaningful equality comparisons.
Modified:
trunk/coregrind/m_libcproc.c
trunk/coregrind/m_scheduler/ticket-lock-linux.c
trunk/coregrind/m_syscall.c
trunk/coregrind/m_syswrap/syswrap-main.c
trunk/coregrind/m_vkiscnums.c
trunk/coregrind/pub_core_syscall.h
trunk/include/pub_tool_basics.h
Modified: trunk/coregrind/m_libcproc.c
==============================================================================
--- trunk/coregrind/m_libcproc.c (original)
+++ trunk/coregrind/m_libcproc.c Wed Jul 8 18:08:23 2015
@@ -918,7 +918,7 @@
# elif defined(VGA_mips32) || defined(VGA_mips64)
SysRes sres = VG_(do_syscall3)(__NR_cacheflush, (UWord) ptr,
(UWord) nbytes, (UWord) 3);
- vg_assert( sres._isError == 0 );
+ vg_assert( !sr_isError(sres) );
# elif defined(VGA_tilegx)
const HChar *start, *end;
Modified: trunk/coregrind/m_scheduler/ticket-lock-linux.c
==============================================================================
--- trunk/coregrind/m_scheduler/ticket-lock-linux.c (original)
+++ trunk/coregrind/m_scheduler/ticket-lock-linux.c Wed Jul 8 18:08:23 2015
@@ -135,8 +135,8 @@
sres = VG_(do_syscall3)(__NR_futex, (UWord)futex,
VKI_FUTEX_WAIT | VKI_FUTEX_PRIVATE_FLAG,
futex_value);
- if (sr_isError(sres) && sres._val != VKI_EAGAIN) {
- VG_(printf)("futex_wait() returned error code %ld\n", sres._val);
+ if (sr_isError(sres) && sr_Err(sres) != VKI_EAGAIN) {
+ VG_(printf)("futex_wait() returned error code %ld\n", sr_Err(sres));
vg_assert(False);
}
}
Modified: trunk/coregrind/m_syscall.c
==============================================================================
--- trunk/coregrind/m_syscall.c (original)
+++ trunk/coregrind/m_syscall.c Wed Jul 8 18:08:23 2015
@@ -38,11 +38,59 @@
Building syscall return values.
------------------------------------------------------------------ */
-#if defined(VGO_linux)
-
/* Make a SysRes value from a syscall return value. This is
- Linux-specific.
+ platform specific. */
+
+#if defined(VGP_mips32_linux) || defined(VGP_mips64_linux)
+
+SysRes VG_(mk_SysRes_mips32_linux) ( UWord v0, UWord v1, UWord a3 ) {
+ /* MIPS uses a3 != 0 to flag an error */
+ SysRes res;
+ res._isError = (a3 != (UWord)0);
+ res._val = v0;
+ res._valEx = v1;
+ return res;
+}
+
+SysRes VG_(mk_SysRes_mips64_linux) ( ULong v0, ULong v1, ULong a3 ) {
+ /* MIPS uses a3 != 0 to flag an error */
+ SysRes res;
+ res._isError = (a3 != (ULong)0);
+ res._val = v0;
+ res._valEx = v1;
+ return res;
+}
+
+/* Generic constructors. */
+SysRes VG_(mk_SysRes_Error) ( UWord err ) {
+ SysRes r;
+ r._isError = True;
+ r._val = err;
+ r._valEx = 0;
+ return r;
+}
+
+SysRes VG_(mk_SysRes_Success) ( UWord res ) {
+ SysRes r;
+ r._isError = False;
+ r._val = res;
+ r._valEx = 0;
+ return r;
+}
+
+SysRes VG_(mk_SysRes_SuccessEx) ( UWord res, UWord resEx ) {
+ SysRes r;
+ r._isError = False;
+ r._val = res;
+ r._valEx = resEx;
+ return r;
+}
+
+#elif defined(VGO_linux) \
+ && !defined(VGP_mips32_linux) && !defined(VGP_mips64_linux)
+
+/*
From:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/
linux/i386/sysdep.h?
@@ -144,32 +192,9 @@
return res;
}
-#if defined(VGA_mips64) || defined(VGA_mips32)
-/* MIPS uses a3 != 0 to flag an error */
-SysRes VG_(mk_SysRes_mips32_linux) ( UWord v0, UWord v1, UWord a3 ) {
- SysRes res;
- res._isError = (a3 != (UWord)0);
- res._val = v0;
- res._valEx = v1;
- return res;
-}
-
-/* MIPS uses a3 != 0 to flag an error */
-SysRes VG_(mk_SysRes_mips64_linux) ( ULong v0, ULong v1, ULong a3 ) {
- SysRes res;
- res._isError = (a3 != (ULong)0);
- res._val = v0;
- res._valEx = v1;
- return res;
-}
-#endif
-
/* Generic constructors. */
SysRes VG_(mk_SysRes_Error) ( UWord err ) {
SysRes r;
-#if defined(VGA_mips64) || defined(VGA_mips32)
- r._valEx = 0;
-#endif
r._isError = True;
r._val = err;
return r;
@@ -177,9 +202,6 @@
SysRes VG_(mk_SysRes_Success) ( UWord res ) {
SysRes r;
-#if defined(VGA_mips64) || defined(VGA_mips32)
- r._valEx = 0;
-#endif
r._isError = False;
r._val = res;
return r;
Modified: trunk/coregrind/m_syswrap/syswrap-main.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-main.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-main.c Wed Jul 8 18:08:23 2015
@@ -369,10 +369,10 @@
}
static
-Bool eq_SyscallStatus ( SyscallStatus* s1, SyscallStatus* s2 )
+Bool eq_SyscallStatus ( UInt sysno, SyscallStatus* s1, SyscallStatus* s2 )
{
/* was: return s1->what == s2->what && sr_EQ( s1->sres, s2->sres ); */
- if (s1->what == s2->what && sr_EQ( s1->sres, s2->sres ))
+ if (s1->what == s2->what && sr_EQ( sysno, s1->sres, s2->sres ))
return True;
# if defined(VGO_darwin)
/* Darwin-specific debugging guff */
@@ -1858,9 +1858,15 @@
previously written the result into the guest state. */
vg_assert(sci->status.what == SsComplete);
+ /* Get the system call number. Because the pre-handler isn't
+ allowed to mess with it, it should be the same for both the
+ original and potentially-modified args. */
+ vg_assert(sci->args.sysno == sci->orig_args.sysno);
+ sysno = sci->args.sysno;
+
getSyscallStatusFromGuestState( &test_status, &tst->arch.vex );
if (!(sci->flags & SfNoWriteResult))
- vg_assert(eq_SyscallStatus( &sci->status, &test_status ));
+ vg_assert(eq_SyscallStatus( sysno, &sci->status, &test_status ));
/* Failure of the above assertion on Darwin can indicate a problem
in the syscall wrappers that pre-fail or pre-succeed the
syscall, by calling SET_STATUS_Success or SET_STATUS_Failure,
@@ -1872,18 +1878,12 @@
comment is completely irrelevant. */
/* Ok, looks sane */
- /* Get the system call number. Because the pre-handler isn't
- allowed to mess with it, it should be the same for both the
- original and potentially-modified args. */
- vg_assert(sci->args.sysno == sci->orig_args.sysno);
- sysno = sci->args.sysno;
- ent = get_syscall_entry(sysno);
-
/* pre: status == Complete (asserted above) */
/* Consider either success or failure. Now run the post handler if:
- it exists, and
- Success or (Failure and PostOnFail is set)
*/
+ ent = get_syscall_entry(sysno);
if (ent->after
&& ((!sr_isError(sci->status.sres))
|| (sr_isError(sci->status.sres)
Modified: trunk/coregrind/m_vkiscnums.c
==============================================================================
--- trunk/coregrind/m_vkiscnums.c (original)
+++ trunk/coregrind/m_vkiscnums.c Wed Jul 8 18:08:23 2015
@@ -52,6 +52,19 @@
return buf;
}
+/* include/pub_tool_basics.h hardcodes the following syscall numbers
+ on mips{32,64}-linux so as to avoid a module cycle. We make that
+ safe here by causing the build to fail if those numbers should ever
+ change. See comments in function sr_EQ in the mips{32,64}-linux
+ section of include/pub_tool_basics.h for more details. */
+#if defined(VGP_mips32_linux)
+STATIC_ASSERT(__NR_pipe == 4042);
+STATIC_ASSERT(__NR_pipe2 == 4328);
+#elsif defined(VGP_mips64_linux)
+STATIC_ASSERT(__NR_pipe == 5021);
+STATIC_ASSERT(__NR_pipe2 == 5287);
+#endif
+
//---------------------------------------------------------------------------
#elif defined(VGO_darwin)
//---------------------------------------------------------------------------
Modified: trunk/coregrind/pub_core_syscall.h
==============================================================================
--- trunk/coregrind/pub_core_syscall.h (original)
+++ trunk/coregrind/pub_core_syscall.h Wed Jul 8 18:08:23 2015
@@ -90,6 +90,11 @@
extern SysRes VG_(mk_SysRes_Error) ( UWord val );
extern SysRes VG_(mk_SysRes_Success) ( UWord val );
+#if defined(VGP_mips32_linux) || defined(VGP_mips64_linux)
+/* On Linux/MIPS, VG_(mk_SysRes_Success) sets the second result word
+ to zero. Here is a version that allows setting both values. */
+extern SysRes VG_(mk_SysRes_SuccessEx) ( UWord val, UWord valEx );
+#endif
/* Return a string which gives the name of an error value. Note,
Modified: trunk/include/pub_tool_basics.h
==============================================================================
--- trunk/include/pub_tool_basics.h (original)
+++ trunk/include/pub_tool_basics.h Wed Jul 8 18:08:23 2015
@@ -130,11 +130,19 @@
typedef UInt ThreadId;
/* An abstraction of syscall return values.
- Linux:
+ Linux/MIPS32 and Linux/MIPS64:
+ When _isError == False,
+ _val and possible _valEx hold the return value. Whether
+ _valEx actually holds a valid value depends on which syscall
+ this SysRes holds of the result of.
+ When _isError == True,
+ _val holds the error code.
+
+ Linux/other:
When _isError == False,
_val holds the return value.
When _isError == True,
- _err holds the error code.
+ _val holds the error code.
Darwin:
Interpretation depends on _mode:
@@ -150,16 +158,24 @@
update both {R,E}DX and {R,E}AX (in guest state) given a SysRes,
if we're required to.
*/
-#if defined(VGO_linux)
+#if defined(VGP_mips32_linux) || defined(VGP_mips64_linux)
typedef
struct {
Bool _isError;
UWord _val;
-#if defined(VGA_mips64) || defined(VGA_mips32)
UWord _valEx;
-#endif
}
SysRes;
+
+#elif defined(VGO_linux) \
+ && !defined(VGP_mips32_linux) && !defined(VGP_mips64_linux)
+typedef
+ struct {
+ Bool _isError;
+ UWord _val;
+ }
+ SysRes;
+
#elif defined(VGO_darwin)
typedef
enum {
@@ -176,6 +192,7 @@
SysResMode _mode;
}
SysRes;
+
#else
# error "Unknown OS"
#endif
@@ -183,7 +200,7 @@
/* ---- And now some basic accessor functions for it. ---- */
-#if defined(VGO_linux)
+#if defined(VGP_mips32_linux) || defined(VGP_mips64_linux)
static inline Bool sr_isError ( SysRes sr ) {
return sr._isError;
@@ -191,18 +208,52 @@
static inline UWord sr_Res ( SysRes sr ) {
return sr._isError ? 0 : sr._val;
}
-#if defined(VGA_mips64) || defined(VGA_mips32)
static inline UWord sr_ResEx ( SysRes sr ) {
return sr._isError ? 0 : sr._valEx;
}
-#endif
static inline UWord sr_Err ( SysRes sr ) {
return sr._isError ? sr._val : 0;
}
-// FIXME: this function needs to be fixed for MIPS
-static inline Bool sr_EQ ( SysRes sr1, SysRes sr2 ) {
+static inline Bool sr_EQ ( UInt sysno, SysRes sr1, SysRes sr2 ) {
+ /* This uglyness of hardcoding syscall numbers is necessary to
+ avoid having this header file be dependant on
+ include/vki/vki-scnums-mips{32,64}-linux.h. It seems pretty
+ safe given that it is inconceivable that the syscall numbers
+ for such simple syscalls would ever change. To make it
+ really safe, coregrind/m_vkiscnums.c static-asserts that these
+ syscall numbers haven't changed, so that the build wil simply
+ fail if they ever do. */
+# if defined(VGP_mips32_linux)
+ const UInt __nr_Linux = 4000;
+ const UInt __nr_pipe = __nr_Linux + 42;
+ const UInt __nr_pipe2 = __nr_Linux + 328;
+# else
+ const UInt __nr_Linux = 5000;
+ const UInt __nr_pipe = __nr_Linux + 21;
+ const UInt __nr_pipe2 = __nr_Linux + 287;
+# endif
+ Bool useEx = sysno == __nr_pipe || sysno == __nr_pipe2;
+ return sr1._val == sr2._val
+ && (useEx ? (sr1._valEx == sr2._valEx) : True)
+ && sr1._isError == sr2._isError;
+}
+
+#elif defined(VGO_linux) \
+ && !defined(VGP_mips32_linux) && !defined(VGP_mips64_linux)
+
+static inline Bool sr_isError ( SysRes sr ) {
+ return sr._isError;
+}
+static inline UWord sr_Res ( SysRes sr ) {
+ return sr._isError ? 0 : sr._val;
+}
+static inline UWord sr_Err ( SysRes sr ) {
+ return sr._isError ? sr._val : 0;
+}
+static inline Bool sr_EQ ( UInt sysno, SysRes sr1, SysRes sr2 ) {
+ /* sysno is ignored for Linux/not-MIPS */
return sr1._val == sr2._val
- && sr1._isError == sr2._isError;
+ && sr1._isError == sr2._isError;
}
#elif defined(VGO_darwin)
@@ -259,7 +310,8 @@
}
}
-static inline Bool sr_EQ ( SysRes sr1, SysRes sr2 ) {
+static inline Bool sr_EQ ( UInt sysno, SysRes sr1, SysRes sr2 ) {
+ /* sysno is ignored for Darwin */
return sr1._mode == sr2._mode
&& sr1._wLO == sr2._wLO && sr1._wHI == sr2._wHI;
}
|
|
From: <sv...@va...> - 2015-07-08 13:47:06
|
Author: rhyskidd
Date: Wed Jul 8 14:46:57 2015
New Revision: 15403
Log:
Preliminary support for OS X 10.11 (El Capitan). Refer BZ#348909 for ongoing work.
Added:
trunk/darwin15.supp
Modified:
trunk/Makefile.am
trunk/configure.ac
trunk/coregrind/fixup_macho_loadcmds.c
trunk/coregrind/m_main.c
trunk/coregrind/m_syswrap/priv_syswrap-darwin.h
trunk/coregrind/m_syswrap/syswrap-amd64-darwin.c
trunk/coregrind/m_syswrap/syswrap-darwin.c
trunk/coregrind/m_syswrap/syswrap-x86-darwin.c
trunk/include/vki/vki-scnums-darwin.h
trunk/shared/vg_replace_strmem.c
Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am (original)
+++ trunk/Makefile.am Wed Jul 8 14:46:57 2015
@@ -45,7 +45,7 @@
exp-sgcheck.supp \
darwin9.supp darwin9-drd.supp \
darwin10.supp darwin10-drd.supp \
- darwin11.supp darwin12.supp darwin13.supp darwin14.supp \
+ darwin11.supp darwin12.supp darwin13.supp darwin14.supp darwin15.supp \
bionic.supp
DEFAULT_SUPP_FILES = @DEFAULT_SUPP@
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Wed Jul 8 14:46:57 2015
@@ -154,7 +154,7 @@
# Note: m4 arguments are quoted with [ and ] so square brackets in shell
# statements have to be quoted.
case "${is_clang}-${gcc_version}" in
- applellvm-5.1|applellvm-6.*)
+ applellvm-5.1|applellvm-6.*|applellvm-7.*)
AC_MSG_RESULT([ok (Apple LLVM version ${gcc_version})])
;;
icc-1[[3-9]].*)
@@ -352,6 +352,7 @@
AC_DEFINE([DARWIN_10_8], 100800, [DARWIN_VERS value for Mac OS X 10.8])
AC_DEFINE([DARWIN_10_9], 100900, [DARWIN_VERS value for Mac OS X 10.9])
AC_DEFINE([DARWIN_10_10], 101000, [DARWIN_VERS value for Mac OS X 10.10])
+ AC_DEFINE([DARWIN_10_11], 101100, [DARWIN_VERS value for Mac OS X 10.11])
AC_MSG_CHECKING([for the kernel version])
kernel=`uname -r`
@@ -409,9 +410,15 @@
DEFAULT_SUPP="darwin14.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
;;
+ 15.*)
+ AC_MSG_RESULT([Darwin 15.x (${kernel}) / Mac OS X 10.11 El Capitan])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_11, [Darwin / Mac OS X version])
+ DEFAULT_SUPP="darwin15.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
*)
AC_MSG_RESULT([unsupported (${kernel})])
- AC_MSG_ERROR([Valgrind works on Darwin 10.x, 11.x, 12.x, 13.x and 14.x (Mac OS X 10.6/7/8/9/10)])
+ AC_MSG_ERROR([Valgrind works on Darwin 10.x, 11.x, 12.x, 13.x, 14.x and 15.x (Mac OS X 10.6/7/8/9/10/11)])
;;
esac
;;
Modified: trunk/coregrind/fixup_macho_loadcmds.c
==============================================================================
--- trunk/coregrind/fixup_macho_loadcmds.c (original)
+++ trunk/coregrind/fixup_macho_loadcmds.c Wed Jul 8 14:46:57 2015
@@ -121,7 +121,8 @@
#include "config.h"
#if DARWIN_VERS != DARWIN_10_5 && DARWIN_VERS != DARWIN_10_6 \
&& DARWIN_VERS != DARWIN_10_7 && DARWIN_VERS != DARWIN_10_8 \
- && DARWIN_VERS != DARWIN_10_9 && DARWIN_VERS != DARWIN_10_10
+ && DARWIN_VERS != DARWIN_10_9 && DARWIN_VERS != DARWIN_10_10 \
+ && DARWIN_VERS != DARWIN_10_11
# error "Unknown DARWIN_VERS value. This file only compiles on Darwin."
#endif
@@ -555,7 +556,7 @@
maybe_mash_pagezero:
/* Deal with Problem (2) as documented above. */
-# if DARWIN_VERS == DARWIN_10_10
+# if DARWIN_VERS >= DARWIN_10_10
assert(size == 64);
if (!seg__pagezero) {
fail("Can't find __PAGEZERO to modify; can't continue.");
Modified: trunk/coregrind/m_main.c
==============================================================================
--- trunk/coregrind/m_main.c (original)
+++ trunk/coregrind/m_main.c Wed Jul 8 14:46:57 2015
@@ -3864,9 +3864,9 @@
/*=== Dummy _voucher_mach_msg_set for OSX 10.10 ===*/
/*====================================================================*/
-#if defined(VGO_darwin) && DARWIN_VERS == DARWIN_10_10
+#if defined(VGO_darwin) && DARWIN_VERS >= DARWIN_10_10
-/* Builds on MacOSX 10.10 seem to need this for some reason. */
+/* Builds on MacOSX 10.10+ seem to need this for some reason. */
/* extern boolean_t voucher_mach_msg_set(mach_msg_header_t *msg)
__attribute__((weak_import));
I haven't a clue what the return value means, so just return 0.
Modified: trunk/coregrind/m_syswrap/priv_syswrap-darwin.h
==============================================================================
--- trunk/coregrind/m_syswrap/priv_syswrap-darwin.h (original)
+++ trunk/coregrind/m_syswrap/priv_syswrap-darwin.h Wed Jul 8 14:46:57 2015
@@ -335,7 +335,7 @@
#if DARWIN_VERS < DARWIN_10_10
// NYI sem_getvalue 274
-#elif DARWIN_VERS == DARWIN_10_10
+#elif DARWIN_VERS >= DARWIN_10_10
DECL_TEMPLATE(darwin, sysctlbyname); // 274
#endif
@@ -506,10 +506,10 @@
// NYI audit_session_port 432
// NYI pid_suspend 433
// NYI pid_resume 434
-#if DARWIN_VERS == DARWIN_10_10
+#if DARWIN_VERS >= DARWIN_10_10
// NYI pid_hibernate 435
// NYI pid_shutdown_sockets 436
-#endif /* DARWIN_VERS == DARWIN_10_10 */
+#endif /* DARWIN_VERS >= DARWIN_10_10 */
// old old shared_region_slide_np 437
// NYI shared_region_map_and_slide_np // 438
// NYI kas_info // 439
@@ -529,7 +529,7 @@
// NYI memorystatus_get_level // 453
// NYI system_override // 454
// NYI vfs_purge // 455
-#if DARWIN_VERS == DARWIN_10_10
+#if DARWIN_VERS >= DARWIN_10_10
// NYI sfi_ctl // 456
// NYI sfi_pidctl // 457
// NYI coalition // 458
@@ -564,7 +564,7 @@
DECL_TEMPLATE(darwin, guarded_writev_np); // 487
// NYI rename_ext // 488
// NYI mremap_encrypted // 489
-#endif /* DARWIN_VERS == DARWIN_10_10 */
+#endif /* DARWIN_VERS >= DARWIN_10_10 */
// Mach message helpers
DECL_TEMPLATE(darwin, mach_port_set_context);
Modified: trunk/coregrind/m_syswrap/syswrap-amd64-darwin.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-amd64-darwin.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-amd64-darwin.c Wed Jul 8 14:46:57 2015
@@ -464,7 +464,7 @@
out just the relevant parts. Hence: */
# if DARWIN_VERS <= DARWIN_10_7
Bool is_reuse = reuse != 0;
-# elif DARWIN_VERS == DARWIN_10_8 || DARWIN_VERS == DARWIN_10_9 || DARWIN_VERS == DARWIN_10_10
+# elif DARWIN_VERS > DARWIN_10_7
Bool is_reuse = (reuse & 0x20000 /* == WQ_FLAG_THREAD_REUSE */) != 0;
# else
# error "Unsupported Darwin version"
@@ -479,7 +479,7 @@
UWord magic_delta = 0;
# elif DARWIN_VERS == DARWIN_10_7 || DARWIN_VERS == DARWIN_10_8
UWord magic_delta = 0x60;
-# elif DARWIN_VERS == DARWIN_10_9 || DARWIN_VERS == DARWIN_10_10
+# elif DARWIN_VERS == DARWIN_10_9 || DARWIN_VERS == DARWIN_10_10 || DARWIN_VERS == DARWIN_10_11
UWord magic_delta = 0xE0;
# else
# error "magic_delta: to be computed on new OS version"
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c Wed Jul 8 14:46:57 2015
@@ -8284,7 +8284,7 @@
// GrP fixme handle sender-specified message trailer
// (but is this only for too-secure processes?)
// JRS 11 Nov 2014: this assertion is OK for <= 10.9 but fails on 10.10
-# if DARWIN_VERS == DARWIN_10_10
+# if DARWIN_VERS >= DARWIN_10_10
if (mh->msgh_bits & MACH_SEND_TRAILER) {
log_decaying("UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option");
}
Modified: trunk/coregrind/m_syswrap/syswrap-x86-darwin.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-x86-darwin.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-x86-darwin.c Wed Jul 8 14:46:57 2015
@@ -412,7 +412,7 @@
out just the relevant parts. Hence: */
# if DARWIN_VERS <= DARWIN_10_7
Bool is_reuse = reuse != 0;
-# elif DARWIN_VERS == DARWIN_10_8 || DARWIN_VERS == DARWIN_10_9 || DARWIN_VERS == DARWIN_10_10
+# elif DARWIN_VERS > DARWIN_10_7
Bool is_reuse = (reuse & 0x20000 /* == WQ_FLAG_THREAD_REUSE */) != 0;
# else
# error "Unsupported Darwin version"
@@ -427,7 +427,7 @@
UWord magic_delta = 0;
# elif DARWIN_VERS == DARWIN_10_7 || DARWIN_VERS == DARWIN_10_8
UWord magic_delta = 0x48;
-# elif DARWIN_VERS == DARWIN_10_9 || DARWIN_VERS == DARWIN_10_10
+# elif DARWIN_VERS == DARWIN_10_9 || DARWIN_VERS == DARWIN_10_10 || DARWIN_VERS == DARWIN_10_11
UWord magic_delta = 0xB0;
# else
# error "magic_delta: to be computed on new OS version"
Added: trunk/darwin15.supp
==============================================================================
--- trunk/darwin15.supp (added)
+++ trunk/darwin15.supp Wed Jul 8 14:46:57 2015
@@ -0,0 +1,750 @@
+
+# Suppressions for Darwin 15.x / Mac OS X 10.11 El Capitan
+
+############################################
+## Leaks. For other stuff see below.
+
+{
+ OSX1011:1-Leak
+ Memcheck:Leak
+ match-leak-kinds: possible
+ fun:malloc_zone_?alloc
+ ...
+ fun:_read_images
+}
+
+#{
+# OSX1011:2-Leak
+# Memcheck:Leak
+# match-leak-kinds: definite
+# fun:?alloc
+# ...
+# fun:_ZN4dyld24initializeMainExecutableEv
+#}
+
+{
+ OSX1011:3-Leak
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:malloc_zone_?alloc
+ fun:recursive_mutex_init
+ ...
+ fun:_os_object_init
+ fun:libdispatch_init
+ fun:libSystem_initializer
+ ...
+}
+
+#{
+# OSX1011:4-Leak
+# Memcheck:Leak
+# match-leak-kinds: reachable
+# fun:malloc_zone_?alloc
+# ...
+# fun:dyld_register_image_state_change_handler
+# ...
+#}
+
+{
+ OSX1011:5-Leak
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:?alloc
+ ...
+ fun:dyld_register_image_state_change_handler
+ ...
+}
+
+{
+ OSX1011:6-Leak
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc_zone_?alloc
+ ...
+ fun:map_images_nolock
+ fun:map_hax_images
+ ...
+}
+
+{
+ OSX1011:7-Leak
+ Memcheck:Leak
+ match-leak-kinds: possible
+ fun:malloc_zone_?alloc
+ ...
+ fun:map_images_nolock
+ fun:map_hax_images
+ ...
+}
+
+{
+ OSX1011:8-Leak
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:?alloc
+ ...
+ fun:libSystem_initializer
+ ...
+}
+
+{
+ OSX1011:9-Leak
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc_zone_?alloc
+ ...
+ fun:libSystem_initializer
+ ...
+}
+
+{
+ OSX1011:10-Leak
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:?alloc
+ ...
+ fun:libSystem_initializer
+ ...
+}
+
+#{
+# OSX1011:11-Leak
+# Memcheck:Leak
+# match-leak-kinds: definite
+# fun:malloc
+# fun:currentlocale
+#}
+#
+#{
+# OSX1011:12-Leak
+# Memcheck:Leak
+# match-leak-kinds: possible
+# fun:malloc
+# fun:tzsetwall_basic
+# fun:_st_tzset_basic
+#}
+
+{
+ OSX1011:13-Leak
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc_zone_memalign
+ ...
+ fun:_ZN4dyld24initializeMainExecutableEv
+ ...
+}
+
+{
+ OSX1011:14-Leak
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:?alloc
+ ...
+ fun:libSystem_atfork_child
+ ...
+}
+
+{
+ OSX1011:15-Leak
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc
+ fun:__smakebuf
+ ...
+ fun:printf
+ ...
+}
+
+{
+ OSX1011:16-Leak
+ Memcheck:Leak
+ match-leak-kinds: possible
+ fun:?alloc
+ ...
+ fun:_read_images
+}
+
+{
+ OSX1011:17-Leak
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:?alloc
+ ...
+ fun:_read_images
+}
+
+{
+ OSX1011:18-Leak
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc_zone_?alloc
+ ...
+ fun:_read_images
+}
+
+{
+ OSX1011:19-Leak
+ Memcheck:Leak
+ match-leak-kinds: possible
+ fun:malloc_zone_?alloc
+ ...
+ fun:*NX*Map*
+ fun:*NX*Map*
+}
+
+{
+ OSX1011:20-Leak
+ Memcheck:Leak
+ match-leak-kinds: indirect
+ fun:?alloc
+ ...
+ fun:libSystem_initializer
+ ...
+}
+
+
+############################################
+## Non-leak errors
+
+##{
+## OSX1011:CoreFoundation-1
+## Memcheck:Cond
+## obj:*CoreFoundation.framework*CoreFoundation*
+## obj:*CoreFoundation.framework*CoreFoundation*
+## obj:*CoreFoundation.framework*CoreFoundation*
+##}
+
+{
+ OSX1011:CoreFoundation-2
+ Memcheck:Cond
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*libdispatch.dylib*
+ obj:*libdispatch.dylib*
+}
+
+{
+ OSX1011:CoreFoundation-3
+ Memcheck:Cond
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*Foundation.framework*Foundation*
+}
+
+{
+ OSX1011:CoreFoundation-4
+ Memcheck:Cond
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*SystemConfiguration.framework*SystemConfiguration*
+}
+
+{
+ OSX1011:CoreFoundation-5
+ Memcheck:Cond
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*HIServices.framework*HIServices*
+}
+
+{
+ OSX1011:CoreFoundation-6
+ Memcheck:Cond
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*SystemConfiguration.framework*SystemConfiguration*
+ obj:*SystemConfiguration.framework*SystemConfiguration*
+}
+
+{
+ OSX1011:CoreFoundation-7
+ Memcheck:Cond
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*SystemConfiguration.framework*SystemConfiguration*
+ obj:*CoreFoundation.framework*CoreFoundation*
+}
+
+{
+ OSX1011:CoreFoundation-8
+ Memcheck:Cond
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*IOKit.framework*IOKit*
+}
+
+{
+ OSX1011:CoreFoundation-9
+ Memcheck:Cond
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*Foundation.framework*Foundation*
+ obj:*AppKit.framework*AppKit*
+}
+
+{
+ OSX1011:CoreFoundation-10
+ Memcheck:Cond
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*HIToolbox.framework*HIToolbox*
+ obj:*HIToolbox.framework*HIToolbox*
+}
+
+{
+ OSX1011:CoreFoundation-11
+ Memcheck:Cond
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*AE.framework*AE*
+ obj:*AE.framework*AE*
+}
+
+{
+ OSX1011:CoreFoundation-12
+ Memcheck:Cond
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*HIToolbox.framework*HIToolbox*
+}
+
+{
+ OSX1011:CoreFoundation-13
+ Memcheck:Cond
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*CoreFoundation.framework*CoreFoundation*
+ obj:*AE.framework*AE*
+}
+
+{
+ OSX1011:AppKit-1
+ Memcheck:Cond
+ obj:*AppKit.framework*AppKit*
+ obj:*AppKit.framework*AppKit*
+ obj:*AppKit.framework*AppKit*
+}
+
+{
+ OSX1011:AppKit-2
+ Memcheck:Cond
+ obj:*AppKit.framework*AppKit*
+ obj:*AppKit.framework*AppKit*
+ obj:*libdispatch.dylib*
+}
+
+#{
+# OSX1011:AppKit-3
+# Memcheck:Cond
+# obj:*AppKit.framework*AppKit*
+# obj:*libdispatch.dylib*
+# obj:*libdispatch.dylib*
+#}
+
+##{
+## OSX1011:AppKit-4
+## Memcheck:Cond
+## obj:*AppKit.framework*AppKit*
+## obj:*AppKit.framework*AppKit*
+## obj:*CoreFoundation.framework*CoreFoundation*
+##}
+
+{
+ OSX1011:AppKit-5
+ Memcheck:Cond
+ obj:*AppKit.framework*AppKit*
+ obj:*AppKit.framework*AppKit*
+ obj:*Foundation.framework*Foundation*
+}
+
+{
+ OSX1011:AppKit-6
+ Memcheck:Cond
+ obj:*AppKit.framework*AppKit*
+ obj:*Foundation.framework*Foundation*
+ obj:*AppKit.framework*AppKit*
+}
+
+{
+ OSX1011:AppKit-7
+ Memcheck:Cond
+ obj:*AppKit.framework*AppKit*
+ obj:*libdispatch.dylib*
+ obj:*libdispatch.dylib*
+}
+
+{
+ OSX1011:AppKit-8
+ Memcheck:Cond
+ obj:*AppKit.framework*AppKit*
+ obj:*Foundation.framework*Foundation*
+ obj:*Foundation.framework*Foundation*
+}
+
+{
+ OSX1011:ColorSync-1
+ Memcheck:Cond
+ obj:*ColorSync.framework*ColorSync*
+ obj:*ColorSync.framework*ColorSync*
+ obj:*ColorSync.framework*ColorSync*
+}
+
+#{
+# OSX1011:ColorSync-2
+# Memcheck:Value8
+# obj:*ColorSync.framework*ColorSync*
+# obj:*ColorSync.framework*ColorSync*
+# obj:*ColorSync.framework*ColorSync*
+#}
+
+{
+ OSX1011:CoreGraphics-1
+ Memcheck:Cond
+ obj:*CoreGraphics.framework*CoreGraphics*
+ obj:*CoreGraphics.framework*CoreGraphics*
+}
+
+#{
+# OSX1011:CoreGraphics-2
+# Memcheck:Value8
+# obj:*CoreGraphics.framework*CoreGraphics*
+# obj:*CoreGraphics.framework*CoreGraphics*
+# obj:*CoreGraphics.framework*CoreGraphics*
+#}
+
+{
+ OSX1011:CoreGraphics-3
+ Memcheck:Cond
+ obj:*CoreGraphics.framework*CoreGraphics*
+ obj:*CoreGraphics.framework*libRIP*
+ obj:*CoreGraphics.framework*libRIP*
+}
+
+#{
+# OSX1011:CoreGraphics-4
+# Memcheck:Cond
+# obj:*CoreGraphics.framework*CoreGraphics*
+# obj:*CoreGraphics.framework*CoreGraphics*
+# obj:*CoreGraphics.framework*libRIP*
+#}
+
+{
+ OSX1011:CoreGraphics-5
+ Memcheck:Cond
+ obj:*CoreGraphics.framework*CoreGraphics*
+ obj:*libdispatch.dylib*
+ obj:*libdispatch.dylib*
+}
+
+#{
+# OSX1011:CoreGraphics-6
+# Memcheck:Cond
+# obj:*CoreGraphics.framework*CoreGraphics*
+# obj:*CoreGraphics.framework*CoreGraphics*
+# obj:*HIToolbox.framework*HIToolbox*
+#}
+
+{
+ OSX1011:HIServices-1
+ Memcheck:Cond
+ obj:*HIServices.framework*HIServices*
+ obj:*HIToolbox.framework*HIToolbox*
+ obj:*HIToolbox.framework*HIToolbox*
+}
+
+{
+ OSX1011:LaunchServices-1
+ Memcheck:Cond
+ obj:*LaunchServices.framework*LaunchServices*
+ obj:*AppKit.framework*AppKit*
+ obj:*AppKit.framework*AppKit*
+}
+
+{
+ OSX1011:LaunchServices-2
+ Memcheck:Cond
+ obj:*LaunchServices.framework*LaunchServices*
+ obj:*libdispatch.dylib*
+ obj:*libdispatch.dylib*
+}
+
+{
+ OSX1011:QuartzCore-1
+ Memcheck:Cond
+ obj:*QuartzCore.framework*QuartzCore
+ obj:*QuartzCore.framework*QuartzCore
+ obj:*QuartzCore.framework*QuartzCore
+}
+
+#{
+# OSX1011:vImage-1
+# Memcheck:Cond
+# obj:*vImage.framework*vImage*
+# obj:*vImage.framework*vImage*
+# obj:*CoreGraphics.framework*CoreGraphics*
+#}
+
+{
+ OSX1011:zlib-C
+ Memcheck:Cond
+ obj:/usr/lib/libz.*dylib
+ obj:/usr/lib/libz.*dylib
+}
+
+{
+ OSX1011:zlib-8
+ Memcheck:Value8
+ obj:/usr/lib/libz.*dylib
+ obj:/usr/lib/libz.*dylib
+}
+
+#{
+# OSX1011:32bit:_libxpc_initializer
+# Memcheck:Cond
+# fun:_libxpc_initializer
+# fun:libSystem_initializer
+# fun:*ImageLoaderMachO*doModInitFunctions*
+#}
+
+{
+ OSX1011:dyld-1
+ Memcheck:Cond
+ fun:*ImageLoader*weakBind*
+ fun:*ImageLoader*link*
+ fun:*dyld*link*
+}
+
+{
+ OSX1011:dyld-2
+ Memcheck:Cond
+ fun:exit
+ obj:*libdyld*dylib*
+}
+
+{
+ OSX1011:libsystem_kernel-1
+ Memcheck:Cond
+ obj:*libsystem_kernel*dylib*
+ obj:*libsystem_kernel*dylib*
+ obj:*CoreFoundation.framework*CoreFoundation*
+}
+
+{
+ OSX1011:CoreServicesInternal-1
+ Memcheck:Cond
+ obj:*CoreServicesInternal.framework*CoreServicesInternal*
+ obj:*CoreServices.framework*LaunchServices*
+ obj:*CoreServices.framework*LaunchServices*
+}
+
+{
+ OSX1011:CoreServicesInternal-2
+ Memcheck:Cond
+ obj:*CoreServicesInternal.framework*CoreServicesInternal*
+ obj:*CoreServicesInternal.framework*CoreServicesInternal*
+ obj:*CoreServicesInternal.framework*CoreServicesInternal*
+}
+
+{
+ OSX1011:CoreServicesInternal-3
+ Memcheck:Cond
+ obj:*CoreServicesInternal.framework*CoreServicesInternal*
+ obj:*CoreServicesInternal.framework*CoreServicesInternal*
+ obj:*CoreFoundation.framework*CoreFoundation*
+}
+
+{
+ OSX1011:CoreServices-1
+ Memcheck:Cond
+ obj:*CoreServices.framework*LaunchServices*
+ obj:*CoreServices.framework*LaunchServices*
+ obj:*CoreServices.framework*LaunchServices*
+}
+
+##{
+## OSX1011:libsystem_pthread-1
+## Memcheck:Cond
+## obj:*libsystem_pthread*dylib*
+## obj:*ImageIO.framework*ImageIO*
+## obj:*ImageIO.framework*ImageIO*
+##}
+
+{
+ OSX1011:ApplicationServices-1
+ Memcheck:Cond
+ obj:*ApplicationServices.framework*ATS*
+ obj:*libsystem_pthread*dylib*
+ obj:*libsystem_platform*dylib*
+}
+
+{
+ OSX1011:HIToolbox-1
+ Memcheck:Cond
+ obj:*HIToolbox.framework*HIToolbox*
+ obj:*HIToolbox.framework*HIToolbox*
+ obj:*HIToolbox.framework*HIToolbox*
+}
+
+{
+ OSX1011:RawCamera-1
+ Memcheck:Cond
+ obj:*RawCamera.bundle*RawCamera*
+ obj:*libdispatch.dylib*
+ obj:*libdispatch.dylib*
+}
+
+##{
+## OSX1011:CoreImage-1
+## Memcheck:Cond
+## obj:*CoreImage.framework*CoreImage*
+## obj:*CoreImage.framework*CoreImage*
+## obj:*CoreImage.framework*CoreImage*
+##}
+
+##{
+## OSX1011:strncpy-1
+## Memcheck:Cond
+## fun:strncpy
+## obj:*CoreServicesInternal.framework*CoreServicesInternal
+## obj:*CoreServicesInternal.framework*CoreServicesInternal
+##}
+
+{
+ OSX1011:pthread_rwlock_init
+ Memcheck:Cond
+ fun:pthread_rwlock_init
+ obj:*ImageIO.framework*ImageIO*
+ obj:*ImageIO.framework*ImageIO*
+}
+
+{
+ OSX1011:CFBasicHash
+ Memcheck:Value8
+ fun:*CFBasicHash*
+ fun:*CF*
+}
+
+{
+ OSX1011:AppleIntelHD4000GraphicsGLDriver-1-Addr8
+ Memcheck:Addr8
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+}
+{
+ OSX1011:AppleIntelHD4000GraphicsGLDriver-1-Addr8
+ Memcheck:Addr4
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+}
+
+{
+ OSX1011:AppleIntelHD4000GraphicsGLDriver-2-Addr8
+ Memcheck:Addr8
+ fun:*platform_memmove*
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+}
+{
+ OSX1011:AppleIntelHD4000GraphicsGLDriver-2-Addr2
+ Memcheck:Addr2
+ fun:*platform_memmove*
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+}
+
+{
+ OSX1011:AppleIntelHD4000GraphicsGLDriver-3-Addr8
+ Memcheck:Addr8
+ fun:*platform_memmove*
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+ obj:*GLEngine.bundle*GLEngine*
+}
+{
+ OSX1011:AppleIntelHD4000GraphicsGLDriver-3-Addr2
+ Memcheck:Addr2
+ fun:*platform_memmove*
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+ obj:*GLEngine.bundle*GLEngine*
+}
+{
+ OSX1011:AppleIntelHD4000GraphicsGLDriver-3-Addr1
+ Memcheck:Addr1
+ fun:*platform_memmove*
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+ obj:*GLEngine.bundle*GLEngine*
+}
+
+{
+ OSX1011:AppleIntelHD4000GraphicsGLDriver-4
+ Memcheck:Addr8
+ fun:*platform_bzero*
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+}
+
+{
+ OSX1011:AppleIntelHD4000GraphicsGLDriver-6-Addr8
+ Memcheck:Addr8
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+ obj:*GLEngine.bundle*GLEngine*
+}
+{
+ OSX1011:AppleIntelHD4000GraphicsGLDriver-6-Addr4
+ Memcheck:Addr4
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+ obj:*GLEngine.bundle*GLEngine*
+}
+
+{
+ OSX1011:AppleIntelHD4000GraphicsGLDriver-7
+ Memcheck:Addr4
+ obj:*AppleIntelHD4000GraphicsGLDriver.bundle*AppleIntelHD4000GraphicsGLDriver*
+ obj:*GLEngine.bundle*GLEngine*
+}
+
+{
+ OSX1011:OSAtomicAdd32
+ Memcheck:Addr4
+ fun:*OSAtomicAdd32*
+ obj:*IOAccelerator.framework*IOAccelerator*
+ obj:*GPUSupport.framework*GPUSupportMercury*
+}
+
+{
+ OSX1011:IOAccelerator-1
+ Memcheck:Addr4
+ obj:*IOAccelerator.framework*IOAccelerator*
+ obj:*GPUSupport.framework*GPUSupportMercury*
+}
+
+{
+ OSX1011:mach_msg_trap-1
+ Memcheck:Param
+ msg->desc.port.name
+ fun:mach_msg_trap
+ obj:*libsystem_kernel.dylib*
+ obj:*SystemConfiguration.framework*SystemConfiguration*
+}
+
+{
+ OSX1011:mach_msg_trap-2
+ Memcheck:Param
+ msg->desc.port.name
+ fun:mach_msg_trap
+ obj:*SystemConfiguration.framework*SystemConfiguration*
+ obj:*SystemConfiguration.framework*SystemConfiguration*
+}
+
+# See https://bugs.kde.org/show_bug.cgi?id=188572 about this; it's
+# unavoidable due to BSD setenv() semantics.
+{
+ macos-__setenv-leak-see-our-bug-188572
+ Memcheck:Leak
+ match-leak-kinds: definite
+ fun:malloc
+ fun:_owned_ptr_alloc
+ fun:setenv
+}
+
+# See https://bugs.kde.org/show_bug.cgi?id=196528
+{
+macos-__pthread_rwlock_init-see-our-bug-196528
+Memcheck:Cond
+fun:pthread_rwlock_init
+}
Modified: trunk/include/vki/vki-scnums-darwin.h
==============================================================================
--- trunk/include/vki/vki-scnums-darwin.h (original)
+++ trunk/include/vki/vki-scnums-darwin.h Wed Jul 8 14:46:57 2015
@@ -509,7 +509,7 @@
#if DARWIN_VERS < DARWIN_10_10
#define __NR_sem_getvalue VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(274)
-#elif DARWIN_VERS == DARWIN_10_10
+#elif DARWIN_VERS >= DARWIN_10_10
#define __NR_sysctlbyname VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(274)
#endif
@@ -733,6 +733,9 @@
#define __NR_MAXSYSCALL VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(456)
#elif DARWIN_VERS == DARWIN_10_10
#define __NR_MAXSYSCALL VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(490)
+#elif DARWIN_VERS == DARWIN_10_11
+// TODO Hackish, needs properly analysis
+#define __NR_MAXSYSCALL VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(490)
#else
#error unknown darwin version
#endif
Modified: trunk/shared/vg_replace_strmem.c
==============================================================================
--- trunk/shared/vg_replace_strmem.c (original)
+++ trunk/shared/vg_replace_strmem.c Wed Jul 8 14:46:57 2015
@@ -204,7 +204,7 @@
//STRRCHR(VG_Z_DYLD, strrchr)
//STRRCHR(VG_Z_DYLD, rindex)
STRRCHR(VG_Z_LIBC_SONAME, strrchr)
-# if DARWIN_VERS == DARWIN_10_9 || DARWIN_VERS == DARWIN_10_10
+# if DARWIN_VERS >= DARWIN_10_9
STRRCHR(libsystemZucZddylib, strrchr)
# endif
@@ -245,7 +245,7 @@
# if DARWIN_VERS == DARWIN_10_9
STRCHR(libsystemZuplatformZddylib, _platform_strchr)
# endif
-# if DARWIN_VERS == DARWIN_10_10
+# if DARWIN_VERS >= DARWIN_10_10
/* _platform_strchr$VARIANT$Generic */
STRCHR(libsystemZuplatformZddylib, _platform_strchr$VARIANT$Generic)
STRCHR(libsystemZuplatformZddylib, _platform_strchr$VARIANT$Haswell)
@@ -432,7 +432,7 @@
#elif defined(VGO_darwin)
STRLEN(VG_Z_LIBC_SONAME, strlen)
-# if DARWIN_VERS == DARWIN_10_9 || DARWIN_VERS == DARWIN_10_10
+# if DARWIN_VERS >= DARWIN_10_9
STRLEN(libsystemZucZddylib, strlen)
# endif
#endif
@@ -506,7 +506,7 @@
#elif defined(VGO_darwin)
STRNCPY(VG_Z_LIBC_SONAME, strncpy)
-# if DARWIN_VERS == DARWIN_10_9 || DARWIN_VERS == DARWIN_10_10
+# if DARWIN_VERS >= DARWIN_10_9
STRNCPY(libsystemZucZddylib, strncpy)
# endif
@@ -585,7 +585,7 @@
#elif defined(VGO_darwin)
STRNCMP(VG_Z_LIBC_SONAME, strncmp)
-# if DARWIN_VERS == DARWIN_10_9 || DARWIN_VERS == DARWIN_10_10
+# if DARWIN_VERS >= DARWIN_10_9
STRNCMP(libsystemZuplatformZddylib, _platform_strncmp)
# endif
@@ -778,7 +778,7 @@
#elif defined(VGO_darwin)
STRCMP(VG_Z_LIBC_SONAME, strcmp)
-# if DARWIN_VERS == DARWIN_10_9 || DARWIN_VERS == DARWIN_10_10
+# if DARWIN_VERS >= DARWIN_10_9
STRCMP(libsystemZuplatformZddylib, _platform_strcmp)
# endif
@@ -810,7 +810,7 @@
MEMCHR(VG_Z_DYLD, memchr)
MEMCHR(libsystemZuplatformZddylib, _platform_memchr)
# endif
-# if DARWIN_VERS == DARWIN_10_10
+# if DARWIN_VERS >= DARWIN_10_10
MEMCHR(VG_Z_DYLD, memchr)
/* _platform_memchr$VARIANT$Generic */
MEMCHR(libsystemZuplatformZddylib, _platform_memchr$VARIANT$Generic)
@@ -1007,7 +1007,7 @@
MEMCMP(VG_Z_LD_SO_1, bcmp)
#elif defined(VGO_darwin)
-# if DARWIN_VERS == DARWIN_10_9 || DARWIN_VERS == DARWIN_10_10
+# if DARWIN_VERS >= DARWIN_10_9
MEMCMP(libsystemZuplatformZddylib, _platform_memcmp)
# endif
@@ -1152,7 +1152,7 @@
# endif
MEMMOVE(VG_Z_LIBC_SONAME, memmoveZDVARIANTZDsse3x) /* memmove$VARIANT$sse3x */
MEMMOVE(VG_Z_LIBC_SONAME, memmoveZDVARIANTZDsse42) /* memmove$VARIANT$sse42 */
-# if DARWIN_VERS == DARWIN_10_9 || DARWIN_VERS == DARWIN_10_10
+# if DARWIN_VERS >= DARWIN_10_9
/* _platform_memmove$VARIANT$Ivybridge */
MEMMOVE(libsystemZuplatformZddylib, ZuplatformZumemmoveZDVARIANTZDIvybridge)
# endif
|
|
From: <sv...@va...> - 2015-07-08 11:37:53
|
Author: florian
Date: Wed Jul 8 12:37:41 2015
New Revision: 15402
Log:
Attempt to represent order collection of segments with a tree
to avoid the problem described in m_aspacemgr/README.
This is work in progress. In particular, adjacent segments are
not "maximally merged" yet.
Added:
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/README
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-dot.c
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/Makefile.am
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/README
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/dot.c
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/main.c
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/read.c
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/stubs.c
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/README
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/big
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/dv (with props)
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i0:27.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i0:28.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i0:31.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i0:32.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i0:50.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i14:16.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i15:45.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i15:60.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i15:61.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i17:24.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i19:41.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i1:50.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i1:54.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i1:60.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i1:61.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i2:27.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i30:60.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i31:32.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i32:58.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i32:61.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i38:46.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i39:46.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i3:27.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i3:6.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i4:21.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i5:22.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i5:25.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i6:18.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i6:19.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i6:27.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i7:24.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i7:27.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i8:49.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/big-i9:30.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/l1-i0:30.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/l1-i0:50.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/l1-i0:60.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/l1-i20:50.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/l1-i30:100.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/l1-i30:40.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/l1-i30:80.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/l2-i25:50.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/l2-i31:50.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/r1-i51:100.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/r1-i51:80.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/r1-i60:80.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/r1-i70:100.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/r2-i0:10.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/r2-i0:50.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/r2-i10:100.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/r2-i10:20.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/r2-i10:50.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/r2-i10:60.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/r2-i20:30.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/r2-i40:50.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/r2-i51:100.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/root-i0:20.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/root-i40:50.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/golden/root-i80:100.dot
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/l1
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/l2
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/r1
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/r2
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/root
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tests/runtest (with props)
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/unit-test/tree.h
Modified:
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-segments.c
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/priv_aspacemgr.h
Added: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/README
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/README (added)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/README Wed Jul 8 12:37:41 2015
@@ -0,0 +1,340 @@
+Previous problem:
+
+Ordered collection of segments was represented with a sorted array.
+Suppose, we hold a pointer 'seg' to some segment like so:
+
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+--
+| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | | | | | | |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+--
+ ^
+ |
+ seg
+
+Suppose further that memory is allocated which causes segment #4 (a free
+segment) to be split into 2 segments X and Y. This ordered segment array
+now looks like this:
+
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+--
+| 0 | 1 | 2 | 3 | X | Y | 5 | 6 | 7 | 8 | | | | | | |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+--
+ ^
+ |
+ seg
+
+'seg' still points to the same address but the memory contents at that
+address has changed. OOPS.
+
+The data structure described below attempts to solve the problem above.
+More generally, adding, removing, or splitting a segment X will not
+modify seg unless X == seg.
+
+==========================================================================
+
+Segment tree
+
+1. Definitions
+The segment tree is a binary tree of nodes.
+Let N be a node.
+N is either a leaf node or it has two children L and R.
+Associated with each node is an interval of addresses [f:t] with f <= t.
+This means: a node represents a non-empty interval of addresses from f to t,
+inclusive and without holes.
+Notation shorthand:
+- We write (N) to denote the interval associated with node N.
+- We write N.L to denote the left subtree of N
+- We write N.R to denote the right subtree of N
+- We write (N).f to denote the "from" address in the interval
+- We write (N).t to denote the "to" address in the interval
+
+We will also use the term "segment" as a synonym for leaf node.
+
+
+1.1 Uniqueness:
+In a given tree no two nodes have the same interval.
+
+1.2 Interval relationship:
+If N is a non-leaf node with (N) = [f:t] then:
+ (N.L) = [f:x] with f <= x < t
+ (N.R) = [x+1:t]
+In other words:
+ (N).f = (N.L).f
+ (N).t = (N.R).t
+
+Note: x < t is needed to satisfy uniqueness. Suppose x = t; it follows that
+(N.L) = [f:t] = (N) which violates uniqueness.
+
+1.3 Maximally merged:
+A segment tree is called "maximally merged" if there are no two adjacent
+leaves M and N with (M).t + 1 == (N).f and maybe_merge(M,N) == True
+
+1.4 Coverage
+The segment tree completely covers the available address space.
+Leaf nodes from left to right cover the whole address space without holes.
+
+
+2. Corrolaries
+2.1 Containment:
+The interval of a child node, if any, is contained in the interval of its
+parent.
+
+2.2 Abutment:
+Let N be a non-leaf node.
+ (N.L).t + 1 = (N.R).f
+This follows directly from 1.2.
+
+
+========================================
+
+3. Tree operations
+
+3.1 Splitting a segment into two (split_segment_at)
+
+A segment is always a leaf node. Splitting a segment N with
+(N) = [f:t] at an address A with f <= A < t is easy:
+
+ Before split After split
+
+ [f:t] [f:t]
+ / \
+ / \
+ [f:A] [A+1:t]
+
+
+3.2 Adding a segment to the tree
+
+Let [p:q] be the interval of the segment being added.
+Intuitively, it is clear that adding a segment [p:q] may involve (in the
+general case):
+- splitting an existing segment at p
+- splitting a (possibly different) segment at q+1
+- removing segments [f:t] when p <= f && q <= t
+ In other words [f:t] is contained in [p:q]. Those segments will no longer
+ exist.
+- ensuring the tree is maximally merged
+
+For ease of discussion we consider the merging step as a postprocessing
+step.
+
+First, when adding a segment it is not necessary to consider all nodes in
+the tree. Only those whose interval intersects with [p:q] need to be
+considered.
+Therefore:
+
+Step #1
+Locate a node T such that [p:q] is contained in (T) and there is no
+child of T containing [p:q]. There is always such a node. Only nodes rooted
+at T need to be considered.
+
+Special case: If (T) == [p:q], then remove T and replace it with
+ the segment [p:q]. Done.
+
+General case: Let T be the node identified in step #1 with (T) = [A:D]
+ T is not a leaf.
+
+ [A:D]
+ / \
+ / \
+ [A:x] [x+1:D]
+
+Here [A:x] and [x+1:D] can be arbitrary subtrees.
+
+We now know that (T.L) = [A:x] contains p and (T.R) = [x+1:D] contains q.
+
+Step #2: Begin at T.L with (T.L) = [A:x]
+Traverse T.L. The traversal stops at a node with interval [p:...] or at
+a leaf whose interval contains p. Remove all nodes N with (N) contained in
+[p:q] along the way.
+
+Note, that during this traversal we never have to consider whether a left
+subtree of some node could possibly be removed. It cannot. Because:
+for a node N to be removed in this traversal (N).f > p must be true.
+But: a left child and its parent have the same 'from' value. Which means
+if N could be removed we would have already removed its parent and never
+reached N in the first place. It follows that left subtrees do not need
+to be considered for removal.
+
+Step #2a: Special case: A == p.
+Remove tree rooted at [A:x] and add a leaf node with interval [p:x].
+Done with step #2.
+
+Step #2b: [A:x] is a leaf; here A != p because of #2a
+Split [A:x] at p. Done with step #2.
+
+Step #2c: [A:x] is not a leaf and p > A
+Suppose its right subtree is [B:x].
+
+If B == p, remove [B:x] and replace with a new leaf node [p:x]. Done with
+step #2.
+
+If B > p, do this:
+
+ [A:D] [A:D]
+ / \ / \
+ / \ / \
+ [A:x] [x+1:D] ==> [A:x] [x+1:D]
+ / \ / \
+ / \ / \
+ [A:B-1] [B:x] [A:C] [C+1:x]
+ / \
+ / \
+[A:C] [C+1:B-1]
+
+I.e.: Remove the child nodes of [A:x], namely [A:B-1] and [B:x], make
+the childs of [A:B-1] to be the new childs of [A:x]. In the right child
+replace B-1 with x.
+In case [A:B-1] is a leaf, split it at p. After that [A:B-1] is no
+longer a leaf and above transformation can be applied.
+Repeat step #2c.
+
+Step #2d: Node [B:x] with B < p (the remaining case)
+Think of [B:x] as T.L above and go to step #2b.
+
+Step #3: At this point we have transformed
+
+ [A:D] [A:D] [A:D]
+ / \ to / \ or to / \
+ / \ / \ / \
+ [A:x] [x+1:D] [p:x] [x+1:D] [A:x] [x+1:D]
+ / \
+ / \
+ .... subtree
+ containing
+ [p:x]
+
+The leaf node [p:x] will be the rightmost leaf in the tree rooted at [A:x].
+The reason is that a node and its right child have the same 'to' value.
+Which means the path from [A:x] to [p:x] is such that we descent from one
+node to the next by going to its right child.
+
+In this step the node [p:x] is moved up the tree by doing the following
+transformation:
+
+ top top
+ / \ / \
+ / \ / \
+ l1 r1 ====> new r2
+ / \ / \
+ / \ / \
+ l2 r2 l1 l2
+
+Note, that the order of the leaves is the same but r2 has been moved up.
+This transform is repeated until r2 cannot be moved up any further.
+So .... the original tree on the left gets transformed to
+the tree in the middle or to the tree on the right.
+
+ [A:D] [A:D] [A:D]
+ / \ to / \ or to / \
+ / \ / \ / \
+ [A:x] [x+1:D] [p:x] [x+1:D] [A:x] [x+1:D]
+ / \
+ / \
+ .... [p:x]
+
+
+Step #4: Massage T.R
+This is similar to step #2 and its substeps.
+
+Step #5: At this point we have transformed (ignoring what was done with
+the [A:x] subtree earlier as it is irrelevant here):
+
+ [A:D] [A:D] [A:D]
+ / \ to / \ or to / \
+ / \ / \ / \
+ [A:x] [x+1:D] [A:x] [x+1:q] [A:x] [x+1:D]
+ / \
+ / \
+ subtree ....
+ containing
+ [x+1:q]
+
+Perform a similar transformation as in step #3:
+
+ top top
+ / \ / \
+ / \ / \
+ l1 r1 ====> l2 new
+ / \ / \
+ / \ / \
+ l2 r2 r2 r1
+
+Again, order of leaves is the same but l2 has moved up.
+This transform is repeated until l2 cannot be moved up any further.
+So .... the original tree on the left gets transformed to
+the tree in the middle or to the tree on the right.
+
+ [A:D] [A:D] [A:D]
+ / \ to / \ or to / \
+ / \ / \ / \
+ [A:x] [x+1:D] [A:x] [x+1:q] [A:x] [x+1:D]
+ / \
+ / \
+ [x+1:q] ....
+
+Step #6:
+The tree can take one of the following 4 shapes:
+
+ (1) (2) (3) (4)
+[p:q] [p:D] [A:q] [A:D]
+ / \ / \ / \
+ / \ / \ / \
+ [p:x] [x+1:D] [A:x] [x+1:q] [A:x] [x+1:D]
+ / \ / \ / \ / \
+ / \ / \ / \ / \
+ [x+1:q] [q+1:D] [A:p-1] [p:x] [A:p-1] [p:x] [x+1:q] [q+1:D]
+
+Those get transformed to:
+
+ (1) (2) (3) (4)
+[p:q] [p:D] [A:q] [A:D]
+ / \ / \ / \
+ / \ / \ / \
+ [p:q] [q+1:D] [A:p-1] [p:q] [A:x] [q+1:D]
+ / \
+ / \
+ [A:p-1] [p:q]
+
+
+4. Ensuring the "Maximally Merged" Property
+
+TO BE DONE
+
+In the beginning the segment tree is a single leaf node covering the whole
+address space. As nodes get added and split we need to make sure that the
+segment tree stays maximally merged.
+
+For the sake of this discussion and without loss of generality we assume
+that a "node kind" is associated with each node. We also assume a function
+"maybe_merge" that decides whether or not two nodes maybe merged.
+The function is defined as follows:
+(a) The function takes two leaf nodes N1 and N2 as arguments.
+(b) If the two leaf nodes have different node kinds, the function
+ returns false.
+(c) If (N1) and (N2) do not abut, the function returns false.
+(d) Otherwise, the function returns true.
+
+Associated with each node is some kind of informa
+4.1 Splitting a node
+
+
+
+
+Merging two nodes
+The necessary condition for two nodes to be merged is that their address
+intervals abut. The sufficient condition is that the function 'meybe_merge'
+returns true.
+Let 'prev' and 'cur' be two such segments (necessary and sufficient conditions
+are satisfied). Also: (prev).t + 1 = (cur).f
+
+Case 1: prev and cur have the same parent.
+This means that prev is the left child and cur is the right child of
+their parent. Replace the parent with a leaf node [(prev).f:(cur).t]
+
+Case 2: prev and cur do not have the same parent.
+This means that prev is the right child of some node and cur is the left
+child of some node.
+Begin with prev.
+
+for (node = prev; node == node->up->right; node = node->up)
+ continue;
+
+When that loop terminates 'node' is the common ancestor of 'prev' and 'cur'.
Added: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-dot.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-dot.c (added)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-dot.c Wed Jul 8 12:37:41 2015
@@ -0,0 +1,220 @@
+/* -*- mode: C; c-basic-offset: 3; -*- */
+
+/*--------------------------------------------------------------------*/
+/*--- Address space manager segment visualisation ---*/
+/*--- aspacemgr-dot.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2015-2015 Florian Krohm
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+/* Writes the segment tree to a file that can be visualised with the
+ 'dot' program (which is part of the graphviz package).
+ Function ML_(am_write_dot) is the single entry point here. */
+
+#include "priv_aspacemgr.h"
+
+/* Output a character. Characters are written to a buffer which is flushed
+ when full or when C is the NUL character. */
+static void output( HChar c, void *p )
+{
+ static HChar buf[512];
+ static UInt num_char;
+
+ if (num_char == sizeof buf || c == '\0') {
+ VG_(do_syscall3)(__NR_write, *(Int *)p, (UWord)buf, num_char);
+ num_char = 0;
+ }
+ if (c != '\0') buf[num_char++] = c;
+}
+
+static void am_fprintf( Int fd, const HChar *format, ... )
+{
+ va_list vargs;
+
+ va_start(vargs,format);
+ VG_(debugLog_vprintf)( output, &fd, format, vargs );
+ va_end(vargs);
+}
+
+static void
+write_node_name( Int fd, const NSegment *node )
+{
+ am_fprintf(fd, "N_%lx_%lx", node->start, node->end);
+}
+
+static void
+write_node_aux( Int fd, const NSegment *node, Bool label,
+ const HChar *color, const HChar *shape, const HChar *style,
+ const HChar *fillcolor, unsigned num)
+{
+ aspacem_assert(node != NULL);
+
+ HChar info[6];
+ info[0] = node->hasR ? 'r' : '-';
+ info[1] = node->hasW ? 'w' : '-';
+ info[2] = node->hasX ? 'x' : '-';
+ info[3] = node->hasT ? 'T' : '-';
+ switch (node->whatsit) {
+ case WiClientHeap: info[4] = 'H'; break;
+ case WiClientStack: info[4] = 'S'; break;
+ case WiClientBreak: info[4] = 'B'; break;
+ case WiUnknown: info[4] = '-'; break;
+ default: aspacem_assert(0);
+ }
+ info[5] = '\0';
+
+ write_node_name(fd, node);
+ if (label) {
+ am_fprintf(fd, "[label=\"%lx:%lx\n%s\"]", node->start, node->end, info);
+ }
+ if (color) {
+ am_fprintf(fd, "[color=\"%s\"]", color);
+ }
+ if (shape) {
+ am_fprintf(fd, "[shape=\"%s\"]", shape);
+ }
+ if (style) {
+ am_fprintf(fd, "[style=\"%s\"]", style);
+ }
+ if (fillcolor) {
+ am_fprintf(fd, "[fillcolor=\"%s\"]", fillcolor);
+ }
+ if (num != 0) {
+ am_fprintf(fd, "[peripheries=%u]", num);
+ }
+}
+
+static void
+write_node( Int fd, const NSegment *node )
+{
+ aspacem_assert(node != NULL);
+
+ const HChar *color = NULL;
+ const HChar *shape = NULL;
+ const HChar *style = NULL;
+ const HChar *fill_color = NULL;
+ unsigned num = 0;
+
+ if (node->left == NULL && node->right == NULL) { // leaf
+ style = "filled";
+ switch (node->kind) {
+ case SkResvn:
+ color = "GreenYellow";
+ break;
+ case SkFree:
+ color = "SteelBlue1";
+ break;
+ case SkAnonC:
+ color = "yellow";
+ break;
+ case SkFileC:
+ color = "yellow";
+ shape = "rectangle";
+ break;
+ case SkAnonV:
+ color = "tomato";
+ break;
+ case SkFileV:
+ color = "tomato";
+ shape = "rectangle";
+ break;
+ default:
+ aspacem_assert(0);
+ }
+ }
+
+ write_node_aux(fd, node, True, color, shape, style, fill_color, num);
+ am_fprintf(fd, ";\n");
+}
+
+static void
+write_nodes( Int fd, const NSegment *tree )
+{
+ if (tree == NULL) return;
+
+ write_node(fd, tree);
+ write_nodes(fd, tree->left);
+ write_nodes(fd, tree->right);
+}
+
+static void
+write_edge( Int fd, const NSegment *from, const NSegment *to )
+{
+ aspacem_assert(from != NULL);
+ aspacem_assert(to != NULL);
+
+ write_node_name(fd, from);
+ am_fprintf(fd, " -> ");
+ write_node_name(fd, to);
+ am_fprintf(fd, ";\n");
+}
+
+static void
+write_edges( Int fd, const NSegment *tree )
+{
+ if (tree == NULL) return;
+
+ const NSegment *left = tree->left;
+ const NSegment *right = tree->right;
+
+ if (left) {
+ write_edges(fd, left);
+ write_edge(fd, tree, left);
+ }
+ if (right) {
+ write_edges(fd, right);
+ write_edge(fd, tree, right);
+ }
+#if 0
+ const NSegment *parent = tree->up;
+ if (parent) {
+ write_edge(fd, tree, parent);
+ }
+#endif
+}
+
+void ML_(am_write_dot)( const NSegment *node, const HChar *file )
+{
+ aspacem_assert(node != NULL);
+ aspacem_assert(file != NULL);
+
+ SysRes sres = ML_(am_open)(file, VKI_O_CREAT | VKI_O_WRONLY, 0644);
+ if (sr_isError(sres))
+ ML_(am_barf)("can't open dot file");
+ Int fd = sr_Res(sres);
+
+ am_fprintf(fd, "digraph \"%s\" {\n", "whatever");
+ am_fprintf(fd, "\n/* Nodes */\n\n");
+ write_nodes(fd, node);
+ am_fprintf(fd, "\n/* Edges */\n\n");
+ write_edges(fd, node);
+ am_fprintf(fd, "}\n");
+ output('\0', &fd);
+ ML_(am_close)(fd);
+}
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-segments.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-segments.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-segments.c Wed Jul 8 12:37:41 2015
@@ -9,6 +9,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
+ Copyright (C) 2015-2015 Florian Krohm
Copyright (C) 2000-2013 Julian Seward
js...@ac...
@@ -37,6 +38,16 @@
are small integers */
#undef VG_IS_PAGE_ALIGNED
#define VG_IS_PAGE_ALIGNED(x) (1)
+#define INTERVAL_FMT "[%lu:%lu]"
+#define ADDR_FMT "%lu"
+
+static Bool norotate = False;
+static Bool nopost = False;
+#else
+
+#define INTERVAL_FMT "[%lx:%lx]"
+#define ADDR_FMT "%lx"
+
#endif
/* Max number of segments we can track. On Android, virtual address
@@ -52,8 +63,7 @@
#endif
/* Array [0 .. nsegments_used-1] of all mappings. */
-/* Sorted by .addr field. */
-/* I: len may not be zero. */
+/* I: zero-length segments are not allowed. */
/* I: overlapping segments are not allowed. */
/* I: the segments cover the entire address space precisely. */
/* Each segment can optionally hold an index into the filename table. */
@@ -61,6 +71,23 @@
static NSegment nsegments[VG_N_SEGMENTS];
static Int nsegments_used = 0;
+/* NSegment::fnIdx == ON_FREELIST identifies a segment to be on the
+ freelist */
+#define ON_FREELIST -42
+
+/* Freelist of segments; deleted segments will be added here. Segments
+ on this list will be chained together via the 'left' link. */
+static NSegment *segment_freelist;
+
+/* For debugging purposes */
+static Bool verbose = False;
+static Bool expensive_checking = False;
+
+#undef DEBUG
+#define DEBUG(fmt, ...) \
+ do { \
+ if (verbose) VG_(debugLog)(0, "aspacem", fmt, ##__VA_ARGS__); \
+ } while (0)
/*-----------------------------------------------------------------*/
/*--- ---*/
@@ -68,24 +95,78 @@
/*--- ---*/
/*-----------------------------------------------------------------*/
+static inline NSegment *root_segment( void )
+{
+ return nsegments + 0;
+}
+
+static inline Bool is_leaf( const NSegment *node )
+{
+ aspacem_assert(node != NULL);
+
+ return node->left == NULL && node->right == NULL;
+}
+
+/* In the segment tree rooted at NODE return the leftmost leaf node */
+static NSegment *leftmost_leaf( NSegment *node )
+{
+ aspacem_assert(node != NULL);
+
+ while (! is_leaf(node))
+ node = node->left;
+ return node;
+}
+
+/* In the segment tree rooted at NODE return the rightmost leaf node */
+static NSegment *rightmost_leaf( NSegment *node )
+{
+ aspacem_assert(node != NULL);
+
+ while (! is_leaf(node))
+ node = node->right;
+ return node;
+}
+
/* From the ordered collection of segments, return the segment
succeeding SEG, or NULL if there is no such segment. */
-NSegment *ML_(am_next_segment)( const NSegment *seg )
+NSegment *ML_(am_next_segment)( const NSegment *node )
{
- UInt ix = seg - nsegments;
- if (ix != nsegments_used - 1)
- return nsegments + ix + 1;
+ aspacem_assert(is_leaf(node));
+
+ const NSegment *parent;
+
+ while ((parent = node->up) != NULL) {
+ if (node == parent->left)
+ /* NODE is a left subtree. Descend into the corresponding right
+ subtree and return the leftmost leaf. */
+ return leftmost_leaf(parent->right);
+ /* NODE is a right subtree. Climb up until we either end up at the
+ root node (i.e. there is no next forward segment) or find ourselves
+ being the left subtree of some node. */
+ node = parent;
+ }
return NULL; // no succeeding segment
}
/* From the ordered collection of segments, return the segment
preceding SEG, or NULL if there is no such segment. */
-NSegment *ML_(am_prev_segment)( const NSegment *seg )
+NSegment *ML_(am_prev_segment)( const NSegment *node )
{
- UInt ix = seg - nsegments;
- if (ix != 0)
- return nsegments + ix - 1;
+ aspacem_assert(is_leaf(node));
+
+ NSegment *parent;
+
+ while ((parent = node->up) != NULL) {
+ if (node == parent->right)
+ /* NODE is a right subtree. Descend into the corresponding left
+ subtree and return the rightmost leaf. */
+ return rightmost_leaf(parent->left);
+ /* NODE is a left subtree. Climb up until we either end up at the
+ root node (i.e. there is no next backward segment) or find ourselves
+ being the rightsubtree of some node. */
+ node = parent;
+ }
return NULL; // no preceding segment
}
@@ -177,16 +258,36 @@
}
}
+static void show_segments( Int logLevel, Int *segNo, const HChar *who,
+ const NSegment *seg )
+{
+ if (is_leaf(seg)) {
+ show_segment( logLevel, (*segNo)++, seg );
+ } else {
+ // recurse
+ show_segments( logLevel, segNo, who, seg->left );
+ show_segments( logLevel, segNo, who, seg->right );
+ }
+}
+
+/* Return the number of segments (leaf nodes) in the tree rooted at NODE. */
+static UInt segment_count( const NSegment *node )
+{
+ if (is_leaf(node)) return 1;
+ return segment_count(node->left) + segment_count(node->right);
+}
+
/* Print out the segments (debugging only!). */
void VG_(am_show_nsegments) ( Int logLevel, const HChar *who )
{
- Int i;
VG_(debugLog)(logLevel, "aspacem",
- "<<< SHOW_SEGMENTS: %s (%d segments)\n",
- who, nsegments_used);
- ML_(am_show_segnames)( logLevel, who );
- for (i = 0; i < nsegments_used; i++)
- show_segment( logLevel, i, &nsegments[i] );
+ "<<< SHOW_SEGMENTS: %s (%u segments)\n",
+ who, segment_count(root_segment()));
+ ML_(am_show_segnames)( logLevel, who);
+
+ Int segNo = 0;
+ show_segments( logLevel, &segNo, who, root_segment() );
+
VG_(debugLog)(logLevel, "aspacem",
">>>\n");
}
@@ -235,6 +336,25 @@
if (!VG_IS_PAGE_ALIGNED(s->start)) return False;
if (!VG_IS_PAGE_ALIGNED(s->end+1)) return False;
+ /* Only the root node may have a NULL up link */
+ if (s != root_segment())
+ if (s->up == NULL) return False;
+
+ /* Either both subtrees are NULL or both are != NULL.
+ In the latter case they must point to different segments. */
+ if (s->left == NULL) {
+ if (s->right != NULL) return False;
+ } else {
+ if (s->left == NULL) return False;
+ /* Both subtrees != NULL */
+ if (s->left == s->right) return False;
+ /* Check address range containment */
+ if (s->start != s->left->start) return False;
+ if (s->end != s->right->end) return False;
+ /* Check that subtree address range abut */
+ if (s->right->start != s->left->end + 1) return False;
+ }
+
switch (s->kind) {
case SkFree:
@@ -268,6 +388,24 @@
}
}
+static void
+check_tree( const NSegment *tree )
+{
+ if (tree == NULL) return;
+
+ if (! sane_segment(tree)) {
+ VG_(debugLog)(0, "aspacemgr", "*** node "INTERVAL_FMT" is busted\n",
+ tree->start, tree->end);
+ ML_(am_show_segment_full)(0, -1, tree);
+
+ ML_(am_write_dot)(root_segment(), "busted.dot");
+ aspacem_assert(0);
+ }
+ check_tree(tree->left);
+ check_tree(tree->right);
+}
+
+
/* Try merging s2 into s1, if possible. If successful, s1 is
modified, and True is returned. Otherwise s1 is unchanged and
False is returned. */
@@ -388,37 +526,33 @@
a hash function, and the actual cache entry is always validated
correctly against the selected cache entry before use.
*/
-/* Don't call find_segment_idx_WRK; use find_segment_idx instead. */
-__attribute__((noinline))
-static UInt find_segment_idx_WRK( Addr a )
-{
- Addr a_mid_lo, a_mid_hi;
- Int mid,
- lo = 0,
- hi = nsegments_used-1;
+/* Don't call find_segment_WRK; use find_segment instead. */
+static NSegment *find_segment_WRK( Addr a )
+{
+ NSegment *seg = root_segment(); // start at the root segment
+
while (True) {
- /* current unsearched space is from lo to hi, inclusive. */
- if (lo > hi) {
- /* Not found. This can't happen. */
- ML_(am_barf)("find_segment_idx: not found");
+ if (is_leaf(seg)) return seg; // found
+ NSegment *left = seg->left;
+ NSegment *right = seg->right;
+ if (a < right->start) {
+ seg = left;
+ continue;
}
- mid = (lo + hi) / 2;
- a_mid_lo = nsegments[mid].start;
- a_mid_hi = nsegments[mid].end;
-
- if (a < a_mid_lo) { hi = mid-1; continue; }
- if (a > a_mid_hi) { lo = mid+1; continue; }
- aspacem_assert(a >= a_mid_lo && a <= a_mid_hi);
- aspacem_assert(0 <= mid && mid < nsegments_used);
- return mid;
+ if (a > left->end) {
+ seg = right;
+ continue;
+ }
+ /* Not found. This can't happen. */
+ aspacem_assert(0);
}
}
-inline static UInt find_segment_idx( Addr a )
+NSegment *ML_(am_find_segment)( Addr a )
{
# define N_CACHE 131 /*prime*/
static Addr cache_pageno[N_CACHE];
- static Int cache_segidx[N_CACHE];
+ static NSegment *cache_seg[N_CACHE];
static Bool cache_inited = False;
static UWord n_q = 0;
@@ -431,7 +565,7 @@
} else {
for (ix = 0; ix < N_CACHE; ix++) {
cache_pageno[ix] = 0;
- cache_segidx[ix] = -1;
+ cache_seg[ix] = NULL;
}
cache_inited = True;
}
@@ -440,31 +574,26 @@
n_q++;
if (0 && 0 == (n_q & 0xFFFF))
- VG_(debugLog)(0,"xxx","find_segment_idx: %lu %lu\n", n_q, n_m);
+ VG_(debugLog)(0,"xxx","find_segment: %lu %lu\n", n_q, n_m);
if ((a >> 12) == cache_pageno[ix]
- && cache_segidx[ix] >= 0
- && cache_segidx[ix] < nsegments_used
- && nsegments[cache_segidx[ix]].start <= a
- && a <= nsegments[cache_segidx[ix]].end) {
+ && cache_seg[ix] != NULL
+ && is_leaf(cache_seg[ix])
+ && cache_seg[ix]->start <= a
+ && a <= cache_seg[ix]->end) {
/* hit */
/* aspacem_assert( cache_segidx[ix] == find_segment_idx_WRK(a) ); */
- return cache_segidx[ix];
+ return cache_seg[ix];
} else {
/* miss */
n_m++;
- cache_segidx[ix] = find_segment_idx_WRK(a);
+ cache_seg[ix] = find_segment_WRK(a);
cache_pageno[ix] = a >> 12;
- return cache_segidx[ix];
+ return cache_seg[ix];
}
# undef N_CACHE
}
-NSegment *ML_(am_find_segment)( Addr a )
-{
- return nsegments + find_segment_idx(a);
-}
-
/* Finds the segment containing 'a'. Only returns non-SkFree segments. */
const NSegment *VG_(am_find_nsegment)( Addr a )
{
@@ -498,52 +627,133 @@
seg->fnIdx = -1;
seg->hasR = seg->hasW = seg->hasX = seg->hasT = False;
seg->whatsit = WiUnknown;
+ seg->left = seg->right = seg->up = NULL;
+}
+
+/* Allocate a new segment. */
+static NSegment *new_node( void )
+{
+ /* Check whether there are is a node on the freelist */
+ if (segment_freelist) {
+ NSegment *new = segment_freelist;
+ segment_freelist = segment_freelist->left;
+ aspacem_assert(new->fnIdx == ON_FREELIST);
+ return new;
+ }
+
+ if (nsegments_used >= VG_N_SEGMENTS)
+ ML_(am_barf_toolow)("VG_N_SEGMENTS");
+ return nsegments + nsegments_used++;
+}
+
+static NSegment *
+new_leaf( NSegment *parent, SegKind kind, const Addr from, const Addr to )
+{
+ NSegment *node = new_node();
+
+ DEBUG("adding leaf "INTERVAL_FMT"\n", from, to);
+
+ ML_(am_init_segment)(node, kind, from, to);
+ node->left = node->right = NULL;
+ node->up = parent;
+
+ return node;
}
+/* Clone a segment. This creates a new leaf node. */
+
+static NSegment *clone_segment( const NSegment *seg )
+{
+ aspacem_assert(is_leaf(seg));
+ DEBUG("cloning leaf "INTERVAL_FMT"\n", seg->start, seg->end);
+
+ NSegment *new = new_node();
+
+ *new = *seg;
+
+ ML_(am_inc_refcount)(seg->fnIdx);
+
+ return new;
+}
+
+static void delete_node( NSegment *node )
+{
+ DEBUG("removing %s "INTERVAL_FMT"\n",
+ is_leaf(node) ? "leaf" : "node", node->start, node->end);
+
+ ML_(am_dec_refcount)(node->fnIdx);
+
+ /* Chain into freelist */
+ node->left = node->right = NULL;
+ node->fnIdx = ON_FREELIST;
+ node->left = segment_freelist;
+ segment_freelist = node;
+}
+
+static void delete_subtree( NSegment *tree )
+{
+ if (tree == NULL) return; // convenience
+ delete_subtree(tree->left);
+ delete_subtree(tree->right);
+ delete_node(tree);
+}
+
+
/*-----------------------------------------------------------------*/
/*--- ---*/
/*--- Modifying the segment structure. ---*/
/*--- ---*/
/*-----------------------------------------------------------------*/
+/* Split SEG with interval [p:q] into two segments [p:a-1] and [a:q] */
+static void split_segment_at_WRK ( NSegment *seg, const Addr addr )
+{
+ aspacem_assert(is_leaf(seg));
+
+ DEBUG("splitting "INTERVAL_FMT" @ "ADDR_FMT"\n", seg->start, seg->end, addr);
+
+ NSegment *left = clone_segment(seg);
+ left->start = seg->start;
+ left->end = addr - 1;
+ left->up = seg;
+
+ NSegment *right = clone_segment(seg);
+ right->start = addr;
+ right->end = seg->end;
+ right->up = seg;
+
+ if (seg->kind == SkFileV || seg->kind == SkFileC)
+ right->offset += ((ULong)right->start) - ((ULong)seg->start);
+
+ ML_(am_dec_refcount)(seg->fnIdx);
+
+ /* SEG is now an internal node whose kind is irrelevant. Give it
+ some non-file kind, so we can decrease the reference count on
+ its segment name. */
+ NSegment *up = seg->up;
+ ML_(am_init_segment)(seg, SkResvn, seg->start, seg->end);
+ seg->up = up;
+ seg->left = left;
+ seg->right = right;
+}
+
/* Split the segment containing 'a' into two, so that 'a' is
guaranteed to be the start of a new segment. If 'a' is already the
start of a segment, do nothing. */
static void split_segment_at( Addr a )
{
- UInt i, j;
-
aspacem_assert(a > Addr_MIN);
aspacem_assert(VG_IS_PAGE_ALIGNED(a));
- aspacem_assert(nsegments_used > 0);
- i = find_segment_idx(a);
+ NSegment *seg = ML_(am_find_segment)(a);
- if (nsegments[i].start == a)
+ if (seg->start == a)
/* 'a' is already the start point of a segment, so nothing to be
done. */
return;
- /* else we have to slide the segments upwards to make a hole */
- if (nsegments_used >= VG_N_SEGMENTS)
- ML_(am_barf_toolow)("VG_N_SEGMENTS");
- for (j = nsegments_used-1; j > i; j--)
- nsegments[j+1] = nsegments[j];
- nsegments_used++;
-
- nsegments[i+1] = nsegments[i];
- nsegments[i+1].start = a;
- nsegments[i].end = a-1;
-
- if (nsegments[i].kind == SkFileV || nsegments[i].kind == SkFileC)
- nsegments[i+1].offset
- += ((ULong)nsegments[i+1].start) - ((ULong)nsegments[i].start);
-
- ML_(am_inc_refcount)(nsegments[i].fnIdx);
-
- aspacem_assert(sane_segment(&nsegments[i]));
- aspacem_assert(sane_segment(&nsegments[i+1]));
+ split_segment_at_WRK( seg, a );
}
@@ -553,8 +763,8 @@
of the lowest and highest segments in the range. */
static void split_segments_lo_and_hi( Addr sLo, Addr sHi,
- /*OUT*/UInt *iLo,
- /*OUT*/UInt *iHi )
+ /*OUT*/NSegment **segLo,
+ /*OUT*/NSegment **segHi )
{
aspacem_assert(sLo < sHi);
aspacem_assert(VG_IS_PAGE_ALIGNED(sLo));
@@ -565,12 +775,11 @@
if (sHi < Addr_MAX)
split_segment_at(sHi + 1);
- *iLo = find_segment_idx(sLo);
- *iHi = find_segment_idx(sHi);
+ *segLo = ML_(am_find_segment)(sLo);
+ *segHi = ML_(am_find_segment)(sHi);
- aspacem_assert(*iLo <= *iHi);
- aspacem_assert(nsegments[*iLo].start == sLo);
- aspacem_assert(nsegments[*iHi].end == sHi);
+ aspacem_assert((*segLo)->start == sLo);
+ aspacem_assert((*segHi)->end == sHi);
/* Not that I'm overly paranoid or anything, definitely not :-) */
}
@@ -579,47 +788,453 @@
This deals with all the tricky cases of splitting up segments as
needed. */
-void ML_(am_add_segment)( const NSegment *seg )
+/* Locate the subtree X containing the interval [from:to] such that no
+ subtree of X contains [from:to]. This function never returns NULL. */
+static NSegment *
+locate_subtree_containing(NSegment *tree, const Addr from, const Addr to)
+{
+ aspacem_assert(tree != NULL);
+ aspacem_assert(from >= tree->start);
+ aspacem_assert(to <= tree->end);
+
+ while (True) {
+ NSegment *left = tree->left;
+
+ /* If TREE is a leaf node, then the node's interval must contain
+ [from:to]. */
+ if (left == NULL) {
+ aspacem_assert(from >= tree->start && to <= tree->end);
+ return tree;
+ }
+
+ /* TREE is an internal node. */
+
+ /* Decide which subtree to dive into */
+ if (from >= left->start && to <= left->end) {
+ tree = left;
+ continue;
+ }
+
+ NSegment *right = tree->right;
+ if (from >= right->start && to <= right->end) {
+ tree = right;
+ continue;
+ }
+
+ aspacem_assert(from >= tree->start && to <= tree->end);
+ return tree;
+ }
+}
+
+static void
+do_left_subtree_aux(NSegment *node, NSegment *parent, const Addr from)
+{
+ DEBUG("processing node "INTERVAL_FMT"\n", node->start, node->end);
+
+ if (is_leaf(node)) {
+ aspacem_assert(from > node->start && from <= node->end);
+ /* Split node; Tests: l1 30:100 big 6:18 l2 25:50 */
+ split_segment_at_WRK(node, from);
+ return;
+ }
+
+ /* No need to check whether the left subtree can be removed. */
+
+ /* Check whether right subtree can be removed */
+ NSegment *right = node->right;
+ while (right->start >= from) {
+ if (right->start == from) {
+ /* Remove right subtree Tests: l2 31:50 */
+ node->right = new_leaf(node, SkResvn, right->start, node->end);
+ delete_subtree(right);
+ /* We're done. No need to traverse the node->left because its
+ interval cannot intersect with [from:to] */
+ return;
+ }
+
+ /* right->start > from */
+ delete_subtree(right);
+
+ NSegment *left = node->left;
+ if (is_leaf(left))
+ split_segment_at_WRK(left, from);
+ node->left = left->left;
+ node->right = left->right;
+ delete_node(left);
+ left = node->left;
+ right = node->right;
+ left->up = right->up = node;
+ right->end = node->end;
+
+ /* Iterate... */
+ DEBUG("... iterating with "INTERVAL_FMT"\n", node->start, node->end);
+ }
+
+ /* The right subtree could not be removed. Descent into the right
+ subtree. Note, that 'from' cannot be located in the left subtree.
+ Because, if it was, then we would have removed the right subtree.
+ But when we get here, we haven't. */
+ aspacem_assert(from > right->start && from <= right->end);
+ // Continue in right subtree
+ DEBUG("... continuing RIGHT with "INTERVAL_FMT"\n", right->start,
+ right->end);
+ right->end = node->end;
+ do_left_subtree_aux(right, node, from);
+}
+
+static void
+do_left_subtree(NSegment *tree, const Addr from)
+{
+ aspacem_assert(tree != NULL);
+
+ DEBUG("DOING LEFT SUBTREE\n");
+
+ NSegment *node = tree->left;
+
+ /* By construction FROM is covered by some node in the left subtree
+ of TREE. This is ensured by locate_subtree_containing. */
+
+ /* If the left subtree has interval [from:...] it will be replaced
+ with a leaf node having the same interval as the tree it replaces. */
+ if (node->start == from) { // Tests: l1 0:60 big 0:27
+ tree->left = new_leaf(tree, SkResvn, node->start, node->end);
+ delete_subtree(node);
+ return;
+ }
+
+ do_left_subtree_aux(node, tree, from);
+
+ /* Rearrange nodes such that rightmost leaf is moved up */
+#ifdef ASPACEMGR_UNIT_TEST
+ if (norotate) return;
+#endif
+
+ NSegment *top = tree->left;
+ while (1) {
+ NSegment *l1 = top->left;
+ NSegment *r1 = top->right;
+ if (is_leaf(r1)) break;
+ /*
+ top top
+ / \ / \
+ / \ / \
+ l1 r1 ====> new r2
+ / \ / \
+ / \ / \
+ l2 r2 l1 l2
+ */
+ // Do the transformation in place without allocating/freeing nodes. */
+ NSegment *l2 = r1->left;
+ NSegment *r2 = r1->right;
+ NSegment *old_r1 = top->right; // stash away r1
+
+ // move r2 into place
+ top->right = r1->right;
+ r2->up = r1->up;
+
+ // arrange for 'new' (previously r1)
+ NSegment *new = r1;
+ new->start = l1->start;
+ new->end = l2->end;
+
+ // move l2 into place
+ new->right = r1->left;
+
+ // move l1 into place
+ new->left = top->left;
+ l1->up = old_r1;
+
+ // move new into place
+ top->left = old_r1;
+ }
+}
+
+static void
+do_right_subtree_aux(NSegment *node, NSegment *parent, const Addr to)
{
- UInt i, iLo, iHi, delta;
- Bool segment_is_sane;
+ DEBUG("processing node "INTERVAL_FMT"\n", node->start, node->end);
+
+ if (is_leaf(node)) {
+ aspacem_assert(to >= node->start && to < node->end);
+ /* Split node; Tests: l1 0:60 big 6:27 r2 0:10 */
+ split_segment_at_WRK(node, to + 1);
+ return;
+ }
+
+ /* No need to check whether the right subtree can be removed. */
+
+ /* Check whether left subtree can be removed */
+ NSegment *left = node->left;
+ while (left->end <= to) {
+ if (left->end == to) {
+ /* Remove left subtree Tests: r2 0:50 */
+ node->left = new_leaf(node, SkResvn, node->start, left->end);
+ delete_subtree(left);
+ /* We're done. No need to traverse the node->right because its
+ interval cannot intersect with [from:to] */
+ return;
+ }
+
+ /* left->end < to */
+ /* Remove left subtree */
+ delete_subtree(left);
+
+ NSegment *right = node->right;
+ if (is_leaf(right))
+ split_segment_at_WRK(right, to + 1);
+ node->left = right->left;
+ node->right = right->right;
+ delete_node(right);
+ left = node->left;
+ right = node->right;
+ left->up = right->up = node;
+ left->start = node->start;
+
+ /* Iterate... */
+ DEBUG("... iterating with "INTERVAL_FMT"\n", node->start, node->end);
+ }
+
+ /* The left subtree could not be removed. Descent into the left
+ subtree. Note, that 'to' cannot be located in the right subtree.
+ Because, if it was, then we would have removed the left subtree.
+ But when we get here, we haven't. */
+ aspacem_assert(to >= left->start && to < left->end);
+ // Continue in left subtree
+ DEBUG("... continuing LEFT with "INTERVAL_FMT"\n", left->start, left->end);
+ left->start = node->start;
+ do_right_subtree_aux(left, node, to);
+}
+
+static void
+do_right_subtree(NSegment *tree, const Addr to)
+{
+ aspacem_assert(tree != NULL);
+
+ DEBUG("DOING RIGHT SUBTREE\n");
+
+ NSegment *node = tree->right;
+
+ /* By construction TO is covered by some node in the right subtree
+ of TREE. This is ensured by locate_subtree_containing. */
+
+ /* If the right subtree has interval [...:to] it will be replaced
+ with a leaf node having the same interval as the tree it replaces. */
+ if (node->end == to) { // Tests: l1 30:100 big: 6:19
+ tree->right = new_leaf(tree, SkResvn, node->start, node->end);
+ delete_subtree(node);
+ return;
+ }
+
+ do_right_subtree_aux(node, tree, to);
+
+#ifdef ASPACEMGR_UNIT_TEST
+ if (norotate) return;
+#endif
+
+ /* Rearrange nodes such that leftmost leaf is moved up */
+ NSegment *top = tree->right;
+ while (1) {
+ NSegment *l1 = top->left;
+ NSegment *r1 = top->right;
+ if (is_leaf(l1)) break;
+ /*
+ top top
+ / \ / \
+ / \ / \
+ l1 r1 ====> l2 new
+ / \ / \
+ / \ / \
+ l2 r2 r2 r1
+ */
+ // Do the transformation in place without allocating/freeing nodes. */
+ NSegment *l2 = l1->left;
+ NSegment *r2 = l1->right;
+ NSegment *old_l1 = top->left; // stash away l1
+
+ // move l2 into place
+ top->left = l1->left;
+ l2->up = l1->up;
+
+ // arrange for 'new' (previously l1)
+ NSegment *new = l1;
+ new->start = r2->start;
+ new->end = r1->end;
+
+ // move r2 into place
+ new->left = l1->right;
+
+ // move r1 into place
+ new->right = top->right;
+ r1->up = old_l1;
- Addr sStart = seg->start;
- Addr sEnd = seg->end;
+ // move new into place
+ top->right = old_l1;
+ }
+}
- aspacem_assert(sStart <= sEnd);
- aspacem_assert(VG_IS_PAGE_ALIGNED(sStart));
- aspacem_assert(VG_IS_PAGE_ALIGNED(sEnd+1));
+/* Return pointer to subtree */
+static NSegment *
+insert_node(Addr from, Addr to)
+{
+ NSegment *root = root_segment();
+
+ /* Extra check here to make sure, the interval is contained in the
+ interval of the root node */
+ aspacem_assert(from >= root->start);
+ aspacem_assert(to <= root->end);
+
+ /* Step 1: Locate the subtree containing [from:to] */
+ NSegment *subtree = locate_subtree_containing(root, from, to);
+ aspacem_assert(subtree != NULL);
+ DEBUG("subtree root "INTERVAL_FMT"\n", subtree->start, subtree->end);
+
+ /* If the interval of the subtree equals [from:to], then remove the
+ subtree and return a leaf node with interval [from:to]. */
+ if (subtree->start == from && subtree->end == to) {
+ /* Tests: big 5:25, big 14:16 */
+ /* Replacing the root segment is not allowed and should never occur. */
+ aspacem_assert(subtree != root);
+ NSegment *parent = subtree->up;
+ NSegment *new = new_leaf(parent, SkResvn, from, to);
+ if (subtree == parent->left)
+ parent->left = new;
+ else
+ parent->right = new;
+ delete_subtree(subtree);
+ return new;
+ }
- segment_is_sane = sane_segment(seg);
- if (!segment_is_sane) ML_(am_show_segment_full)(0, -1, seg);
- aspacem_assert(segment_is_sane);
+ /* Special handling when subtree is a leaf node */
+ if (is_leaf(subtree)) {
+ if (subtree->start == from) { // Tests: l1 0:30 r1 51:80
+ split_segment_at_WRK(subtree, to + 1);
+ return subtree->left;
+ } else if (subtree->end == to) { // Tests: l1 20:50 r2 40:50
+ split_segment_at_WRK(subtree, from);
+ return subtree->right;
+ } else { // Tests: l1 30:40
+ split_segment_at_WRK(subtree, from);
+ split_segment_at_WRK(subtree->right, to + 1);
+ return subtree->right->left;
+ }
+ }
- split_segments_lo_and_hi( sStart, sEnd, &iLo, &iHi );
+ /* Step 2: Remove all intervals that are being replaced by [from:to] */
+ do_left_subtree(subtree, from);
+ do_right_subtree(subtree, to);
- /* Now iLo .. iHi inclusive is the range of segment indices which
- seg will replace. If we're replacing more than one segment,
- slide those above the range down to fill the hole. Before doing
- that decrement the reference counters for the segments names of
- the replaced segments. */
- for (i = iLo; i <= iHi; ++i)
- ML_(am_dec_refcount)(nsegments[i].fnIdx);
- delta = iHi - iLo;
+#ifdef ASPACEMGR_UNIT_TEST
+ if (nopost) return subtree; // return values does not matter
+#endif
- if (delta > 0) {
- for (i = iLo; i < nsegments_used-delta; i++)
- nsegments[i] = nsegments[i+delta];
- nsegments_used -= delta;
+ DEBUG("\nPOST PROCESSING\n");
+ // It cannot be that both children of the subtree are leaves.
+ // Assume both children L and R are leaves with (L) = [p,x] and
+ // (R) = [x+1,q]. As L needs to contain a node [from,...] it follows
+ // that p = from. Likewise, R needs to contain a node [...,to] and
+ // therefore q = to. So (subtree) = [p,q] = [from,to]. But that is
+ // a special case that we already considered above.
+ aspacem_assert(! (is_leaf(subtree->left) && is_leaf(subtree->right)));
+ NSegment *l = subtree->left;
+ NSegment *r = subtree->right;
+ if (is_leaf(l)) { // Tests: l1 0:60
+ /* Consider inserting [0:60] in the tree on the left. The tree in
+ the middle is 'subtree'. The tree on the right is what 'subtree'
+ gets transformed into.
+
+ 0:100 0:100 0:100
+ / \ --> / \ --> / \
+ 0:50 51:100 0:50 51:100 0:60 61:100
+ / \
+ 51:60 61:100
+ */
+ NSegment *rl = r->left;
+ NSegment *rr = r->right;
+ aspacem_assert(is_leaf(rl));
+ aspacem_assert(l->end + 1 == rl->start);
+ l->end = rl->end;
+ delete_node(rl);
+ subtree->right = r->right;
+ rr->up = r->up;
+ delete_node(r);
+ return subtree->left;
+ } else if (is_leaf(r)) { // Tests: l1 30:100
+ /* Consider inserting [30:100] in the tree on the left. The tree in
+ the middle is 'subtree'. The tree on the right is what 'subtree'
+ gets transformed into.
+
+ 0:100 0:100 0:100
+ / \ --> / \ --> / \
+ 0:50 51:100 0:50 51:100 0:29 30:100
+ / \
+ 0:29 30:50
+ */
+ NSegment *ll = l->left;
+ NSegment *lr = l->right;
+ aspacem_assert(is_leaf(lr));
+ aspacem_assert(lr->end + 1 == r->start);
+ r->start = lr->start;
+ delete_node(lr);
+ subtree->left = l->left;
+ ll->up = l->up;
+ delete_node(l);
+ return subtree->right;
+ } else { // Tests: l1 30:80
+ /* Consider inserting [30:80] in the tree on the left. The tree in
+ the middle is 'subtree'. The tree on the right is what 'subtree'
+ gets transformed into.
+
+ 0:100 ___0:100___ 0:100
+ / \ --> / \ --> / \
+ 0:50 51:100 0:50 51:100 0:80 81:100
+ / \ / \ / \
+ 0:29 30:50 51:80 81:100 0:29 30:80
+ */
+ NSegment *lr = l->right;
+ NSegment *rl = r->left;
+ aspacem_assert(is_leaf(lr));
+ aspacem_assert(is_leaf(rl));
+ aspacem_assert(lr->end + 1 == rl->start);
+
+ NSegment *new = new_leaf(l, SkResvn, from, to); // to replace lr
+ l->end = new->end;
+ l->right = new;
+ delete_node(lr);
+
+ NSegment *rr = r->right;
+ rr->up = r->up;
+ subtree->right = r->right;
+ delete_node(rl);
+ delete_node(r);
+ return subtree->left->right;
}
+}
+
+void ML_(am_add_segment)( const NSegment *seg )
+{
+ DEBUG("adding segment "INTERVAL_FMT"\n", seg->start, seg->end);
- nsegments[iLo] = *seg;
+ NSegment *new = insert_node(seg->start, seg->end);
- preen_segments();
- if (0) VG_(am_show_nsegments)(0,"AFTER preen (add_segment)");
+ aspacem_assert(new->start == seg->start && new->end == seg->end);
+
+ /* Initialise the new segment with the template segment, but be careful
+ not to overwrite the left, right, and up links. */
+ NSegment *left = new->left;
+ NSegment *right = new->right;
+ NSegment *up = new->up;
+
+ *new = *seg;
+ new->up = up;
+ new->left = left;
+ new->right = right;
+
+ if (expensive_checking) check_tree(root_segment());
+ // ML_(am_write_dot)(root_segment(), "add.dot");
}
-void
-ML_(am_segments_init)( void )
+/* Add a single interval covering the entire address space. */
+void ML_(am_segments_init)( void )
{
NSegment seg;
@@ -634,20 +1249,27 @@
/*--- ---*/
/*-----------------------------------------------------------------*/
+/* Helper function for VG_(am_get_anonsize_total) */
+static void
+sumup_anonsize( const NSegment *seg, ULong *total )
+{
+ if (is_leaf(seg)) {
+ if (seg->kind == SkAnonC || seg->kind == SkAnonV)
+ *total += seg->end - seg->start + 1;
+ return;
+ }
+ /* Recurse */
+ sumup_anonsize(seg->left, total);
+ sumup_anonsize(seg->right, total);
+}
+
/* Return the total amount of space in anonymous mappings,
both for V and the client. Is used for printing stats in
out-of-memory messages. */
ULong VG_(am_get_anonsize_total)( void )
{
- Int i...
[truncated message content] |
|
From: <sv...@va...> - 2015-07-08 09:22:49
|
Author: sewardj
Date: Wed Jul 8 10:22:40 2015
New Revision: 15401
Log:
Roughly classify all the bugs in 3_10_BUGSTATUS.txt.
Modified:
trunk/NEWS
trunk/docs/internals/3_10_BUGSTATUS.txt
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Wed Jul 8 10:22:40 2015
@@ -205,10 +205,12 @@
344621 Fix memcheck/tests/err_disable4 test on OS X
344686 Fix suppression for pthread_rwlock_init on OS X 10.10
344702 Fix missing libobjc suppressions on OS X 10.10
+ == 344543
344936 Fix unhandled syscall: unix:473 (readlinkat) on OS X 10.10
344939 Fix memcheck/tests/xml1 on OS X 10.10
345016 helgrind/tests/locked_vs_unlocked2 is failing sometimes
345079 Fix build problems in VEX/useful/test_main.c
+345126 Incorrect handling of VIDIOC_G_AUDIO and G_AUDOUT
345215 Performance improvements for the register allocator
345394 Fix memcheck/tests/strchr on OS X
345637 Fix memcheck/tests/sendmsg on OS X
@@ -216,6 +218,7 @@
345824 Fix aspacem segment mismatch: seen with none/tests/bigcode
345887 Fix an assertion in the address space manager
345928 amd64: callstack only contains current function for small stacks
+345987 MIPS64: Implement cavium LHX instruction
346267 Compiler warnings for PPC64 code on call to LibVEX_GuestPPC64_get_XER()
and LibVEX_GuestPPC64_get_CR()
346270 Regression tests none/tests/jm_vec/isa_2_07 and
@@ -225,9 +228,12 @@
346416 Add support for LL_IOC_PATH2FID and LL_IOC_GETPARENT Lustre ioctls
346474 PPC64 Power 8, spr TEXASRU register not supported
346487 Compiler generates "note" about a future ABI change for PPC64
+346562 MIPS64: lwl/lwr instructions are performing 64bit loads
+ and causing spurious "invalid read of size 8" warnings
346801 Fix link error on OS X: _vgModuleLocal_sf_maybe_extend_stack
347151 Fix suppression for pthread_rwlock_init on OS X 10.8
347233 Fix memcheck/tests/strchr on OS X 10.10 (Haswell)
+347322 Power PC regression test cleanup
347379 valgrind --leak-check=full memleak errors from system libraries on OS X 10.8
== 217236
347389 unhandled syscall: 373 (Linux ARM syncfs)
Modified: trunk/docs/internals/3_10_BUGSTATUS.txt
==============================================================================
--- trunk/docs/internals/3_10_BUGSTATUS.txt (original)
+++ trunk/docs/internals/3_10_BUGSTATUS.txt Wed Jul 8 10:22:40 2015
@@ -4,14 +4,14 @@
=== VEX/amd64 ==========================================================
+338602 AVX2 bit in CPUID missing
+ need to do XSAVE, XRSTOR
+
339218 AVX2 binaries compiled with the Intel compiler fail to
run under Valgrind 3.10.0
FIXME: should we enable this now?
== 338602
-338602 AVX2 bit in CPUID missing
- need to do XSAVE, XRSTOR
-
339596 vex amd64->IR: 0x8F 0xE8 0x78 0xCD 0xC1 0x4 0xC5 0xF9
XOP/FMA -- should take
@@ -27,6 +27,22 @@
342988 INT 80 not recognised on amd64
+346476 vex amd64->IR: 0xC5 0xFD 0xC2 0xC1 0x10 0xC5 0xFD 0x29
+ (various AVX CMP variants)
+
+346912 callgrind bails out on vpmaskmovd instruction
+ I think this is fixed now. Need to check.
+
+347698 3.10.1 doesn't recognize cmpsd generated by DynASM
+
+347885 unhandled instruction bytes: 0xD6 0xF 0x84 0x1B (SALC amd64)
+
+348387 Valgrind does not recognize a variant of the VCMPPD instruction
+
+348574 vex amd64->IR pcmpistri SSE4.2 instruction is unsupported
+
+349304 vex amd64->IR: 0xF 0x33 0x89 0x45 0xFC 0x89 0x55 0xF8
+
=== VEX/arm ============================================================
335618 mov.w rN, pc/sp (ARM32)
@@ -44,8 +60,22 @@
maybe easy fix?
but doesn't run natively either
+345984 disInstr(arm): unhandled instruction: 0xEE193F1E
+
+345985 disInstr(arm): unhandled instruction: 0xF2200150
+
+346665 valgrind: the 'impossible' happened: LibVEX called failure_exit().
+ armv6 probable failure
+
+348377 Unsupported ARM instruction: yield
+
+348536 ARM32: Unhandled instructions 0xEE190F1D & 0xEC510F1E
+ == 331178
+
=== VEX/arm64 ==========================================================
+345177 arm64: prfm (reg) not implemented
+
=== VEX/x86 ============================================================
339416 unhandled instruction bytes 0xC5 0xF1 0xEF 0xC9
@@ -57,6 +87,20 @@
342192 Unhandled instruction on OS X 10.9 in libsystem_m.dylib
possibly a wontfix
+344139 vex x86->IR: 0x36 0x8A 0x18 0x22 (and many other examples)
+ stack segment overrides
+
+344547 vex x86->IR: 0xC5 0xF8 0x77 0xE9
+ avx on x86
+
+345261 Unsupported instruction 0xC5 0xFB 0x10 0x44 (vmovsd
+ 0x8(%esp),%xmm0)
+ avx on x86
+
+348749 guest_generic_x87.c:458: bad ? : operator
+
+349891 vex x86->IR: unhandled instruction bytes: 0xF3 0xF 0xB8 0xC9
+
=== VEX/mips ===========================================================
340777 Illegal instruction on mips (ar71xx)
@@ -64,10 +108,21 @@
341997 MIPS64: Cavium OCTEON instructions - immediate operand handled
incorrectly
+344524 store conditional of guest applications always fail (Octeon3(MIPS)
+ discussed, complex, partial fix available
+
+346031 MIPS: Implement support for the CvmCount register (rhwr %0, 31)
+ has patch
+
+346411 MIPS: SysRes::_valEx handling is incorrect
+
=== VEX/ppc ============================================================
342610 disInstr(ppc): declined to decode an AltiVec insn.
+348334 valgrind does not simulate dcbfl - then my program terminates
+ I think this is actually fixed, and needs closing.
+
=== VEX/s390x ==========================================================
342841 s390x unrecognized instruction fiebra
@@ -101,6 +156,24 @@
343099 Linux setns syscall wrapper missing, unhandled syscall: 308
HAS PATCH. Check that mayBlock is enabled.
+344886 V should not try to extend a sigaltstack
+
+345077 linux syscall execveat support (linux 3.19)
+
+345338 TIOCGSERIAL and TIOCSSERIAL ioctl support on Linux
+ has patch
+
+345414 WARNING: unhandled syscall: 317 (sys_seccomp)
+
+348269 support of mmap for huge pages is broken at least on amd64
+
+348616 Wine/valgrind: Warning: noted but unhandled ioctl 0x5390 with
+ no size/direction hints. (DVD_READ_STRUCT)
+
+349034 Add Lustre ioctls LL_IOC_GROUP_LOCK and LL_IOC_GROUP_UNLOCK
+
+349952 Valgrind terminates process upon a call to remap_file_pages
+
=== Debuginfo reader ===================================================
327427 ifunc crash when symbols are discarded
@@ -115,6 +188,15 @@
340854 valgrind-di-server: allow specification of multiple paths
has patch, unclear if Right Thing To Do
+344052 Cost of dynamically loaded library is not properly linked to
+ source code lines if the library is unloaded before exit
+ This is the usual "debuginfo not available after dlclose" problem
+
+345975 Artificial functions in backtrace
+ more Dwarf complexity
+
+348345 Assertion fails for negative lineno
+
=== Tools/Memcheck =====================================================
339499 memcheck does not always detect access beyond mmaped page
@@ -130,6 +212,20 @@
342683 memory past the brk limit is not initially inaccessible/unaddressable
+345307 Please suppress warning about "still reachable" memory
+ when using libstdc++ from gcc 5
+
+345751 OS X: Incorrect result for operator Iop_Add32 and Iop_Add64
+ due to mce.useLLVMworkarounds = True
+
+345753 OS X: sanityCheckFail: exiting due to bad IR for Iop_AddF64
+ IR type error; should look at it
+
+345811 annotate also FP for memcheck dirty helpers
+ has patch, should commit
+
+349879 [PATCH] memcheck: add handwritten assembly for helperc_LOADV*
+
=== Tools/DRD ==========================================================
=== Tools/Helgrind =====================================================
@@ -140,6 +236,8 @@
== LK_rdwr' failed.
against 3.8.1
+345121 helgrind/tests/hg05_race2 fails intermittently
+
=== Tools/SGCheck ======================================================
340021 sgcheck tool does not work properly on ARM
@@ -168,9 +266,28 @@
342356 MIPS: determine page size at runtime
Has patch; could possibly land?
+345763 MIPS N32 ABI support
+ various patches, no upstream action so far
+
+348924 MIPS: Load doubles through memory so the code compiles with the FPXX ABI
+
+=== other/ppc ==========================================================
+
+346185 Fix typo saving altivec register v24
+
+347686 Patch set to cleanup PPC64 regtests
+
=== other/arm ==========================================================
+348252 ARM: test vcvt_fixed_float_VFP causes compiler errors
+
+348325 Valgrind becomes noisy when compiled with gcc 4.9
+
=== other/s390 =========================================================
+=== other/tilegx =======================================================
+
+345921 Add TileGX instruction set test in non/tests/tilegx/
+
=== other/Android ======================================================
339605 vgpreload_helgrind-arm-linux.so is not liked to libc.so
@@ -219,6 +336,24 @@
343663 [OSX Yosemite 10.10.1] The memcheck tool always reports a
leak regardless of the simplicity of the program.
+344416 'make regtest' does not work cleanly on OS X
+ meta-bug
+
+348565 unknown warning options on clang/osx:
+ Wmissing-parameter-type Wold-style-declaration
+
+348909 Support OS X 10.11 (El Capitan)
+
+349128 Access not within mapped region in _pthread_find_thread (OS X 10.11)
+
+349129 memcheck/tests/wrap6 fails on OS X 10.11
+
+349521 Valgrind misses some line numbers in output on OS X 10.11
+
+349769 clang/osx: ld: warning: -read_only_relocs cannot be used with x86_64
+
+349804 wine/osx: mmap-FIXED(0x1000, 1073741824) failed in UME (load_segment2)
+
=== other/Win32 =======================================================
211529 valgrind doesn't show proper call stacks for programs compiled
@@ -227,7 +362,14 @@
342117 Valgrind hangs after loading PDB file for MSVC compiled Firefox
under Wine
+344382 Memcheck has high false error rates on MSVC2013 compiled,
+ optimised, code in progress
+ fixed, but preffed off
+
=== GDB server =========================================================
+
+348358 describe should show info about main stack guard page
+
=== Output =============================================================
339405 Adds ability to invoke a script in order to determine a
@@ -262,6 +404,8 @@
343715 valgrind hangs after vgdb help request
+349790 Clean up of the hardware capability checking utilities.
+
=== Uncategorised/build=================================================
339215 Valgrind 3.10.0 contain 2013 in copyrights notice
@@ -278,6 +422,19 @@
343553 e500 chip now supports it? and,how about armv5
+344019 new tool: trackptr to track pointer usage
+
+344401 x32 ABI support
+
+345248 add support for Solaris OS in valgrind
+
+348279 Replace asm with __asm__ (for -std=c99).
+ Probably wontfix; queried
+
+348342 Valgrind does not support android-x86_64
+
+349954 Cannot start memcheck: permission denied
+
========================================================================
========================================================================
========================================================================
@@ -293,218 +450,8 @@
========================================================================
========================================================================
-Tue 3 Feb 00:14:18 CET 2015
-
Check: space recovery in aspacemgr segnames array re-implemented?
-
-344019 new tool: trackptr to track pointer usage
-no action so far
-
-344052 Cost of dynamically loaded library is not properly linked to
- source code lines if the library is unloaded before exit
-
-344139 vex x86->IR: 0x36 0x8A 0x18 0x22 (and many other examples)
-stack segment overrides
-
-344337 OS X 10.10 unhandled syscall
-
-344382 Memcheck has high false error rates on MSVC2013 compiled,
- optimised, code in progress
-fixed, but preffed off
-
-344401 x32 ABI support
-no action
-
-344416 'make regtest' does not work cleanly on OS X
-meta-bug
-
-344512 unhandled syscal: unix:349
-
-344524 store conditional of guest applications always fail (Octeon3(MIPS)
-discussed, partial fix available
-
-344543 --leak-check=full memleak errors from system libraries in OS X 10.10.2
-can possibly close
-
-344547 vex x86->IR: 0xC5 0xF8 0x77 0xE9
-avx on x86
-
-344560 Stack traces missing penultimate frame
-has plausible patch
-
-Thu 5 Mar 18:08:27 CET 2015
-
-344886 V should not try to extend a sigaltstack
-unclear what the situation is
-
-344936 unhandled syscall: unix:473 (readlinkat) on OS X 10.10
-
-345077 linux syscall execveat support (linux 3.19)
-has patch
-
-345121 helgrind/tests/hg05_race2 fails intermittently
-
-345126 Incorrect handling of VIDIOC_G_AUDIO and G_AUDOUT
-has patch
-
-345177 arm64: prfm (reg) not implemented
-
-345248 add support for Solaris OS in valgrind
-
-345261 Unsupported instruction 0xC5 0xFB 0x10 0x44 (vmovsd
- 0x8(%esp),%xmm0)
-avx on x86
-
-345307 Please suppress warning about "still reachable" memory
- when using libstdc++ from gcc 5
-
-345338 TIOCGSERIAL and TIOCSSERIAL ioctl support on Linux
-has patch
-
-345414 I get the following when I ran valgrind WARNING:
- unhandled syscall: 317
-sys_seccomp
-
-345751 OS X: Incorrect result for operator Iop_Add32 and Iop_Add64
-due to mce.useLLVMworkarounds = True
-
-345753 OS X: sanityCheckFail: exiting due to bad IR for Iop_AddF64
-IR type error; should look at it
-
-345763 MIPS N32 ABI support
-various patches, no upstream action so far
-
-345811 annotate also FP for memcheck dirty helpers
-has patch, should commit
-
-345824 aspacem segment mismatch on OS X: seen with none/tests/bigcode
-but also for s390-linux; confusing
-
-345921 Add TileGX instruction set test in non/tests/tilegx/
-
-345928 amd64: callstack only contains current function for small stacks
-has patch, but needs further investigation
-
-345929 Crash when running with `--gen-suppressions=yes` after
- entering 'y' to confirm
-probable easy fix
-
-345975 Artificial functions in backtrace
-more Dwarf complexity
-
-345984 disInstr(arm): unhandled instruction: 0xEE193F1E
-
-345985 disInstr(arm): unhandled instruction: 0xF2200150
-
-345987 MIPS64: Implement cavium LHX instruction
-has patches
-
-346023 valgrind crashes when run over mono program
-roundsd, sse 4.1, x86
-
-346031 MIPS: Implement support for the CvmCount register (rhwr %0, 31)
-has patch
-
-346185 Fix typo saving altivec register v24
-has patch
-
-346411 MIPS: SysRes::_valEx handling is incorrect
-
-346476 vex amd64->IR: 0xC5 0xFD 0xC2 0xC1 0x10 0xC5 0xFD 0x29
-
-346562 MIPS64: lwl/lwr instructions are performing 64bit loads
- and causing spurious "invalid read of size 8" warnings
-has patch
-
-346665 valgrind: the 'impossible' happened: LibVEX called failure_exit().
-armv6 probable failure
-
-Tue 28 Apr 13:48:40 CEST 2015
-
-346912 callgrind bails out on vpmaskmovd instruction
-
-347198 vex x86->IR: unhandled instruction bytes: 0x66 0xF 0x3A 0x63
-
-347233 Fix memcheck/tests/strchr on OS X 10.10 (Haswell)
-
-347322 Power PC regression test cleanup
-
-Fri 8 May 11:52:14 CEST 2015
-
-347686 Patch set to cleanup PPC64 regtests
-
-347698 3.10.1 doesn't recognize cmpsd generated by DynASM
-
-347885 unhandled instruction bytes: 0xD6 0xF 0x84 0x1B (SALC amd64)
-
-Tue 19 May 11:22:52 CEST 2015
-
-347982 Undefined symbols for architecture x86_64: "_global", referenced from: _test_so_global in tls_so-tls_so.o (OSX Yosemite)
-
-347988 Memcheck: the 'impossible' happened: unexpected size for Addr (OSX/wine)
-
-347991 false positive when using intrinsic fortran function "present"
-probable invalid
-
-348252 ARM: test vcvt_fixed_float_VFP causes compiler errors
-
-348269 support of mmap for huge pages is broken at least on amd64
-
-348279 Replace asm with __asm__ (for -std=c99).
-
-348325 Valgrind becomes noisy when compiled with gcc 4.9
-
-348334 valgrind does not simulate dcbfl - then my program terminates
-
-348342 Valgrind does not support android-x86_64
-
-348345 Assertion fails for negative lineno
-
-348358 describe should show info about main stack guard page
-
-348377 Unsupported ARM instruction: yield
-
-348387 Valgrind does not recognize a variant of the VCMPPD instruction
-
-348536 Unhandled instructions
-
-348565 unknown warning options on clang/osx: Wmissing-parameter-type Wold-style-declaration
-
-348574 vex amd64->IR pcmpistri SSE4.2 instruction is unsupported
-
-348616 Wine/valgrind: Warning: noted but unhandled ioctl 0x5390 with no size/direction hints. (DVD_READ_STRUCT)
-
-Fri 5 Jun 13:41:51 CEST 2015
-
-348749 guest_generic_x87.c:458: bad ? : operator
-
-348909 Support OS X 10.11 (El Capitan)
-
-348924 MIPS: Load doubles through memory so the code compiles with the FPXX ABI
-
-349034 Add Lustre ioctls LL_IOC_GROUP_LOCK and LL_IOC_GROUP_UNLOCK
-
-349128 Access not within mapped region in _pthread_find_thread (OS X 10.11)
-
-349129 memcheck/tests/wrap6 fails on OS X 10.11
-
-349304 vex amd64->IR: 0xF 0x33 0x89 0x45 0xFC 0x89 0x55 0xF8
-
-349521 Valgrind misses some line numbers in output
-
-349769 clang/osx: ld: warning: -read_only_relocs cannot be used with x86_64
-
-349790 Clean up of the hardware capability checking utilities.
-
-349804 valgrind/osx: running wine's unit tests under valgrind fails with:
- loader/wine: Undefined error: 0
-
-349879 [PATCH] memcheck: add handwritten assembly for helperc_LOADV*
-
-349891 vex x86->IR: unhandled instruction bytes: 0xF3 0xF 0xB8 0xC9
-
-349952 Valgrind terminates process upon a call to remap_file_pages
-
-349954 Cannot start memcheck: permission denied
+Check: missing copyright notices in include/vki/*xen*.h
+Check: 346411 MIPS: SysRes::_valEx handling is incorrect
Tue 7 Jul 15:27:23 CEST 2015
|