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
(9) |
2
(11) |
3
(3) |
4
(7) |
5
(15) |
|
6
(10) |
7
(9) |
8
(12) |
9
(10) |
10
(6) |
11
(12) |
12
(12) |
|
13
(11) |
14
(14) |
15
(18) |
16
(15) |
17
(19) |
18
(15) |
19
(9) |
|
20
|
21
(5) |
22
(10) |
23
(15) |
24
(18) |
25
(20) |
26
(15) |
|
27
(14) |
28
(11) |
29
(17) |
30
(17) |
31
(23) |
|
|
|
From: <sv...@va...> - 2014-07-08 22:28:35
|
Author: philippe
Date: Tue Jul 8 22:28:26 2014
New Revision: 14147
Log:
Rollback the (functional) effect of 13944 and 14134
Re-opening the FIFO before closing it gives (difficult to understand)
problems => rollback the change that keeps the FIFO opened.
Rather handle the race condition by retrying at vgdb side.
See extensive comments in remote-utils.c
Modified:
trunk/coregrind/m_gdbserver/remote-utils.c
trunk/coregrind/vgdb.c
Modified: trunk/coregrind/m_gdbserver/remote-utils.c
==============================================================================
--- trunk/coregrind/m_gdbserver/remote-utils.c (original)
+++ trunk/coregrind/m_gdbserver/remote-utils.c Tue Jul 8 22:28:26 2014
@@ -463,25 +463,31 @@
if (remote_desc != INVALID_DESCRIPTOR) {
/* Fully close the connection, either due to orderly_finish or
- to reset_after_fork.
- For reset_after_error, we must always keep the reading side open,
- to always be ready to accept new vgdb connection. So, we first
- re-open the FIFO before closing the currently opened fd. */
- if (reason == reset_after_error) {
- /* Save current remote_desc, and set it to invalid, so that
- setup_remote_desc_for_reading does (re-)open the read FIFO side. */
- int save_remote_desc = remote_desc;
- remote_desc = INVALID_DESCRIPTOR;
- setup_remote_desc_for_reading();
- VG_(close) (save_remote_desc);
- } else {
- vg_assert (reason == reset_after_fork || reason == orderly_finish);
- remote_desc_pollfdread_activity.fd = INVALID_DESCRIPTOR;
- remote_desc_pollfdread_activity.events = 0;
- remote_desc_pollfdread_activity.revents = 0;
- VG_(close) (remote_desc);
- remote_desc = INVALID_DESCRIPTOR;
- }
+ to reset_after_fork or reset_after_error. For
+ reset_after_error, the FIFO will be re-opened soon. This
+ leaves a small window during which a race condition can
+ happen between vgdb and a forking process: Just after fork,
+ both the parent and the child have the FIFO open. The child
+ will close it asap (as part of the 'after fork cleanup'). If
+ 2 vgdbs are launched very quickly just after the fork, the
+ parent will close its FIFO when the 1st vgdb exits. Then if
+ the 2nd vgdb is started before the parent has the time to
+ re-open the FIFO, the 2nd vgdb will be able to open the FIFO
+ (as it is still opened by the child). The 2nd vgdb can then
+ have a 'write' error when the child closes the FIFO. After
+ the 1st vgdb closes its FIFO write side, the parent gets EOF
+ on its reading FIFO till it is closed and re-opened. Opening
+ a 2nd time the FIFO before closing the 'previous fd' solves
+ this race condition, but causes other (not understood)
+ problems due to too early re-invocation of gdbsrv. Rather
+ than to handle this race condition in gdbsrv side, we put a
+ 'retry' loop in vgdb for the initial write on the write
+ FIFO. */
+ remote_desc_pollfdread_activity.fd = INVALID_DESCRIPTOR;
+ remote_desc_pollfdread_activity.events = 0;
+ remote_desc_pollfdread_activity.revents = 0;
+ VG_(close) (remote_desc);
+ remote_desc = INVALID_DESCRIPTOR;
}
noack_mode = False;
Modified: trunk/coregrind/vgdb.c
==============================================================================
--- trunk/coregrind/vgdb.c (original)
+++ trunk/coregrind/vgdb.c Tue Jul 8 22:28:26 2014
@@ -958,7 +958,17 @@
We then start to wait for packets (normally first a resume reply)
At that point, we send our command and expect replies */
buf[0] = '\003';
- write_buf(to_pid, buf, 1, "write \\003 to wake up", /* notify */ True);
+ i = 0;
+ while (!write_buf(to_pid, buf, 1,
+ "write \\003 to wake up", /* notify */ True)) {
+ /* If write fails, retries up to 10 times every 0.5 seconds
+ This aims at solving the race condition described in
+ remote-utils.c remote_finish function. */
+ usleep(500*1000);
+ i++;
+ if (i >= 10)
+ XERROR (errno, "failed to send wake up char after 10 trials\n");
+ }
from_pid = open_fifo(to_gdb_from_pid, O_RDONLY,
"read cmd result from pid");
|
Author: philippe
Date: Tue Jul 8 18:56:47 2014
New Revision: 14146
Log:
Apply text_debug_bias to inline IP extracted from dwarf3
Without this biasing, inline info is not correct for shared objects.
Updated test varinfo5 to use --read-inline-info=yes and added
an inline test case.
Note: the varinfo reader does not understand the inlining info, and
so variables in inlined functions are not properly described.
Modified:
trunk/coregrind/m_debuginfo/readdwarf3.c
trunk/memcheck/tests/suppvarinfo5.supp
trunk/memcheck/tests/varinfo5.stderr.exp
trunk/memcheck/tests/varinfo5.vgtest
trunk/memcheck/tests/varinfo5so.c
Modified: trunk/coregrind/m_debuginfo/readdwarf3.c
==============================================================================
--- trunk/coregrind/m_debuginfo/readdwarf3.c (original)
+++ trunk/coregrind/m_debuginfo/readdwarf3.c Tue Jul 8 18:56:47 2014
@@ -2593,6 +2593,9 @@
if (have_lo && have_hi1 && (!have_range)) {
/* This inlined call is just a single address range. */
if (ip_lo < ip_hi1) {
+ /* Apply text debug biasing */
+ ip_lo += cc->di->text_debug_bias;
+ ip_hi1 += cc->di->text_debug_bias;
ML_(addInlInfo) (cc->di,
ip_lo, ip_hi1,
get_inlFnName (inlinedfn_abstract_origin, cc, td3),
@@ -2606,6 +2609,8 @@
Word j;
HChar *inlfnname = get_inlFnName (inlinedfn_abstract_origin, cc, td3);
+ /* Why is get_range_list biasing with cc->cu_svma and
+ not with text_debug_bias ? */
ranges = get_range_list( cc, td3,
rangeoff, cc->cu_svma );
for (j = 0; j < VG_(sizeXA)( ranges ); j++) {
Modified: trunk/memcheck/tests/suppvarinfo5.supp
==============================================================================
--- trunk/memcheck/tests/suppvarinfo5.supp (original)
+++ trunk/memcheck/tests/suppvarinfo5.supp Tue Jul 8 18:56:47 2014
@@ -27,3 +27,12 @@
obj:*varinfo5so.so
obj:*varinfo5
}
+
+{
+ funinl_not_shown
+ Memcheck:User
+ fun:croak
+ fun:varinfo5_main
+ fun:main
+
+}
Modified: trunk/memcheck/tests/varinfo5.stderr.exp
==============================================================================
--- trunk/memcheck/tests/varinfo5.stderr.exp (original)
+++ trunk/memcheck/tests/varinfo5.stderr.exp Tue Jul 8 18:56:47 2014
@@ -178,3 +178,14 @@
declared at varinfo5so.c:135, in frame #1 of thread 1
answer is 0
+Uninitialised byte(s) found during client check request
+ at 0x........: croak (varinfo5so.c:29)
+ by 0x........: fun_c (varinfo5so.c:164)
+ by 0x........: fun_b (varinfo5so.c:168)
+ by 0x........: fun_a (varinfo5so.c:172)
+ by 0x........: inlinetest (varinfo5so.c:178)
+ by 0x........: varinfo5_main (varinfo5so.c:158)
+ by 0x........: main (varinfo5.c:5)
+ Address 0x........ is on thread 1's stack
+ in frame #1, created by varinfo5_main (varinfo5so.c:153)
+
Modified: trunk/memcheck/tests/varinfo5.vgtest
==============================================================================
--- trunk/memcheck/tests/varinfo5.vgtest (original)
+++ trunk/memcheck/tests/varinfo5.vgtest Tue Jul 8 18:56:47 2014
@@ -1,3 +1,3 @@
prog: varinfo5
-vgopts: --read-var-info=yes -q
+vgopts: --read-var-info=yes --read-inline-info=yes -q
stderr_filter: filter_varinfo3
Modified: trunk/memcheck/tests/varinfo5so.c
==============================================================================
--- trunk/memcheck/tests/varinfo5so.c (original)
+++ trunk/memcheck/tests/varinfo5so.c Tue Jul 8 18:56:47 2014
@@ -146,7 +146,7 @@
fprintf(stderr, "answer is %d\n", blah4(3,7) );
return 0;
}
-
+static void inlinetest(void);
/* ------------ varinfo5 ------------ */
void varinfo5_main ( void )
@@ -155,4 +155,25 @@
varinfo2_main();
varinfo3_main();
varinfo4_main();
+ inlinetest();
+}
+
+#define INLINE inline __attribute__((always_inline))
+
+INLINE void fun_c(int argc) {
+ croak(&argc);
+}
+
+INLINE void fun_b(int argb) {
+ fun_c(argb);
+}
+
+INLINE void fun_a(int *arga) {
+ fun_b(*arga);
+}
+
+void inlinetest(void)
+{
+ int i = 1;
+ fun_a(&i);
}
|
|
From: <sv...@va...> - 2014-07-08 16:59:11
|
Author: sewardj
Date: Tue Jul 8 16:59:02 2014
New Revision: 14145
Log:
Add a 32-bit-process only suppression, for OSX 10.8. Equivalent to
that of r14142 for 10.9.
Modified:
trunk/darwin12.supp
Modified: trunk/darwin12.supp
==============================================================================
--- trunk/darwin12.supp (original)
+++ trunk/darwin12.supp Tue Jul 8 16:59:02 2014
@@ -229,6 +229,14 @@
obj:*AppKit.framework/Versions/C/AppKit
}
+{
+ OSX108:32bit:_libxpc_initializer
+ Memcheck:Cond
+ fun:_libxpc_initializer
+ fun:libSystem_initializer
+ fun:*ImageLoaderMachO*doModInitFunctions*
+}
+
#########################################################
## Leaks (apparently) in even hello-world style programs
|
|
From: <sv...@va...> - 2014-07-08 09:36:13
|
Author: sewardj
Date: Tue Jul 8 09:36:06 2014
New Revision: 14144
Log:
Change the default setting --partial-loads-ok from "no" to "yes"
for Mac OS only. All other targets remain at "no".
Modified:
trunk/memcheck/mc_main.c
Modified: trunk/memcheck/mc_main.c
==============================================================================
--- trunk/memcheck/mc_main.c (original)
+++ trunk/memcheck/mc_main.c Tue Jul 8 09:36:06 2014
@@ -5173,8 +5173,15 @@
/*--- Command line args ---*/
/*------------------------------------------------------------*/
-
+/* --partial-loads-ok: enable by default on MacOS. The MacOS system
+ graphics libraries are heavily vectorised, and not enabling this by
+ default causes lots of false errors. */
+#if defined(VGO_darwin)
+Bool MC_(clo_partial_loads_ok) = True;
+#else
Bool MC_(clo_partial_loads_ok) = False;
+#endif
+
Long MC_(clo_freelist_vol) = 20*1000*1000LL;
Long MC_(clo_freelist_big_blocks) = 1*1000*1000LL;
LeakCheckMode MC_(clo_leak_check) = LC_Summary;
@@ -5347,7 +5354,12 @@
}
static void mc_print_usage(void)
-{
+{
+ const HChar* plo_default = "no";
+# if defined(VGO_darwin)
+ plo_default = "yes";
+# endif
+
VG_(printf)(
" --leak-check=no|summary|full search for memory leaks at exit? [summary]\n"
" --leak-resolution=low|med|high differentiation of leak stack traces [high]\n"
@@ -5366,7 +5378,7 @@
" same as --show-leak-kinds=definite\n"
" --undef-value-errors=no|yes check for undefined value errors [yes]\n"
" --track-origins=no|yes show origins of undefined values? [no]\n"
-" --partial-loads-ok=no|yes too hard to explain here; see manual [no]\n"
+" --partial-loads-ok=no|yes too hard to explain here; see manual [%s]\n"
" --freelist-vol=<number> volume of freed blocks queue [20000000]\n"
" --freelist-big-blocks=<number> releases first blocks with size>= [1000000]\n"
" --workaround-gcc296-bugs=no|yes self explanatory [no]\n"
@@ -5375,6 +5387,7 @@
" --free-fill=<hexnumber> fill free'd areas with given value\n"
" --keep-stacktraces=alloc|free|alloc-and-free|alloc-then-free|none\n"
" stack trace(s) to keep for malloc'd/free'd areas [alloc-then-free]\n"
+, plo_default
);
}
|
|
From: <sv...@va...> - 2014-07-08 08:19:02
|
Author: sewardj
Date: Tue Jul 8 08:18:55 2014
New Revision: 14143
Log:
OSX 10.8/10.9: remove warning message.
Modified:
trunk/coregrind/m_main.c
Modified: trunk/coregrind/m_main.c
==============================================================================
--- trunk/coregrind/m_main.c (original)
+++ trunk/coregrind/m_main.c Tue Jul 8 08:18:55 2014
@@ -1342,15 +1342,6 @@
else if (VG_(clo_verbosity) > 0)
VG_(umsg)("\n");
-# if defined(VGO_darwin) && DARWIN_VERS >= DARWIN_10_8
- /* Uh, this doesn't play nice with XML output. */
- umsg_or_xml( "WARNING: Support on MacOS 10.8/10.9 is experimental and mostly broken.\n");
- umsg_or_xml( "WARNING: Expect incorrect results, assertions and crashes.\n");
- umsg_or_xml( "WARNING: In particular, Memcheck on 32-bit programs will fail to\n");
- umsg_or_xml( "WARNING: detect any errors associated with heap-allocated data.\n");
- umsg_or_xml( "\n" );
-# endif
-
if (VG_(clo_verbosity) > 1) {
SysRes fd;
VexArch vex_arch;
|
|
From: <sv...@va...> - 2014-07-08 08:10:21
|
Author: sewardj
Date: Tue Jul 8 08:10:14 2014
New Revision: 14142
Log:
Add a 32-bit-process-only suppression.
Modified:
trunk/darwin13.supp
Modified: trunk/darwin13.supp
==============================================================================
--- trunk/darwin13.supp (original)
+++ trunk/darwin13.supp Tue Jul 8 08:10:14 2014
@@ -241,3 +241,11 @@
obj:/usr/lib/libz.*dylib
obj:/usr/lib/libz.*dylib
}
+
+{
+ OSX109:32bit:_libxpc_initializer
+ Memcheck:Cond
+ fun:_libxpc_initializer
+ fun:libSystem_initializer
+ fun:*ImageLoaderMachO*doModInitFunctions*
+}
|
|
From: <sv...@va...> - 2014-07-08 08:05:08
|
Author: sewardj
Date: Tue Jul 8 08:05:02 2014
New Revision: 14141
Log:
Make sanity check errors before/after syscalls be fatal.
Modified:
trunk/coregrind/m_scheduler/scheduler.c
Modified: trunk/coregrind/m_scheduler/scheduler.c
==============================================================================
--- trunk/coregrind/m_scheduler/scheduler.c (original)
+++ trunk/coregrind/m_scheduler/scheduler.c Tue Jul 8 08:05:02 2014
@@ -1075,13 +1075,21 @@
runnable again. We could take a signal while the
syscall runs. */
- if (VG_(clo_sanity_level >= 3))
- VG_(am_do_sync_check)("(BEFORE SYSCALL)",__FILE__,__LINE__);
+ if (VG_(clo_sanity_level >= 3)) {
+ HChar buf[50];
+ VG_(sprintf)(buf, "(BEFORE SYSCALL, tid %d)", tid);
+ Bool ok = VG_(am_do_sync_check)(buf, __FILE__, __LINE__);
+ vg_assert(ok);
+ }
SCHEDSETJMP(tid, jumped, VG_(client_syscall)(tid, trc));
- if (VG_(clo_sanity_level >= 3))
- VG_(am_do_sync_check)("(AFTER SYSCALL)",__FILE__,__LINE__);
+ if (VG_(clo_sanity_level >= 3)) {
+ HChar buf[50];
+ VG_(sprintf)(buf, "(AFTER SYSCALL, tid %d)", tid);
+ Bool ok = VG_(am_do_sync_check)(buf, __FILE__, __LINE__);
+ vg_assert(ok);
+ }
if (!VG_(is_running_thread)(tid))
VG_(printf)("tid %d not running; VG_(running_tid)=%d, tid %d status %d\n",
|
|
From: <sv...@va...> - 2014-07-08 08:04:33
|
Author: sewardj
Date: Tue Jul 8 08:04:25 2014
New Revision: 14140
Log:
Accuracy improvements to syscall wrappers for OSX 10.8 and 10.9.
Modified:
trunk/coregrind/m_syswrap/syswrap-darwin.c
trunk/coregrind/m_syswrap/syswrap-main.c
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c Tue Jul 8 08:04:25 2014
@@ -710,7 +710,7 @@
// Combine two 32-bit values into a 64-bit value
// Always use with low-numbered arg first (e.g. LOHI64(ARG1,ARG2) )
# if defined(VGA_x86)
-# define LOHI64(lo,hi) ( (lo) | ((ULong)(hi) << 32) )
+# define LOHI64(lo,hi) ( ((ULong)(UInt)(lo)) | (((ULong)(UInt)(hi)) << 32) )
# else
# error unknown architecture
# endif
@@ -1570,7 +1570,10 @@
POST(kevent64)
{
PRINT("kevent64 ret %ld dst %#lx (%zu)", RES, ARG4, sizeof(struct vki_kevent64));
- if (RES > 0) POST_MEM_WRITE(ARG4, RES * sizeof(struct vki_kevent64));
+ if (RES > 0) {
+ ML_(sync_mappings)("after", "kevent64", 0);
+ POST_MEM_WRITE(ARG4, RES * sizeof(struct vki_kevent64));
+ }
}
@@ -1660,6 +1663,16 @@
{
ThreadState *tst = VG_(get_ThreadState)(tid);
tst->os_state.wq_jmpbuf_valid = False;
+ switch (ARG1) {
+ case VKI_WQOPS_THREAD_RETURN:
+ ML_(sync_mappings)("after", "workq_ops(THREAD_RETURN)", 0);
+ break;
+ case VKI_WQOPS_QUEUE_REQTHREADS:
+ ML_(sync_mappings)("after", "workq_ops(QUEUE_REQTHREADS)", 0);
+ break;
+ default:
+ break;
+ }
}
@@ -3710,6 +3723,7 @@
// Try to load symbols from the region
VG_(di_notify_mmap)( (Addr)RES, False/*allow_SkFileV*/,
-1/*don't use_fd*/ );
+ ML_(sync_mappings)("after", "mmap", 0);
}
}
@@ -6498,11 +6512,15 @@
if (!reply->RetCode) {
// GrP fixme check src and dest tasks
PRINT("mapped at 0x%llx", reply->address);
+# if 0
// GrP fixme max prot
ML_(notify_core_and_tool_of_mmap)(
reply->address, VG_PGROUNDUP(MACH_ARG(mach_vm_map.size)),
MACH_ARG(mach_vm_map.protection), VKI_MAP_SHARED, -1, 0);
// GrP fixme VKI_MAP_PRIVATE if !copy?
+# else
+ ML_(sync_mappings)("after", "mach_vm_map", 0);
+# endif
} else {
PRINT("mig return %d", reply->RetCode);
}
@@ -8274,56 +8292,161 @@
Added for OSX 10.8 (Mountain Lion)
------------------------------------------------------------------ */
+/* About munge tags, eg munge_wllww.
+
+ Means the syscall takes 5 args. For a 64 bit process each arg
+ occupies one 64-bit value and so the mapping to ARGn macros is
+ direct. For a 32 bit process, this is more complex: 'w' denotes a
+ 32-bit word and 'l' a 64-bit word. Hence the wllww denotation
+ indicates that, in a 64 bit process, the args are: ARG1 ARG2 ARG3
+ ARG4 ARG5, but in a 32 bit process they are: ARG1 ARG3:ARG2
+ ARG5:ARG4 ARG6 ARG7. And we have to laboriously reconstruct them
+ in order to get sane values for the arguments in 32-bit
+ processes. */
+
+static void munge_wwl(UWord* a1, UWord* a2, ULong* a3,
+ UWord aRG1, UWord aRG2, UWord aRG3, UWord aRG4)
+{
+# if defined(VGA_x86)
+ *a1 = aRG1; *a2 = aRG2; *a3 = LOHI64(aRG3,aRG4);
+# else
+ *a1 = aRG1; *a2 = aRG2; *a3 = aRG3;
+# endif
+}
+
+static void munge_wll(UWord* a1, ULong* a2, ULong* a3,
+ UWord aRG1, UWord aRG2, UWord aRG3,
+ UWord aRG4, UWord aRG5)
+{
+# if defined(VGA_x86)
+ *a1 = aRG1; *a2 = LOHI64(aRG2,aRG3); *a3 = LOHI64(aRG4,aRG5);
+# else
+ *a1 = aRG1; *a2 = aRG2; *a3 = aRG3;
+# endif
+}
+
+static void munge_wwlw(UWord* a1, UWord* a2, ULong* a3, UWord* a4,
+ UWord aRG1, UWord aRG2, UWord aRG3,
+ UWord aRG4, UWord aRG5)
+{
+# if defined(VGA_x86)
+ *a1 = aRG1; *a2 = aRG2; *a3 = LOHI64(aRG3,aRG4); *a4 = aRG5;
+# else
+ *a1 = aRG1; *a2 = aRG2; *a3 = aRG3; *a4 = aRG4;
+# endif
+}
+
+static void munge_wwwl(UWord* a1, UWord* a2, UWord* a3, ULong* a4,
+ UWord aRG1, UWord aRG2, UWord aRG3,
+ UWord aRG4, UWord aRG5)
+{
+# if defined(VGA_x86)
+ *a1 = aRG1; *a2 = aRG2; *a3 = aRG3; *a4 = LOHI64(aRG4,aRG5);
+# else
+ *a1 = aRG1; *a2 = aRG2; *a3 = aRG3; *a4 = aRG4;
+# endif
+}
+
+static void munge_wllww(UWord* a1, ULong* a2, ULong* a3, UWord* a4, UWord* a5,
+ UWord aRG1, UWord aRG2, UWord aRG3,
+ UWord aRG4, UWord aRG5, UWord aRG6, UWord aRG7)
+{
+# if defined(VGA_x86)
+ *a1 = aRG1; *a2 = LOHI64(aRG2,aRG3); *a3 = LOHI64(aRG4,aRG5);
+ *a4 = aRG6; *a5 = aRG7;
+# else
+ *a1 = aRG1; *a2 = aRG2; *a3 = aRG3; *a4 = aRG4; *a5 = aRG5;
+# endif
+}
+
+static void munge_wwllww(UWord* a1, UWord* a2, ULong* a3,
+ ULong* a4, UWord* a5, UWord* a6,
+ UWord aRG1, UWord aRG2, UWord aRG3, UWord aRG4,
+ UWord aRG5, UWord aRG6, UWord aRG7, UWord aRG8)
+{
+# if defined(VGA_x86)
+ *a1 = aRG1; *a2 = aRG2;
+ *a3 = LOHI64(aRG3,aRG4); *a4 = LOHI64(aRG5,aRG6);
+ *a5 = aRG7; *a6 = aRG8;
+# else
+ *a1 = aRG1; *a2 = aRG2; *a3 = aRG3; *a4 = aRG4; *a5 = aRG5; *a6 = aRG6;
+# endif
+}
+
#if DARWIN_VERS >= DARWIN_10_8
PRE(kernelrpc_mach_vm_allocate_trap)
{
+ UWord a1; UWord a2; ULong a3; UWord a4;
+ munge_wwlw(&a1, &a2, &a3, &a4, ARG1, ARG2, ARG3, ARG4, ARG5);
PRINT("kernelrpc_mach_vm_allocate_trap"
- "(target:%s, address:%p, size:%#lx, flags:%#lx)",
- name_for_port(ARG1), *(void**)ARG2, ARG3, ARG4);
+ "(target:%s, address:%p, size:%#llx, flags:%#lx)",
+ name_for_port(a1), *(void**)a2, a3, a4);
PRE_MEM_WRITE("kernelrpc_mach_vm_allocate_trap(address)",
- ARG2, sizeof(void*));
- if ((ARG4 & VM_FLAGS_ANYWHERE) == VM_FLAGS_FIXED)
- ML_(notify_core_and_tool_of_mmap)(
- *(mach_vm_address_t*)ARG2, ARG3, VKI_PROT_READ|VKI_PROT_WRITE,
- VKI_MAP_ANON, -1, 0);
+ a2, sizeof(void*));
}
POST(kernelrpc_mach_vm_allocate_trap)
{
- PRINT("address:%p size:%#lx", *(void**)ARG2, ARG3);
- if (ML_(safe_to_deref)((void*)ARG2, sizeof(void*))) {
- POST_MEM_WRITE(ARG2, sizeof(void*));
- }
- if ((ARG4 & VM_FLAGS_ANYWHERE) != VM_FLAGS_FIXED)
+ UWord a1; UWord a2; ULong a3; UWord a4;
+ munge_wwlw(&a1, &a2, &a3, &a4, ARG1, ARG2, ARG3, ARG4, ARG5);
+ PRINT("address:%p size:%#llx", *(void**)a2, a3);
+ if (ML_(safe_to_deref)((void*)a2, sizeof(void*))) {
+ POST_MEM_WRITE(a2, sizeof(void*));
+ }
+ if (a1 == mach_task_self()) {
+# if 1
+ ML_(sync_mappings)("POST(kernelrpc_mach_vm_allocate_trap)", "??", 0);
+# else
+ /* This is nearly right, but not always -- sometimes the mapping
+ appears to be r--, for some reason. Hence resync. */
ML_(notify_core_and_tool_of_mmap)(
- *(mach_vm_address_t*)ARG2, ARG3,
+ *(UWord*)a2, a3,
VKI_PROT_READ|VKI_PROT_WRITE, VKI_MAP_ANON, -1, 0);
+# endif
+ }
}
PRE(kernelrpc_mach_vm_deallocate_trap)
{
+ UWord a1; ULong a2; ULong a3;
+ munge_wll(&a1, &a2, &a3, ARG1, ARG2, ARG3, ARG4, ARG5);
PRINT("kernelrpc_mach_vm_deallocate_trap"
- "(target:%#lx, address:%#lx, size:%#lx)", ARG1, ARG2, ARG3);
+ "(target:%#lx, address:%#llx, size:%#llx)", a1, a2, a3);
}
POST(kernelrpc_mach_vm_deallocate_trap)
{
+ UWord a1; ULong a2; ULong a3;
+ munge_wll(&a1, &a2, &a3, ARG1, ARG2, ARG3, ARG4, ARG5);
// kernelrpc_mach_vm_deallocate_trap could be call with
// address ==0 && size == 0,
// we shall not notify any unmap then
- if (ARG3)
- ML_(notify_core_and_tool_of_munmap)(ARG2, ARG3);
+ if (a3)
+ ML_(notify_core_and_tool_of_munmap)(a2, a3);
}
PRE(kernelrpc_mach_vm_protect_trap)
{
+ UWord a1; ULong a2; ULong a3; UWord a4; UWord a5;
+ munge_wllww(&a1, &a2, &a3, &a4, &a5,
+ ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7);
PRINT("kernelrpc_mach_vm_protect_trap"
- "(task:%#lx, address:%#lx, size:%#lx,"
- " set_maximum:%#lx, new_prot:%#lx)", ARG1, ARG2, ARG3, ARG4, ARG5);
- ML_(notify_core_and_tool_of_mprotect)(ARG2, ARG3, ARG5);
+ "(task:%#lx, address:%#llx, size:%#llx,"
+ " set_maximum:%#lx, new_prot:%#lx)", a1, a2, a3, a4, a5);
+}
+POST(kernelrpc_mach_vm_protect_trap)
+{
+ UWord a1; ULong a2; ULong a3; UWord a4; UWord a5;
+ munge_wllww(&a1, &a2, &a3, &a4, &a5,
+ ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7);
+ if (/*a4 set_maximum == 0 && */a1 == mach_task_self()) {
+ ML_(notify_core_and_tool_of_mprotect)((Addr)a2, (SizeT)a3, (Int)a5);
+ VG_(di_notify_vm_protect)((Addr)a2, (SizeT)a3, (UInt)a5);
+ }
}
PRE(kernelrpc_mach_port_allocate_trap)
{
+ // munge_www -- no need to call helper
PRINT("kernelrpc_mach_port_allocate_trap(task:%#lx, mach_port_right_t:%#lx)",
ARG1, ARG2);
PRE_MEM_WRITE("kernelrpc_mach_port_allocate_trap(name)",
@@ -8331,6 +8454,7 @@
}
POST(kernelrpc_mach_port_allocate_trap)
{
+ // munge_www -- no need to call helper
POST_MEM_WRITE(ARG3, sizeof(mach_port_name_t));
PRINT(", name:%#x", *(mach_port_name_t*)ARG3);
record_unnamed_port(tid, *(mach_port_name_t *)ARG3, ARG2);
@@ -8338,21 +8462,25 @@
PRE(kernelrpc_mach_port_destroy_trap)
{
+ // munge_ww -- no need to call helper
PRINT("kernelrpc_mach_port_destroy_trap(task:%#lx, name:%#lx)", ARG1, ARG2);
record_port_destroy(ARG2);
}
PRE(kernelrpc_mach_port_deallocate_trap)
{
+ // munge_ww -- no need to call helper
PRINT("kernelrpc_mach_port_deallocate_trap(task:%#lx, name:%#lx ) FIXME",
ARG1, ARG2);
}
POST(kernelrpc_mach_port_deallocate_trap)
{
+ // munge_ww -- no need to call helper
}
PRE(kernelrpc_mach_port_mod_refs_trap)
{
+ // munge_wwww -- no need to call helper
PRINT("kernelrpc_mach_port_mod_refs_trap"
"(task:%#lx, name:%#lx, right:%#lx refs:%#lx) FIXME",
ARG1, ARG2, ARG3, ARG4);
@@ -8360,6 +8488,7 @@
PRE(kernelrpc_mach_port_move_member_trap)
{
+ // munge_www -- no need to call helper
PRINT("kernelrpc_mach_port_move_member_trap"
"(task:%#lx, name:%#lx, after:%#lx ) FIXME",
ARG1, ARG2, ARG3);
@@ -8367,30 +8496,39 @@
PRE(kernelrpc_mach_port_insert_right_trap)
{
- PRINT("kernelrpc_mach_port_insert_right_trap(FIXME,ARGUMENTS_UNKNOWN)");
+ //munge_wwww -- no need to call helper
+ PRINT("kernelrpc_mach_port_insert_right_trap(FIXME)"
+ "(%lx,%lx,%lx,%lx)", ARG1, ARG2, ARG3, ARG4);
}
PRE(kernelrpc_mach_port_insert_member_trap)
{
- PRINT("kernelrpc_mach_port_insert_member_trap(FIXME,ARGUMENTS_UNKNOWN)");
+ // munge_www -- no need to call helper
+ PRINT("kernelrpc_mach_port_insert_member_trap(FIXME)"
+ "(%lx,%lx,%lx)", ARG1, ARG2, ARG3);
}
PRE(kernelrpc_mach_port_extract_member_trap)
{
- PRINT("kernelrpc_mach_port_extract_member_trap(FIXME,ARGUMENTS_UNKNOWN)");
+ // munge_www -- no need to call helper
+ PRINT("kernelrpc_mach_port_extract_member_trap(FIXME)"
+ "(%lx,%lx,%lx)", ARG1, ARG2, ARG3);
}
PRE(iopolicysys)
{
+ // munge_???
PRINT("iopolicysys(FIXME)(0x%lx, 0x%lx, 0x%lx)", ARG1, ARG2, ARG3);
/* mem effects unknown */
}
POST(iopolicysys)
{
+ // munge_???
}
PRE(process_policy)
{
+ // munge_???
PRINT("process_policy(FIXME)("
"scope:0x%lx, action:0x%lx, policy:0x%lx, policy_subtype:0x%lx,"
" attr:%lx, target_pid:%lx, target_threadid:%lx)",
@@ -8399,6 +8537,7 @@
}
POST(process_policy)
{
+ // munge_???
}
#endif /* DARWIN_VERS >= DARWIN_10_8 */
@@ -8409,44 +8548,64 @@
------------------------------------------------------------------ */
#if DARWIN_VERS >= DARWIN_10_9
+
PRE(kernelrpc_mach_vm_map_trap)
{
+ UWord a1; UWord a2; ULong a3; ULong a4; UWord a5; UWord a6;
+ munge_wwllww(&a1, &a2, &a3, &a4, &a5, &a6,
+ ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8);
PRINT("kernelrpc_mach_vm_map_trap"
- "(target:%#lx, address:%p, size:%#lx,"
- " mask:%#lx, flags:%#lx, cur_prot:%#lx)",
- ARG1, *(void**)ARG2, ARG3, ARG4, ARG5, ARG6);
- PRE_MEM_WRITE("kernelrpc_mach_vm_map_trap(address)", ARG2, sizeof(void*));
+ "(target:%#lx, address:%p, size:%#llx,"
+ " mask:%#llx, flags:%#lx, cur_prot:%#lx)",
+ a1, *(void**)a2, a3, a4, a5, a6);
+ PRE_MEM_WRITE("kernelrpc_mach_vm_map_trap(address)", a2, sizeof(void*));
}
POST(kernelrpc_mach_vm_map_trap)
{
- PRINT("-> address:%p", *(void**)ARG2);
- if (ML_(safe_to_deref)((void*)ARG2, sizeof(void*))) {
- POST_MEM_WRITE(ARG2, sizeof(void*));
+ UWord a1; UWord a2; ULong a3; ULong a4; UWord a5; UWord a6;
+ munge_wwllww(&a1, &a2, &a3, &a4, &a5, &a6,
+ ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8);
+ PRINT("-> address:%p", *(void**)a2);
+ if (ML_(safe_to_deref)((void*)a2, sizeof(void*))) {
+ POST_MEM_WRITE(a2, sizeof(void*));
}
ML_(notify_core_and_tool_of_mmap)(
- *(mach_vm_address_t*)ARG2, ARG3,
+ *(mach_vm_address_t*)a2, a3,
VKI_PROT_READ|VKI_PROT_WRITE, VKI_MAP_ANON, -1, 0);
- // ML_(sync_mappings)("after", "kernelrpc_mach_vm_map_trap", 0);
+ // ML_(sync_mappings)("after", "kernelrpc_mach_vm_map_trap", 0);
}
PRE(kernelrpc_mach_port_construct_trap)
{
- PRINT("kernelrpc_mach_port_construct_trap(FIXME,ARGUMENTS_UNKNOWN)");
+ UWord a1; UWord a2; ULong a3; UWord a4;
+ munge_wwlw(&a1, &a2, &a3, &a4, ARG1, ARG2, ARG3, ARG4, ARG5);
+ PRINT("kernelrpc_mach_port_construct_trap(FIXME)"
+ "(%lx,%lx,%llx,%lx)", a1, a2, a3, a4);
}
PRE(kernelrpc_mach_port_destruct_trap)
{
- PRINT("kernelrpc_mach_port_destruct_trap(FIXME,ARGUMENTS_UNKNOWN)");
+ UWord a1; UWord a2; UWord a3; ULong a4;
+ munge_wwwl(&a1, &a2, &a3, &a4, ARG1, ARG2, ARG3, ARG4, ARG5);
+ PRINT("kernelrpc_mach_port_destruct_trap(FIXME)"
+ "(%lx,%lx,%lx,%llx)", a1, a2, a3, a4);
}
PRE(kernelrpc_mach_port_guard_trap)
{
- PRINT("kernelrpc_mach_port_guard_trap(FIXME)");
+ UWord a1; UWord a2; ULong a3; UWord a4;
+ munge_wwlw(&a1, &a2, &a3, &a4, ARG1, ARG2, ARG3, ARG4, ARG5);
+ PRINT("kernelrpc_mach_port_guard_trap(FIXME)"
+ "(%lx,%lx,%llx,%lx)", a1, a2, a3, a4);
}
PRE(kernelrpc_mach_port_unguard_trap)
{
- PRINT("kernelrpc_mach_port_unguard_trap(FIXME)");
+ // munge_wwl
+ UWord a1; UWord a2; ULong a3;
+ munge_wwl(&a1, &a2, &a3, ARG1, ARG2, ARG3, ARG4);
+ PRINT("kernelrpc_mach_port_unguard_trap(FIXME)"
+ "(%lx,%lx,%llx)", a1, a2, a3);
}
#endif /* DARWIN_VERS >= DARWIN_10_9 */
@@ -8999,7 +9158,7 @@
_____(VG_DARWIN_SYSCALL_CONSTRUCT_MACH(13)),
# if DARWIN_VERS >= DARWIN_10_8
- MACX_(VG_DARWIN_SYSCALL_CONSTRUCT_MACH(14), kernelrpc_mach_vm_protect_trap),
+ MACXY(VG_DARWIN_SYSCALL_CONSTRUCT_MACH(14), kernelrpc_mach_vm_protect_trap),
# endif
# if DARWIN_VERS >= DARWIN_10_9
Modified: trunk/coregrind/m_syswrap/syswrap-main.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-main.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-main.c Tue Jul 8 08:04:25 2014
@@ -80,9 +80,10 @@
fills in the immediate field.
s390x r1/SVC r2 r3 r4 r5 r6 r7 n/a n/a r2 (== ARG1)
+ NUM ARG1 ARG2 ARG3 ARG4 ARG5 ARG6 ARG7 ARG8 RESULT
DARWIN:
- x86 eax +4 +8 +12 +16 +20 +24 +28 +32 edx:eax, eflags.c
- amd64 rax rdi rsi rdx rcx r8 r9 +8 +16 rdx:rax, rflags.c
+ x86 eax +4 +8 +12 +16 +20 +24 +28 +32 edx:eax, eflags.c
+ amd64 rax rdi rsi rdx rcx r8 r9 +8 +16 rdx:rax, rflags.c
For x86-darwin, "+N" denotes "in memory at N(%esp)"; ditto
amd64-darwin. Apparently 0(%esp) is some kind of return address
@@ -2380,6 +2381,8 @@
sci->flags |= SfNoWriteResult;
VG_(post_syscall)(tid);
+ ML_(sync_mappings)("in", "ML_(wqthread_continue_NORETURN)", 0);
+
sci->status.what = SsIdle;
vg_assert(tst->sched_jmpbuf_valid);
|
|
From: <sv...@va...> - 2014-07-08 07:55:52
|
Author: sewardj
Date: Tue Jul 8 07:55:44 2014
New Revision: 14139
Log:
OSX 10.9/10.8: Debuginfo reading FSM: enable recording of r-- mappings
so as to enable arrival at acceptance states via calls to
VG_(di_notify_vm_protect).
Modified:
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_debuginfo/priv_storage.h
Modified: trunk/coregrind/m_debuginfo/debuginfo.c
==============================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c (original)
+++ trunk/coregrind/m_debuginfo/debuginfo.c Tue Jul 8 07:55:44 2014
@@ -844,7 +844,7 @@
# error "Unknown platform"
# endif
-# if defined(VGP_x86_darwin) && DARWIN_VERS == DARWIN_10_7
+# if defined(VGP_x86_darwin) && DARWIN_VERS >= DARWIN_10_7
is_ro_map = seg->hasR && !seg->hasW && !seg->hasX;
# endif
@@ -981,7 +981,7 @@
}
-/* This is a MacOSX 10.7 32-bit only special. See comments on the
+/* This is a MacOSX >= 10.7 32-bit only special. See comments on the
declaration of struct _DebugInfoFSM for details. */
void VG_(di_notify_vm_protect)( Addr a, SizeT len, UInt prot )
{
Modified: trunk/coregrind/m_debuginfo/priv_storage.h
==============================================================================
--- trunk/coregrind/m_debuginfo/priv_storage.h (original)
+++ trunk/coregrind/m_debuginfo/priv_storage.h Tue Jul 8 07:55:44 2014
@@ -506,13 +506,19 @@
that is, take the first r-x and rw- mapping we see, and we're done.
- On MacOSX 10.7, 32-bit, there appears to be a new variant:
+ On MacOSX >= 10.7, 32-bit, there appears to be a new variant:
start --> r-- mapping --> rw- mapping
--> upgrade r-- mapping to r-x mapping --> accept
- where the upgrade is done by a call to vm_protect. Hence we
- need to also track this possibility.
+ where the upgrade is done by a call to mach_vm_protect (OSX 10.7)
+ or kernelrpc_mach_vm_protect_trap (OSX 10.9 and possibly 10.8).
+ Hence we need to also track this possibility.
+
+ From perusal of dyld sources, it appears that this scheme could
+ also be used 64 bit libraries, although that doesn't seem to happen
+ in practice. dyld uses this scheme when the text section requires
+ relocation, which only appears to be the case for 32 bit objects.
*/
struct _DebugInfoMapping
|
|
From: <sv...@va...> - 2014-07-08 07:50:26
|
Author: sewardj
Date: Tue Jul 8 07:50:19 2014
New Revision: 14138
Log:
Improve debug printing for the should-we-load-debuginfo-now? finite
state machine. No functional change.
Modified:
trunk/coregrind/m_debuginfo/debuginfo.c
Modified: trunk/coregrind/m_debuginfo/debuginfo.c
==============================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c (original)
+++ trunk/coregrind/m_debuginfo/debuginfo.c Tue Jul 8 07:50:19 2014
@@ -67,6 +67,11 @@
#endif
+/* Set this to 1 to enable debug printing for the
+ should-we-load-debuginfo-now? finite state machine. */
+#define DEBUG_FSM 0
+
+
/*------------------------------------------------------------*/
/*--- The _svma / _avma / _image / _bias naming scheme ---*/
/*------------------------------------------------------------*/
@@ -702,7 +707,7 @@
Int actual_fd, oflags;
SysRes preadres;
HChar buf1k[1024];
- Bool debug = False;
+ Bool debug = (DEBUG_FSM != 0);
SysRes statres;
struct vg_stat statbuf;
@@ -714,11 +719,13 @@
seg = VG_(am_find_nsegment)(a);
vg_assert(seg);
- if (debug)
+ if (debug) {
+ VG_(printf)("di_notify_mmap-0:\n");
VG_(printf)("di_notify_mmap-1: %#lx-%#lx %c%c%c\n",
seg->start, seg->end,
seg->hasR ? 'r' : '-',
seg->hasW ? 'w' : '-',seg->hasX ? 'x' : '-' );
+ }
/* guaranteed by aspacemgr-linux.c, sane_NSegment() */
vg_assert(seg->end > seg->start);
@@ -842,8 +849,9 @@
# endif
if (debug)
- VG_(printf)("di_notify_mmap-3: is_rx_map %d, is_rw_map %d\n",
- (Int)is_rx_map, (Int)is_rw_map);
+ VG_(printf)("di_notify_mmap-3: "
+ "is_rx_map %d, is_rw_map %d, is_ro_map %d\n",
+ (Int)is_rx_map, (Int)is_rw_map, (Int)is_ro_map);
/* Ignore mappings with permissions we can't possibly be interested in. */
if (!(is_rx_map || is_rw_map || is_ro_map))
@@ -906,6 +914,10 @@
di = find_or_create_DebugInfo_for( filename );
vg_assert(di);
+ if (debug)
+ VG_(printf)("di_notify_mmap-4: "
+ "noting details in DebugInfo* at %p\n", di);
+
/* Note the details about the mapping. */
struct _DebugInfoMapping map;
map.avma = a;
@@ -926,6 +938,9 @@
/* Ok, so, finally, we found what we need, and we haven't
already read debuginfo for this object. So let's do so now.
Yee-ha! */
+ if (debug)
+ VG_(printf)("di_notify_mmap-5: "
+ "achieved accept state for %s\n", filename);
return di_notify_ACHIEVE_ACCEPT_STATE ( di );
} else {
/* If we don't have an rx and rw mapping, or if we already have
@@ -970,16 +985,29 @@
declaration of struct _DebugInfoFSM for details. */
void VG_(di_notify_vm_protect)( Addr a, SizeT len, UInt prot )
{
+ Bool debug = (DEBUG_FSM != 0);
+
+ Bool r_ok = toBool(prot & VKI_PROT_READ);
+ Bool w_ok = toBool(prot & VKI_PROT_WRITE);
+ Bool x_ok = toBool(prot & VKI_PROT_EXEC);
+ if (debug) {
+ VG_(printf)("di_notify_vm_protect-0:\n");
+ VG_(printf)("di_notify_vm_protect-1: %#lx-%#lx %c%c%c\n",
+ a, a + len - 1,
+ r_ok ? 'r' : '-', w_ok ? 'w' : '-', x_ok ? 'x' : '-' );
+ }
+
Bool do_nothing = True;
# if defined(VGP_x86_darwin) && (DARWIN_VERS >= DARWIN_10_7)
do_nothing = False;
# endif
- if (do_nothing /* wrong platform */)
+ if (do_nothing /* wrong platform */) {
+ if (debug)
+ VG_(printf)("di_notify_vm_protect-2: wrong platform, "
+ "doing nothing.\n");
return;
+ }
- Bool r_ok = toBool(prot & VKI_PROT_READ);
- Bool w_ok = toBool(prot & VKI_PROT_WRITE);
- Bool x_ok = toBool(prot & VKI_PROT_EXEC);
if (! (r_ok && !w_ok && x_ok))
return; /* not an upgrade to r-x */
@@ -987,6 +1015,8 @@
observed as a r-- mapping, plus some other rw- mapping. If such
is found, conclude we're in an accept state and read debuginfo
accordingly. */
+ if (debug)
+ VG_(printf)("di_notify_vm_protect-3: looking for existing DebugInfo*\n");
DebugInfo* di;
struct _DebugInfoMapping *map = NULL;
Word i;
@@ -1015,6 +1045,10 @@
if (di == NULL)
return; /* didn't find anything */
+ if (debug)
+ VG_(printf)("di_notify_vm_protect-4: found existing DebugInfo* at %p\n",
+ di);
+
/* Do the upgrade. Simply update the flags of the mapping
and pretend we never saw the RO map at all. */
vg_assert(di->fsm.have_ro_map);
@@ -1033,6 +1067,9 @@
/* Check if we're now in an accept state and read debuginfo. Finally. */
if (di->fsm.have_rx_map && di->fsm.have_rw_map && !di->have_dinfo) {
+ if (debug)
+ VG_(printf)("di_notify_vm_protect-5: "
+ "achieved accept state for %s\n", di->fsm.filename);
ULong di_handle __attribute__((unused))
= di_notify_ACHIEVE_ACCEPT_STATE( di );
/* di_handle is ignored. That's not a problem per se -- it just
|
|
From: <sv...@va...> - 2014-07-08 07:44:19
|
Author: sewardj
Date: Tue Jul 8 07:44:07 2014
New Revision: 14137
Log:
Darwin only: don't tell aspacemgr about the kernel commpage -- only
tell the tool. This is because telling the aspacemgr about it causes
the sync checker to fail entirely on Darwin.
Modified:
trunk/coregrind/m_initimg/initimg-darwin.c
trunk/coregrind/m_main.c
Modified: trunk/coregrind/m_initimg/initimg-darwin.c
==============================================================================
--- trunk/coregrind/m_initimg/initimg-darwin.c (original)
+++ trunk/coregrind/m_initimg/initimg-darwin.c Tue Jul 8 07:44:07 2014
@@ -486,6 +486,15 @@
static void record_system_memory(void)
{
+ /* JRS 2014-Jul-08: this messes up the sync checker, because the
+ information that the kernel gives us doesn't include anything
+ about the commpage mapping. This functionality has therefore
+ been moved to m_main.c, valgrind_main(), section "Tell the tool
+ about the initial client memory permissions". See comments there
+ for rationale. */
+ return;
+ /*NOTREACHED*/
+
/* Tell aspacem where the client's kernel commpage is */
#if defined(VGA_amd64)
/* commpage 0x7fff:ffe00000+ - not in vm_region */
Modified: trunk/coregrind/m_main.c
==============================================================================
--- trunk/coregrind/m_main.c (original)
+++ trunk/coregrind/m_main.c Tue Jul 8 07:44:07 2014
@@ -2301,6 +2301,24 @@
/* Clear the running thread indicator */
VG_(running_tid) = VG_INVALID_THREADID;
tl_assert(VG_(running_tid) == VG_INVALID_THREADID);
+
+ /* Darwin only: tell the tools where the client's kernel commpage
+ is. It would be better to do this by telling aspacemgr about
+ it -- see the now disused record_system_memory() in
+ initimg-darwin.c -- but that causes the sync checker to fail,
+ since the mapping doesn't appear in the kernel-supplied
+ process map. So do it here instead. */
+# if defined(VGP_amd64_darwin)
+ VG_TRACK( new_mem_startup,
+ 0x7fffffe00000, 0x7ffffffff000-0x7fffffe00000,
+ True, False, True, /* r-x */
+ 0 /* di_handle: no associated debug info */ );
+# elif defined(VGP_x86_darwin)
+ VG_TRACK( new_mem_startup,
+ 0xfffec000, 0xfffff000-0xfffec000,
+ True, False, True, /* r-x */
+ 0 /* di_handle: no associated debug info */ );
+# endif
}
//--------------------------------------------------------------
|
|
From: <sv...@va...> - 2014-07-08 07:41:25
|
Author: sewardj
Date: Tue Jul 8 07:40:56 2014
New Revision: 14136
Log:
Add -Wno-tautological-compare to the standard compile flags, if that
is accepted. With XCode 5.5.1 -Wtautological-compare appears to come
as standard, and it generates a lot of mostly useless noise.
Modified:
trunk/Makefile.all.am
trunk/configure.ac
Modified: trunk/Makefile.all.am
==============================================================================
--- trunk/Makefile.all.am (original)
+++ trunk/Makefile.all.am Tue Jul 8 07:40:56 2014
@@ -105,6 +105,7 @@
-Wstrict-prototypes \
-Wmissing-declarations \
@FLAG_W_NO_FORMAT_ZERO_LENGTH@ \
+ @FLAG_W_NO_TAUTOLOGICAL_COMPARE@ \
-fno-strict-aliasing \
-fno-builtin
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Tue Jul 8 07:40:56 2014
@@ -1727,6 +1727,25 @@
CFLAGS=$safe_CFLAGS
+# does this compiler support -Wno-tautological-compare ?
+
+AC_MSG_CHECKING([if gcc accepts -Wno-tautological-compare])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="-Wno-tautological-compare"
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
+ return 0;
+]])], [
+AC_SUBST([FLAG_W_NO_TAUTOLOGICAL_COMPARE], [-Wno-tautological-compare])
+AC_MSG_RESULT([yes])
+], [
+AC_SUBST([FLAG_W_NO_TAUTOLOGICAL_COMPARE], [])
+AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+
+
# does this compiler support -Wno-nonnull ?
AC_MSG_CHECKING([if gcc accepts -Wno-nonnull])
|