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
(13) |
3
(12) |
4
(4) |
5
(5) |
|
6
(5) |
7
(16) |
8
(9) |
9
(14) |
10
(15) |
11
(7) |
12
(2) |
|
13
(7) |
14
(9) |
15
(8) |
16
(6) |
17
|
18
(2) |
19
(4) |
|
20
|
21
(7) |
22
(12) |
23
(6) |
24
(2) |
25
(3) |
26
(2) |
|
27
(2) |
28
(5) |
29
(7) |
30
(10) |
|
|
|
|
From: <sv...@va...> - 2010-06-07 20:45:26
|
Author: sewardj
Date: 2010-06-07 21:45:18 +0100 (Mon, 07 Jun 2010)
New Revision: 11162
Log:
Fix incorrect use of VG_STACK_REDZONE_SZB in this file. Since this
value is zero for this platform, the change has no effect, but
nevertheless the code is "logically" incorrect. This makes the
(notional) redzone handling consistent with that in
sigframe-amd64-darwin.c.
Modified:
branches/MACOSX106/coregrind/m_sigframe/sigframe-x86-darwin.c
Modified: branches/MACOSX106/coregrind/m_sigframe/sigframe-x86-darwin.c
===================================================================
--- branches/MACOSX106/coregrind/m_sigframe/sigframe-x86-darwin.c 2010-06-07 20:37:56 UTC (rev 11161)
+++ branches/MACOSX106/coregrind/m_sigframe/sigframe-x86-darwin.c 2010-06-07 20:45:18 UTC (rev 11162)
@@ -79,6 +79,8 @@
vki_sigset_t mask; // saved sigmask; restore when hdlr returns
UInt __pad[1];
UChar upper_guardzone[512]; // put nothing here
+ // and don't zero it, since that might overwrite the client's
+ // stack redzone, at least on archs which have one
};
@@ -96,7 +98,7 @@
amd64-linux version, this doesn't appear to handle the redzone
in the same way. */
VG_TRACK( new_mem_stack_signal,
- addr, size - VG_STACK_REDZONE_SZB, tid );
+ addr - VG_STACK_REDZONE_SZB, size, tid );
return True;
}
@@ -222,8 +224,8 @@
tid, tst->arch.vex.guest_EIP);
VG_TRACK( die_mem_stack_signal,
- (Addr)frame,
- sizeof(struct hacky_sigframe) - VG_STACK_REDZONE_SZB );
+ (Addr)frame - VG_STACK_REDZONE_SZB,
+ sizeof(struct hacky_sigframe) );
/* tell the tools */
VG_TRACK( post_deliver_signal, tid, sigNo );
|
|
From: <sv...@va...> - 2010-06-07 20:38:04
|
Author: sewardj
Date: 2010-06-07 21:37:56 +0100 (Mon, 07 Jun 2010)
New Revision: 11161
Log:
Oops, should have been committed as part of r11160. ("some renaming
for the darwin-specific replacements in m_trampoline.S").
Modified:
branches/MACOSX106/coregrind/m_redir.c
Modified: branches/MACOSX106/coregrind/m_redir.c
===================================================================
--- branches/MACOSX106/coregrind/m_redir.c 2010-06-07 20:35:57 UTC (rev 11160)
+++ branches/MACOSX106/coregrind/m_redir.c 2010-06-07 20:37:56 UTC (rev 11161)
@@ -1030,25 +1030,39 @@
# elif defined(VGP_ppc64_aix5)
/* nothing so far */
-# elif defined(VGO_darwin)
+# elif defined(VGP_x86_darwin)
/* If we're using memcheck, use these intercepts right from
the start, otherwise dyld makes a lot of noise. */
if (0==VG_(strcmp)("Memcheck", VG_(details).name)) {
add_hardwired_spec("dyld", "strcmp",
- (Addr)&VG_(darwin_REDIR_FOR_strcmp), NULL);
+ (Addr)&VG_(x86_darwin_REDIR_FOR_strcmp), NULL);
add_hardwired_spec("dyld", "strlen",
- (Addr)&VG_(darwin_REDIR_FOR_strlen), NULL);
+ (Addr)&VG_(x86_darwin_REDIR_FOR_strlen), NULL);
add_hardwired_spec("dyld", "strcat",
- (Addr)&VG_(darwin_REDIR_FOR_strcat), NULL);
+ (Addr)&VG_(x86_darwin_REDIR_FOR_strcat), NULL);
add_hardwired_spec("dyld", "strcpy",
- (Addr)&VG_(darwin_REDIR_FOR_strcpy), NULL);
+ (Addr)&VG_(x86_darwin_REDIR_FOR_strcpy), NULL);
add_hardwired_spec("dyld", "strlcat",
- (Addr)&VG_(darwin_REDIR_FOR_strlcat), NULL);
-# if defined(VGP_amd64_darwin)
+ (Addr)&VG_(x86_darwin_REDIR_FOR_strlcat), NULL);
+ }
+
+# elif defined(VGP_amd64_darwin)
+ /* If we're using memcheck, use these intercepts right from
+ the start, otherwise dyld makes a lot of noise. */
+ if (0==VG_(strcmp)("Memcheck", VG_(details).name)) {
+ add_hardwired_spec("dyld", "strcmp",
+ (Addr)&VG_(amd64_darwin_REDIR_FOR_strcmp), NULL);
+ add_hardwired_spec("dyld", "strlen",
+ (Addr)&VG_(amd64_darwin_REDIR_FOR_strlen), NULL);
+ add_hardwired_spec("dyld", "strcat",
+ (Addr)&VG_(amd64_darwin_REDIR_FOR_strcat), NULL);
+ add_hardwired_spec("dyld", "strcpy",
+ (Addr)&VG_(amd64_darwin_REDIR_FOR_strcpy), NULL);
+ add_hardwired_spec("dyld", "strlcat",
+ (Addr)&VG_(amd64_darwin_REDIR_FOR_strlcat), NULL);
// DDD: #warning fixme rdar://6166275
add_hardwired_spec("dyld", "arc4random",
- (Addr)&VG_(darwin_REDIR_FOR_arc4random), NULL);
-# endif
+ (Addr)&VG_(amd64_darwin_REDIR_FOR_arc4random), NULL);
}
# else
|
|
From: <sv...@va...> - 2010-06-07 20:36:05
|
Author: sewardj
Date: 2010-06-07 21:35:57 +0100 (Mon, 07 Jun 2010)
New Revision: 11160
Log:
amd64-darwin: add VG_(amd64_darwin_SUBST_FOR_sigreturn), without
which the signal delivery stuff in r11159 can't be compiled.
Also, some renaming for the darwin-specific replacements in
m_trampoline.S.
Modified:
branches/MACOSX106/coregrind/m_trampoline.S
branches/MACOSX106/coregrind/pub_core_trampoline.h
Modified: branches/MACOSX106/coregrind/m_trampoline.S
===================================================================
--- branches/MACOSX106/coregrind/m_trampoline.S 2010-06-07 20:31:07 UTC (rev 11159)
+++ branches/MACOSX106/coregrind/m_trampoline.S 2010-06-07 20:35:57 UTC (rev 11160)
@@ -924,8 +924,8 @@
int $0x80
ud2
-.globl VG_(darwin_REDIR_FOR_strlen)
-VG_(darwin_REDIR_FOR_strlen):
+.globl VG_(x86_darwin_REDIR_FOR_strlen)
+VG_(x86_darwin_REDIR_FOR_strlen):
movl 4(%esp), %edx
movl %edx, %eax
jmp 1f
@@ -937,8 +937,8 @@
subl %edx, %eax
ret
-.globl VG_(darwin_REDIR_FOR_strcat)
-VG_(darwin_REDIR_FOR_strcat):
+.globl VG_(x86_darwin_REDIR_FOR_strcat)
+VG_(x86_darwin_REDIR_FOR_strcat):
pushl %esi
movl 8(%esp), %esi
movl 12(%esp), %ecx
@@ -961,8 +961,8 @@
ret
-.globl VG_(darwin_REDIR_FOR_strcmp)
-VG_(darwin_REDIR_FOR_strcmp):
+.globl VG_(x86_darwin_REDIR_FOR_strcmp)
+VG_(x86_darwin_REDIR_FOR_strcmp):
movl 4(%esp), %edx
movl 8(%esp), %ecx
jmp 1f
@@ -982,8 +982,8 @@
ret
-.globl VG_(darwin_REDIR_FOR_strcpy)
-VG_(darwin_REDIR_FOR_strcpy):
+.globl VG_(x86_darwin_REDIR_FOR_strcpy)
+VG_(x86_darwin_REDIR_FOR_strcpy):
pushl %ebp
movl %esp, %ebp
pushl %esi
@@ -1004,8 +1004,8 @@
leave
ret
-.globl VG_(darwin_REDIR_FOR_strlcat)
-VG_(darwin_REDIR_FOR_strlcat):
+.globl VG_(x86_darwin_REDIR_FOR_strlcat)
+VG_(x86_darwin_REDIR_FOR_strlcat):
pushl %ebp
movl %esp, %ebp
pushl %edi
@@ -1034,7 +1034,7 @@
3:
movl 12(%ebp), %eax
movl %eax, (%esp)
- call VG_(darwin_REDIR_FOR_strlen)
+ call VG_(x86_darwin_REDIR_FOR_strlen)
jmp 7f
4:
cmpl $1, %esi
@@ -1076,8 +1076,16 @@
.globl VG_(trampoline_stuff_start)
VG_(trampoline_stuff_start):
-.globl VG_(darwin_REDIR_FOR_strlen)
-VG_(darwin_REDIR_FOR_strlen):
+.globl VG_(amd64_darwin_SUBST_FOR_sigreturn)
+VG_(amd64_darwin_SUBST_FOR_sigreturn):
+ /* XXX does this need to have any special form? (cf x86-linux
+ version) */
+ movq $ __NR_DARWIN_FAKE_SIGRETURN, %rax
+ syscall
+ ud2
+
+.globl VG_(amd64_darwin_REDIR_FOR_strlen)
+VG_(amd64_darwin_REDIR_FOR_strlen):
movq %rdi, %rax
jmp 1f
0:
@@ -1088,8 +1096,8 @@
subq %rdi, %rax
ret
-.globl VG_(darwin_REDIR_FOR_strcat)
-VG_(darwin_REDIR_FOR_strcat):
+.globl VG_(amd64_darwin_REDIR_FOR_strcat)
+VG_(amd64_darwin_REDIR_FOR_strcat):
movq %rdi, %rdx
jmp 1f
0:
@@ -1108,8 +1116,8 @@
ret
-.globl VG_(darwin_REDIR_FOR_strcmp)
-VG_(darwin_REDIR_FOR_strcmp):
+.globl VG_(amd64_darwin_REDIR_FOR_strcmp)
+VG_(amd64_darwin_REDIR_FOR_strcmp):
jmp 1f
0:
incq %rdi
@@ -1126,8 +1134,8 @@
subl %edx, %eax
ret
-.globl VG_(darwin_REDIR_FOR_strcpy)
-VG_(darwin_REDIR_FOR_strcpy):
+.globl VG_(amd64_darwin_REDIR_FOR_strcpy)
+VG_(amd64_darwin_REDIR_FOR_strcpy):
pushq %rbp
movq %rdi, %rdx
movq %rsp, %rbp
@@ -1144,8 +1152,8 @@
movq %rdi, %rax
ret
-.globl VG_(darwin_REDIR_FOR_strlcat)
-VG_(darwin_REDIR_FOR_strlcat):
+.globl VG_(amd64_darwin_REDIR_FOR_strlcat)
+VG_(amd64_darwin_REDIR_FOR_strlcat):
pushq %rbp
leaq (%rdx,%rdi), %rax
movq %rdi, %rcx
@@ -1170,7 +1178,7 @@
jmp 6f
3:
movq %rsi, %rdi
- call VG_(darwin_REDIR_FOR_strlen)
+ call VG_(amd64_darwin_REDIR_FOR_strlen)
jmp 7f
4:
cmpq $1, %rdi
@@ -1193,8 +1201,8 @@
leave
ret
-.globl VG_(darwin_REDIR_FOR_arc4random)
-VG_(darwin_REDIR_FOR_arc4random):
+.globl VG_(amd64_darwin_REDIR_FOR_arc4random)
+VG_(amd64_darwin_REDIR_FOR_arc4random):
/* not very random, hope dyld won't mind */
movq $0x76616c6772696e64, %rax
ret
Modified: branches/MACOSX106/coregrind/pub_core_trampoline.h
===================================================================
--- branches/MACOSX106/coregrind/pub_core_trampoline.h 2010-06-07 20:31:07 UTC (rev 11159)
+++ branches/MACOSX106/coregrind/pub_core_trampoline.h 2010-06-07 20:35:57 UTC (rev 11160)
@@ -119,16 +119,27 @@
extern void VG_(ppc64_aix5_do_preloads_then_start_client);
#endif
-#if defined(VGO_darwin)
+#if defined(VGP_x86_darwin)
extern void VG_(x86_darwin_SUBST_FOR_sigreturn);
-extern SizeT VG_(darwin_REDIR_FOR_strlen)( void* );
-extern SizeT VG_(darwin_REDIR_FOR_strcmp)( void*, void* );
-extern void* VG_(darwin_REDIR_FOR_strcat)( void*, void * );
-extern char* VG_(darwin_REDIR_FOR_strcpy)( char *s1, char *s2 );
-extern SizeT VG_(darwin_REDIR_FOR_strlcat)( char *s1, const char *s2, SizeT size );
-extern UInt VG_(darwin_REDIR_FOR_arc4random)( void );
+extern SizeT VG_(x86_darwin_REDIR_FOR_strlen)( void* );
+extern SizeT VG_(x86_darwin_REDIR_FOR_strcmp)( void*, void* );
+extern void* VG_(x86_darwin_REDIR_FOR_strcat)( void*, void * );
+extern char* VG_(x86_darwin_REDIR_FOR_strcpy)( char *s1, char *s2 );
+extern SizeT VG_(x86_darwin_REDIR_FOR_strlcat)( char *s1, const char *s2,
+ SizeT size );
#endif
+#if defined(VGP_amd64_darwin)
+extern void VG_(amd64_darwin_SUBST_FOR_sigreturn);
+extern SizeT VG_(amd64_darwin_REDIR_FOR_strlen)( void* );
+extern SizeT VG_(amd64_darwin_REDIR_FOR_strcmp)( void*, void* );
+extern void* VG_(amd64_darwin_REDIR_FOR_strcat)( void*, void * );
+extern char* VG_(amd64_darwin_REDIR_FOR_strcpy)( char *s1, char *s2 );
+extern SizeT VG_(amd64_darwin_REDIR_FOR_strlcat)( char *s1, const char *s2,
+ SizeT size );
+extern UInt VG_(amd64_darwin_REDIR_FOR_arc4random)( void );
+#endif
+
#endif // __PUB_CORE_TRAMPOLINE_H
/*--------------------------------------------------------------------*/
|
|
From: <sv...@va...> - 2010-06-07 20:31:15
|
Author: sewardj
Date: 2010-06-07 21:31:07 +0100 (Mon, 07 Jun 2010)
New Revision: 11159
Log:
Add a (kludgey) sigframe builder/remover for amd64-darwin, so that
signals can be delivered to the client in 64-bit processes.
Modified:
branches/MACOSX106/coregrind/m_sigframe/sigframe-amd64-darwin.c
Modified: branches/MACOSX106/coregrind/m_sigframe/sigframe-amd64-darwin.c
===================================================================
--- branches/MACOSX106/coregrind/m_sigframe/sigframe-amd64-darwin.c 2010-06-07 14:15:08 UTC (rev 11158)
+++ branches/MACOSX106/coregrind/m_sigframe/sigframe-amd64-darwin.c 2010-06-07 20:31:07 UTC (rev 11159)
@@ -47,6 +47,64 @@
#include "pub_core_sigframe.h" /* self */
+/* Cheap-ass hack copied from ppc32-aix5 code, just to get started.
+ Produce a frame with layout entirely of our own choosing. */
+
+/* This module creates and removes signal frames for signal deliveries
+ on amd64-darwin. Kludgey; the machine state ought to be saved in a
+ ucontext and retrieved from it later, so the handler can modify it
+ and return. However .. for now .. just stick the vex guest state
+ in the frame and snarf it again later.
+
+ Also, don't bother with creating siginfo and ucontext in the
+ handler, although do point them somewhere non-faulting.
+
+ Frame should have a 16-aligned size, just in case that turns out to
+ be important for Darwin. (be conservative)
+*/
+struct hacky_sigframe {
+ /* first word looks like a call to a 3-arg amd64-ELF function */
+ ULong returnAddr;
+ UChar lower_guardzone[512]; // put nothing here
+ VexGuestAMD64State gst;
+ VexGuestAMD64State gshadow1;
+ VexGuestAMD64State gshadow2;
+ vki_siginfo_t fake_siginfo;
+ struct vki_ucontext fake_ucontext;
+ UInt magicPI;
+ UInt sigNo_private;
+ vki_sigset_t mask; // saved sigmask; restore when hdlr returns
+ UInt __pad[2];
+ UChar upper_guardzone[512]; // put nothing here
+ // and don't zero it, since that might overwrite the client's
+ // stack redzone, at least on archs which have one
+};
+
+
+/* Extend the stack segment downwards if needed so as to ensure the
+ new signal frames are mapped to something. Return a Bool
+ indicating whether or not the operation was successful.
+*/
+static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
+{
+ ThreadId tid = tst->tid;
+ /* For tracking memory events, indicate the entire frame has been
+ allocated. Except, don't mess with the area which
+ overlaps the previous frame's redzone. */
+ /* XXX is the following call really right? compared with the
+ amd64-linux version, this doesn't appear to handle the redzone
+ in the same way. */
+ VG_TRACK( new_mem_stack_signal,
+ addr - VG_STACK_REDZONE_SZB, size, tid );
+ return True;
+}
+
+
+/* Create a signal frame for thread 'tid'. Make a 3-arg frame
+ regardless of whether the client originally requested a 1-arg
+ version (no SA_SIGINFO) or a 3-arg one (SA_SIGINFO) since in the
+ former case, the amd64 calling conventions will simply cause the
+ extra 2 args to be ignored (inside the handler). (We hope!) */
void VG_(sigframe_create) ( ThreadId tid,
Addr sp_top_of_frame,
const vki_siginfo_t *siginfo,
@@ -56,13 +114,121 @@
const vki_sigset_t *mask,
void *restorer )
{
- I_die_here;
+ ThreadState* tst;
+ Addr rsp;
+ struct hacky_sigframe* frame;
+ Int sigNo = siginfo->si_signo;
+
+ vg_assert(VG_IS_16_ALIGNED(sizeof(struct hacky_sigframe)));
+
+ sp_top_of_frame &= ~0xfUL;
+ rsp = sp_top_of_frame - sizeof(struct hacky_sigframe);
+
+ tst = VG_(get_ThreadState)(tid);
+ if (!extend(tst, rsp, sp_top_of_frame - rsp))
+ return;
+
+ vg_assert(VG_IS_16_ALIGNED(rsp));
+
+ frame = (struct hacky_sigframe *) rsp;
+
+ /* clear it (very conservatively) (why so conservatively??) */
+ VG_(memset)(&frame->lower_guardzone, 0, 512);
+ VG_(memset)(&frame->gst, 0, sizeof(VexGuestAMD64State));
+ VG_(memset)(&frame->gshadow1, 0, sizeof(VexGuestAMD64State));
+ VG_(memset)(&frame->gshadow2, 0, sizeof(VexGuestAMD64State));
+ VG_(memset)(&frame->fake_siginfo, 0, sizeof(frame->fake_siginfo));
+ VG_(memset)(&frame->fake_ucontext, 0, sizeof(frame->fake_ucontext));
+
+ /* save stuff in frame */
+ frame->gst = tst->arch.vex;
+ frame->gshadow1 = tst->arch.vex_shadow1;
+ frame->gshadow2 = tst->arch.vex_shadow2;
+ frame->sigNo_private = sigNo;
+ frame->mask = tst->sig_mask;
+ frame->magicPI = 0x31415927;
+
+ /* Minimally fill in the siginfo and ucontext. Note, utter
+ lameness prevails. Be underwhelmed, be very underwhelmed. */
+ frame->fake_siginfo.si_signo = sigNo;
+ frame->fake_siginfo.si_code = siginfo->si_code;
+
+ /* Set up stack pointer */
+ vg_assert(rsp == (Addr)&frame->returnAddr);
+ VG_(set_SP)(tid, rsp);
+ VG_TRACK( post_reg_write, Vg_CoreSignal, tid, VG_O_STACK_PTR, sizeof(ULong));
+
+ /* Set up program counter */
+ VG_(set_IP)(tid, (ULong)handler);
+ VG_TRACK( post_reg_write, Vg_CoreSignal, tid, VG_O_INSTR_PTR, sizeof(ULong));
+
+ /* Set up RA and args for the frame */
+ VG_TRACK( pre_mem_write, Vg_CoreSignal, tid, "signal handler frame",
+ (Addr)frame, 1*sizeof(ULong) );
+ frame->returnAddr = (ULong)&VG_(amd64_darwin_SUBST_FOR_sigreturn);
+
+ /* XXX should tell the tool that these regs got written */
+ tst->arch.vex.guest_RDI = (ULong) sigNo;
+ tst->arch.vex.guest_RSI = (Addr) &frame->fake_siginfo;/* oh well */
+ tst->arch.vex.guest_RDX = (Addr) &frame->fake_ucontext; /* oh well */
+
+ VG_TRACK( post_mem_write, Vg_CoreSignal, tid,
+ (Addr)frame, 1*sizeof(ULong) );
+ VG_TRACK( post_mem_write, Vg_CoreSignal, tid,
+ (Addr)&frame->fake_siginfo, sizeof(frame->fake_siginfo));
+ VG_TRACK( post_mem_write, Vg_CoreSignal, tid,
+ (Addr)&frame->fake_ucontext, sizeof(frame->fake_ucontext));
+
+ if (VG_(clo_trace_signals))
+ VG_(message)(Vg_DebugMsg,
+ "sigframe_create (thread %d): next EIP=%#lx, next ESP=%#lx",
+ tid, (Addr)handler, (Addr)frame );
}
+/* Remove a signal frame from thread 'tid's stack, and restore the CPU
+ state from it. Note, isRT is irrelevant here. */
void VG_(sigframe_destroy)( ThreadId tid, Bool isRT )
{
- I_die_here;
+ ThreadState *tst;
+ Addr rsp;
+ Int sigNo;
+ struct hacky_sigframe* frame;
+
+ vg_assert(VG_(is_valid_tid)(tid));
+ tst = VG_(get_ThreadState)(tid);
+
+ /* Check that the stack frame looks valid */
+ rsp = VG_(get_SP)(tid);
+
+ /* why -8 ? because the signal handler's return will have popped
+ the return address of the stack; and the return address is the
+ lowest-addressed element of hacky_sigframe. */
+ frame = (struct hacky_sigframe*)(rsp - 8);
+ vg_assert(frame->magicPI == 0x31415927);
+ vg_assert(VG_IS_16_ALIGNED(frame));
+
+ /* restore the entire guest state, and shadows, from the
+ frame. Note, as per comments above, this is a kludge - should
+ restore it from saved ucontext. Oh well. */
+ tst->arch.vex = frame->gst;
+ tst->arch.vex_shadow1 = frame->gshadow1;
+ tst->arch.vex_shadow2 = frame->gshadow2;
+ tst->sig_mask = frame->mask;
+ tst->tmp_sig_mask = frame->mask;
+ sigNo = frame->sigNo_private;
+
+ if (VG_(clo_trace_signals))
+ VG_(message)(Vg_DebugMsg,
+ "sigframe_destroy (thread %d): valid magic; next RIP=%#llx",
+ tid, tst->arch.vex.guest_RIP);
+
+ VG_TRACK( die_mem_stack_signal,
+ (Addr)frame - VG_STACK_REDZONE_SZB,
+ sizeof(struct hacky_sigframe) );
+
+ /* tell the tools */
+ VG_TRACK( post_deliver_signal, tid, sigNo );
}
#endif // defined(VGP_amd64_darwin)
|
|
From: <gup...@ne...> - 2010-06-07 17:29:13
|
Josef, Thank you very much for your response. I saw that the function new_dumpfile(..) generates a file descriptor that is used by the function my_write(..) to write to the current output file. If I were to replace the line fd = (Int) sr_Res(res); with fd = VG_(connect_via_socket)(log_fsname_unexpanded) then would all subequent writes be to the network socket instead? Thanks in anticipation. SVG ---------- Original Message ---------- From: Josef Weidendorfer <Jos...@gm...> To: val...@li... Cc: "gup...@ne..." <gup...@ne...> Subject: Re: [Valgrind-developers] Need to change where Valgrind writes logs for callgrind Date: Mon, 7 Jun 2010 18:34:47 +0200 On Monday 07 June 2010, gup...@ne... wrote: > I am using callgrind on hardware with very small disk space. I'd like to know where should I begin making changes so that the callgrind logs (basic blocks, function before, function after) are written to a network socket instead of a log-file. Could someone be of help? I suppose you would need to replace the VG_(open) calls in callgrind/dump.c into something opening a socket. For that, you can check how the --log-socket option is implemented. Josef > > SVG > > ____________________________________________________________ > Project Management > 100% Online. Project Management certificate from Villanova. Free info. > http://thirdpartyoffers.netzero.net/TGL3241/4c0cff6029c7223d6eest04vuc > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers > ____________________________________________________________ Get Free Email with Video Mail & Video Chat! http://www.netzero.net/freeemail?refcd=NZTAGOUT1FREM0210 |
|
From: <sv...@va...> - 2010-06-07 16:30:42
|
Author: sewardj Date: 2010-06-07 17:22:22 +0100 (Mon, 07 Jun 2010) New Revision: 1982 Log: Implement SIDT and SGDT as pass-throughs to the host. It's a pretty bad thing to do, but I can't think of a way to virtualise these properly. Patch from Alexander Potapenko. See https://bugs.kde.org/show_bug.cgi?id=205241#c38 Modified: trunk/priv/guest_amd64_defs.h trunk/priv/guest_amd64_helpers.c trunk/priv/guest_amd64_toIR.c trunk/priv/guest_x86_defs.h trunk/priv/guest_x86_helpers.c trunk/priv/guest_x86_toIR.c Modified: trunk/priv/guest_amd64_defs.h =================================================================== --- trunk/priv/guest_amd64_defs.h 2010-05-10 20:51:22 UTC (rev 1981) +++ trunk/priv/guest_amd64_defs.h 2010-06-07 16:22:22 UTC (rev 1982) @@ -153,6 +153,9 @@ extern void amd64g_dirtyhelper_OUT ( ULong portno, ULong data, ULong sz/*1,2 or 4*/ ); +extern void amd64g_dirtyhelper_SxDT ( void* address, + ULong op /* 0 or 1 */ ); + //extern void amd64g_dirtyhelper_CPUID_sse0 ( VexGuestAMD64State* ); //extern void amd64g_dirtyhelper_CPUID_sse1 ( VexGuestAMD64State* ); //extern void amd64g_dirtyhelper_CPUID_sse2 ( VexGuestAMD64State* ); Modified: trunk/priv/guest_amd64_helpers.c =================================================================== --- trunk/priv/guest_amd64_helpers.c 2010-05-10 20:51:22 UTC (rev 1981) +++ trunk/priv/guest_amd64_helpers.c 2010-06-07 16:22:22 UTC (rev 1982) @@ -2218,6 +2218,31 @@ # endif } +/* CALLED FROM GENERATED CODE */ +/* DIRTY HELPER (non-referentially-transparent) */ +/* Horrible hack. On non-amd64 platforms, do nothing. */ +/* op = 0: call the native SGDT instruction. + op = 1: call the native SIDT instruction. +*/ +void amd64g_dirtyhelper_SxDT ( void *address, ULong op ) { +# if defined(__x86_64__) + switch (op) { + case 0: + __asm__ __volatile__("sgdt (%0)" : : "r" (address) : "memory"); + break; + case 1: + __asm__ __volatile__("sidt (%0)" : : "r" (address) : "memory"); + break; + default: + vpanic("amd64g_dirtyhelper_SxDT"); + } +# else + /* do nothing */ + UChar* p = (UChar*)address; + p[0] = p[1] = p[2] = p[3] = p[4] = p[5] = 0; + p[6] = p[7] = p[8] = p[9] = 0; +# endif +} /*---------------------------------------------------------------*/ /*--- Helpers for MMX/SSE/SSE2. ---*/ Modified: trunk/priv/guest_amd64_toIR.c =================================================================== --- trunk/priv/guest_amd64_toIR.c 2010-05-10 20:51:22 UTC (rev 1981) +++ trunk/priv/guest_amd64_toIR.c 2010-06-07 16:22:22 UTC (rev 1982) @@ -17260,6 +17260,41 @@ DIP("{f}emms\n"); break; + /* =-=-=-=-=-=-=-=-=- SGDT and SIDT =-=-=-=-=-=-=-=-=-=-= */ + case 0x01: /* 0F 01 /0 -- SGDT */ + /* 0F 01 /1 -- SIDT */ + { + /* This is really revolting, but ... since each processor + (core) only has one IDT and one GDT, just let the guest + see it (pass-through semantics). I can't see any way to + construct a faked-up value, so don't bother to try. */ + modrm = getUChar(delta); + addr = disAMode ( &alen, vbi, pfx, delta, dis_buf, 0 ); + delta += alen; + if (epartIsReg(modrm)) goto decode_failure; + if (gregLO3ofRM(modrm) != 0 && gregLO3ofRM(modrm) != 1) + goto decode_failure; + switch (gregLO3ofRM(modrm)) { + case 0: DIP("sgdt %s\n", dis_buf); break; + case 1: DIP("sidt %s\n", dis_buf); break; + default: vassert(0); /*NOTREACHED*/ + } + + IRDirty* d = unsafeIRDirty_0_N ( + 0/*regparms*/, + "amd64g_dirtyhelper_SxDT", + &amd64g_dirtyhelper_SxDT, + mkIRExprVec_2( mkexpr(addr), + mkU64(gregLO3ofRM(modrm)) ) + ); + /* declare we're writing memory */ + d->mFx = Ifx_Write; + d->mAddr = mkexpr(addr); + d->mSize = 6; + stmt( IRStmt_Dirty(d) ); + break; + } + /* =-=-=-=-=-=-=-=-=- unimp2 =-=-=-=-=-=-=-=-=-=-= */ default: Modified: trunk/priv/guest_x86_defs.h =================================================================== --- trunk/priv/guest_x86_defs.h 2010-05-10 20:51:22 UTC (rev 1981) +++ trunk/priv/guest_x86_defs.h 2010-06-07 16:22:22 UTC (rev 1982) @@ -153,6 +153,9 @@ extern void x86g_dirtyhelper_OUT ( UInt portno, UInt data, UInt sz/*1,2 or 4*/ ); +extern void x86g_dirtyhelper_SxDT ( void* address, + UInt op /* 0 or 1 */ ); + extern VexEmWarn x86g_dirtyhelper_FXRSTOR ( VexGuestX86State*, HWord ); Modified: trunk/priv/guest_x86_helpers.c =================================================================== --- trunk/priv/guest_x86_helpers.c 2010-05-10 20:51:22 UTC (rev 1981) +++ trunk/priv/guest_x86_helpers.c 2010-06-07 16:22:22 UTC (rev 1982) @@ -2353,6 +2353,30 @@ # endif } +/* CALLED FROM GENERATED CODE */ +/* DIRTY HELPER (non-referentially-transparent) */ +/* Horrible hack. On non-x86 platforms, do nothing. */ +/* op = 0: call the native SGDT instruction. + op = 1: call the native SIDT instruction. +*/ +void x86g_dirtyhelper_SxDT ( void *address, UInt op ) { +# if defined(__i386__) + switch (op) { + case 0: + __asm__ __volatile__("sgdt (%0)" : : "r" (address) : "memory"); + break; + case 1: + __asm__ __volatile__("sidt (%0)" : : "r" (address) : "memory"); + break; + default: + vpanic("x86g_dirtyhelper_SxDT"); + } +# else + /* do nothing */ + UChar* p = (UChar*)address; + p[0] = p[1] = p[2] = p[3] = p[4] = p[5] = 0; +# endif +} /*---------------------------------------------------------------*/ /*--- Helpers for MMX/SSE/SSE2. ---*/ Modified: trunk/priv/guest_x86_toIR.c =================================================================== --- trunk/priv/guest_x86_toIR.c 2010-05-10 20:51:22 UTC (rev 1981) +++ trunk/priv/guest_x86_toIR.c 2010-06-07 16:22:22 UTC (rev 1982) @@ -14790,6 +14790,41 @@ DIP("emms\n"); break; + /* =-=-=-=-=-=-=-=-=- SGDT and SIDT =-=-=-=-=-=-=-=-=-=-= */ + case 0x01: /* 0F 01 /0 -- SGDT */ + /* 0F 01 /1 -- SIDT */ + { + /* This is really revolting, but ... since each processor + (core) only has one IDT and one GDT, just let the guest + see it (pass-through semantics). I can't see any way to + construct a faked-up value, so don't bother to try. */ + modrm = getUChar(delta); + addr = disAMode ( &alen, sorb, delta, dis_buf ); + delta += alen; + if (epartIsReg(modrm)) goto decode_failure; + if (gregOfRM(modrm) != 0 && gregOfRM(modrm) != 1) + goto decode_failure; + switch (gregOfRM(modrm)) { + case 0: DIP("sgdt %s\n", dis_buf); break; + case 1: DIP("sidt %s\n", dis_buf); break; + default: vassert(0); /*NOTREACHED*/ + } + + IRDirty* d = unsafeIRDirty_0_N ( + 0/*regparms*/, + "x86g_dirtyhelper_SxDT", + &x86g_dirtyhelper_SxDT, + mkIRExprVec_2( mkexpr(addr), + mkU32(gregOfRM(modrm)) ) + ); + /* declare we're writing memory */ + d->mFx = Ifx_Write; + d->mAddr = mkexpr(addr); + d->mSize = 6; + stmt( IRStmt_Dirty(d) ); + break; + } + /* =-=-=-=-=-=-=-=-=- unimp2 =-=-=-=-=-=-=-=-=-=-= */ default: |
|
From: <sv...@va...> - 2010-06-07 15:51:27
|
Author: sewardj Date: 2010-06-07 13:35:24 +0100 (Mon, 07 Jun 2010) New Revision: 11156 Log: Syscall wrapper and VKI changes for MacOSX 10.6. (Part of a patch to add support for MacOSX 10.6, by Greg Parker, updated by Alexander Potapenko. See https://bugs.kde.org/show_bug.cgi?id=205241#c27) Modified: branches/MACOSX106/coregrind/m_syswrap/priv_syswrap-darwin.h branches/MACOSX106/coregrind/m_syswrap/syswrap-amd64-darwin.c branches/MACOSX106/coregrind/m_syswrap/syswrap-darwin.c branches/MACOSX106/include/vki/vki-darwin.h branches/MACOSX106/include/vki/vki-scnums-darwin.h Modified: branches/MACOSX106/coregrind/m_syswrap/priv_syswrap-darwin.h =================================================================== --- branches/MACOSX106/coregrind/m_syswrap/priv_syswrap-darwin.h 2010-06-07 12:32:10 UTC (rev 11155) +++ branches/MACOSX106/coregrind/m_syswrap/priv_syswrap-darwin.h 2010-06-07 12:35:24 UTC (rev 11156) @@ -429,7 +429,7 @@ // 369 // 370 // 371 -// 372 +DECL_TEMPLATE(darwin, __thread_selfid); // 372 // 373 // 374 // 375 @@ -484,6 +484,9 @@ // NYI __mac_mount 424 // NYI __mac_get_mount 425 // NYI __mac_getfsstat 426 +DECL_TEMPLATE(darwin, fsgetpath); // 427 +// NYI audit_session_self 428 +// NYI audit_session_join 429 // Mach message helpers DECL_TEMPLATE(darwin, host_info); @@ -498,9 +501,11 @@ DECL_TEMPLATE(darwin, mach_port_get_refs); DECL_TEMPLATE(darwin, mach_port_mod_refs); DECL_TEMPLATE(darwin, mach_port_get_set_status); +DECL_TEMPLATE(darwin, mach_port_move_member); DECL_TEMPLATE(darwin, mach_port_destroy); DECL_TEMPLATE(darwin, mach_port_request_notification); DECL_TEMPLATE(darwin, mach_port_insert_right); +DECL_TEMPLATE(darwin, mach_port_extract_right); DECL_TEMPLATE(darwin, mach_port_get_attributes); DECL_TEMPLATE(darwin, mach_port_set_attributes); DECL_TEMPLATE(darwin, mach_port_insert_member); @@ -537,6 +542,7 @@ DECL_TEMPLATE(darwin, thread_suspend); DECL_TEMPLATE(darwin, thread_get_state); DECL_TEMPLATE(darwin, thread_policy); +DECL_TEMPLATE(darwin, thread_policy_set); DECL_TEMPLATE(darwin, thread_info); DECL_TEMPLATE(darwin, bootstrap_register); DECL_TEMPLATE(darwin, bootstrap_look_up); Modified: branches/MACOSX106/coregrind/m_syswrap/syswrap-amd64-darwin.c =================================================================== --- branches/MACOSX106/coregrind/m_syswrap/syswrap-amd64-darwin.c 2010-06-07 12:32:10 UTC (rev 11155) +++ branches/MACOSX106/coregrind/m_syswrap/syswrap-amd64-darwin.c 2010-06-07 12:35:24 UTC (rev 11156) @@ -378,7 +378,23 @@ VexGuestAMD64State *vex; Addr stack; SizeT stacksize; + vki_sigset_t blockall; + /* When we enter here we hold no lock (!), so we better acquire it + pronto. Why do we hold no lock? Because (presumably) the only + way to get here is as a result of a SfMayBlock syscall + "workq_ops(WQOPS_THREAD_RETURN)", which will have dropped the + lock. At least that's clear for the 'reuse' case. The + non-reuse case? Dunno, perhaps it's a new thread the kernel + pulled out of a hat. In any case we still need to take a + lock. */ + VG_(acquire_BigLock_LL)("wqthread_hijack"); + + /* Start the thread with all signals blocked. VG_(scheduler) will + set the mask correctly when we finally get there. */ + VG_(sigfillset)(&blockall); + VG_(sigprocmask)(VKI_SIG_SETMASK, &blockall, NULL); + if (reuse) { // This thread already exists; we're merely re-entering // after leaving via workq_ops(WQOPS_THREAD_RETURN). @@ -418,6 +434,15 @@ if (reuse) { // Continue V's thread back in the scheduler. // The client thread is of course in another location entirely. + + /* Drop the lock before going into + ML_(wqthread_continue_NORETURN). The latter will immediately + attempt to reacquire it in non-LL mode, which is a bit + wasteful but I don't think is harmful. A better solution + would be to not drop the lock but instead "upgrade" it from a + LL lock to a full lock, but that's too much like hard work + right now. */ + VG_(release_BigLock_LL)("wqthread_hijack(1)"); ML_(wqthread_continue_NORETURN)(tst->tid); } else { @@ -450,6 +475,16 @@ VG_(am_do_sync_check)("after", "wqthread_hijack", 0); // Go! + /* Same comments as the 'release' in the then-clause. + start_thread_NORETURN calls run_thread_NORETURN calls + thread_wrapper which acquires the lock before continuing. + Let's hope nothing non-thread-local happens until that point. + + DDD: I think this is plain wrong .. if we get to + thread_wrapper not holding the lock, and someone has recycled + this thread slot in the meantime, we're hosed. Is that + possible, though? */ + VG_(release_BigLock_LL)("wqthread_hijack(2)"); call_on_new_stack_0_1(tst->os_state.valgrind_stack_init_SP, 0, start_thread_NORETURN, (Word)tst); } Modified: branches/MACOSX106/coregrind/m_syswrap/syswrap-darwin.c =================================================================== --- branches/MACOSX106/coregrind/m_syswrap/syswrap-darwin.c 2010-06-07 12:32:10 UTC (rev 11155) +++ branches/MACOSX106/coregrind/m_syswrap/syswrap-darwin.c 2010-06-07 12:35:24 UTC (rev 11156) @@ -66,7 +66,6 @@ #include <mach/mach.h> #include <mach/mach_vm.h> #include <semaphore.h> -#include <sys/acl.h> /* struct kauth_filesec */ /* --- !!! --- EXTERNAL HEADERS end --- !!! --- */ #define msgh_request_port msgh_remote_port @@ -1240,7 +1239,9 @@ { PRINT("futimes ( %ld, %#lx )", ARG1,ARG2); PRE_REG_READ2(long, "futimes", int, fd, struct timeval *, tvp); - if (ARG2 != 0) { + if (!ML_(fd_allowed)(ARG1, "futimes", tid, False)) { + SET_STATUS_Failure( VKI_EBADF ); + } else if (ARG2 != 0) { PRE_timeval_READ( "futimes(tvp[0])", ARG2 ); PRE_timeval_READ( "futimes(tvp[1])", ARG2+sizeof(struct vki_timeval) ); } @@ -1635,10 +1636,12 @@ { PRINT("kdebug_trace(%ld, %ld, %ld, %ld, %ld, %ld)", ARG1, ARG2, ARG3, ARG4, ARG5, ARG6); + /* + Don't check anything - some clients pass fewer arguments. PRE_REG_READ6(long, "kdebug_trace", int,"code", int,"arg1", int,"arg2", int,"arg3", int,"arg4", int,"arg5"); - // GrP fixme anything else? + */ } @@ -2018,7 +2021,7 @@ is just way wrong. [The trouble is with the size, which depends on a non-trival kernel computation] */ PRE_MEM_READ( "fchmod_extended(xsecurity)", ARG5, - sizeof(struct kauth_filesec) ); + sizeof(struct vki_kauth_filesec) ); } PRE(chmod_extended) @@ -2038,7 +2041,7 @@ is just way wrong. [The trouble is with the size, which depends on a non-trival kernel computation] */ PRE_MEM_READ( "chmod_extended(xsecurity)", ARG5, - sizeof(struct kauth_filesec) ); + sizeof(struct vki_kauth_filesec) ); } @@ -2241,6 +2244,9 @@ } attrspec; static const attrspec commonattr[] = { // This order is important. +#if DARWIN_VERS >= DARWIN_10_6 + { ATTR_CMN_RETURNED_ATTRS, sizeof(attribute_set_t) }, +#endif { ATTR_CMN_NAME, -1 }, { ATTR_CMN_DEVID, sizeof(dev_t) }, { ATTR_CMN_FSID, sizeof(fsid_t) }, @@ -2263,8 +2269,14 @@ { ATTR_CMN_NAMEDATTRLIST, -1 }, { ATTR_CMN_FLAGS, sizeof(uint32_t) }, { ATTR_CMN_USERACCESS, sizeof(uint32_t) }, + { ATTR_CMN_EXTENDED_SECURITY, -1 }, + { ATTR_CMN_UUID, sizeof(guid_t) }, + { ATTR_CMN_GRPUUID, sizeof(guid_t) }, { ATTR_CMN_FILEID, sizeof(uint64_t) }, { ATTR_CMN_PARENTID, sizeof(uint64_t) }, +#if DARWIN_VERS >= DARWIN_10_6 + { ATTR_CMN_FULLPATH, -1 }, +#endif { 0, 0 } }; static const attrspec volattr[] = { @@ -2288,6 +2300,9 @@ { ATTR_VOL_MOUNTEDDEVICE, -1 }, { ATTR_VOL_ENCODINGSUSED, sizeof(uint64_t) }, { ATTR_VOL_CAPABILITIES, sizeof(vol_capabilities_attr_t) }, +#if DARWIN_VERS >= DARWIN_10_6 + { ATTR_VOL_UUID, sizeof(uuid_t) }, +#endif { ATTR_VOL_ATTRIBUTES, sizeof(vol_attributes_attr_t) }, { 0, 0 } }; @@ -2336,6 +2351,16 @@ d = attrBuf; dend = d + attrBufSize; +#if DARWIN_VERS >= DARWIN_10_6 + // ATTR_CMN_RETURNED_ATTRS tells us what's really here, if set + if (a[0] & ATTR_CMN_RETURNED_ATTRS) { + // fixme range check this? + a[0] &= ~ATTR_CMN_RETURNED_ATTRS; + fn(tid, d, sizeof(attribute_set_t)); + VG_(memcpy)(a, d, sizeof(a)); + } +#endif + for (g = 0; g < 5; g++) { for (i = 0; attrdefs[g][i].attrBit; i++) { uint32_t bit = attrdefs[g][i].attrBit; @@ -2398,10 +2423,15 @@ POST(getattrlist) { if (ARG4 > sizeof(vki_uint32_t)) { - // attrBuf is uint32_t bytes written followed by attr data + // attrBuf is uint32_t size followed by attr data vki_uint32_t *sizep = (vki_uint32_t *)ARG3; POST_MEM_WRITE(ARG3, sizeof(vki_uint32_t)); - scan_attrlist(tid, (struct vki_attrlist *)ARG2, sizep+1, *sizep, &get1attr); + if (ARG5 & FSOPT_REPORT_FULLSIZE) { + // *sizep is bytes required for return value, including *sizep + } else { + // *sizep is actual bytes returned, including *sizep + } + scan_attrlist(tid, (struct vki_attrlist *)ARG2, sizep+1, MIN(*sizep, ARG4), &get1attr); } } @@ -2457,10 +2487,36 @@ POST_MEM_WRITE(ARG3, p - (char *)ARG3); - PRINT("got %d records, %d/%lu bytes\n", count, p-(char *)ARG3, ARG4); + PRINT("got %d records, %ld/%lu bytes\n", count, p-(char *)ARG3, ARG4); } +PRE(fsgetpath) +{ +#if VG_WORDSIZE == 4 + PRINT("fsgetpath(%#lx, %ld, %#lx {%lu,%lu}, %llu)", + ARG1, ARG2, ARG3, ((unsigned int *)ARG3)[0], ((unsigned int *)ARG3)[1], LOHI64(ARG4, ARG5)); + PRE_REG_READ5(ssize_t, "fsgetpath", + void*,"buf", size_t,"bufsize", + fsid_t *,"fsid", + vki_uint32_t, "objid_low32", vki_uint32_t, "objid_high32"); +#else + PRINT("fsgetpath(%#lx, %ld, %#lx {%u,%u}, %llu)", + ARG1, ARG2, ARG3, ((unsigned int *)ARG3)[0], ((unsigned int *)ARG3)[1], ARG4); + PRE_REG_READ4(ssize_t, "fsgetpath", + void*,"buf", size_t,"bufsize", + fsid_t *,"fsid", uint64_t,"objid"); +#endif + PRE_MEM_READ("fsgetpath(fsid)", ARG3, sizeof(fsid_t)); + PRE_MEM_WRITE("fsgetpath(buf)", ARG1, ARG2); +} + +POST(fsgetpath) +{ + POST_MEM_WRITE(ARG1, RES); +} + + PRE(exchangedata) { PRINT("exchangedata(%#lx(%s), %#lx(%s), %lu)", @@ -3248,6 +3304,9 @@ case VKI_A_SETCLASS: case VKI_A_SETPMASK: case VKI_A_SETFSIZE: +#if DARWIN_VERS >= DARWIN_10_6 + case VKI_A_SENDTRIGGER: +#endif // kernel reads data..data+length PRE_MEM_READ("auditon(data)", ARG2, ARG3); break; @@ -3266,6 +3325,9 @@ case VKI_A_GETCLASS: case VKI_A_GETPINFO: case VKI_A_GETPINFO_ADDR: +#if DARWIN_VERS >= DARWIN_10_6 + case VKI_A_GETSINFO_ADDR: +#endif // kernel reads and writes data..data+length // GrP fixme be precise about what gets read and written PRE_MEM_READ("auditon(data)", ARG2, ARG3); @@ -3299,6 +3361,9 @@ case VKI_A_SETCLASS: case VKI_A_SETPMASK: case VKI_A_SETFSIZE: +#if DARWIN_VERS >= DARWIN_10_6 + case VKI_A_SENDTRIGGER: +#endif // kernel reads data..data+length break; @@ -3316,6 +3381,9 @@ case VKI_A_GETCLASS: case VKI_A_GETPINFO: case VKI_A_GETPINFO_ADDR: +#if DARWIN_VERS >= DARWIN_10_6 + case VKI_A_GETSINFO_ADDR: +#endif // kernel reads and writes data..data+length // GrP fixme be precise about what gets read and written POST_MEM_WRITE(ARG2, ARG3); @@ -4384,6 +4452,51 @@ } +PRE(mach_port_move_member) +{ +#pragma pack(4) + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t member; + mach_port_name_t after; + } Request; +#pragma pack() + + Request *req = (Request *)ARG1; + + PRINT("mach_port_move_member(%s, %s, %s)", + name_for_port(MACH_REMOTE), + name_for_port(req->member), + name_for_port(req->after)); + /* + MACH_ARG(mach_port_move_member.member) = req->member; + MACH_ARG(mach_port_move_member.after) = req->after; + */ + AFTER = POST_FN(mach_port_move_member); +} + +POST(mach_port_move_member) +{ +#pragma pack(4) + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_trailer_t trailer; + } Reply; +#pragma pack() + + Reply *reply = (Reply *)ARG1; + + if (!reply->RetCode) { + // fixme port set tracker? + } else { + PRINT("mig return %d", reply->RetCode); + } +} + + PRE(mach_port_destroy) { #pragma pack(4) @@ -4504,6 +4617,34 @@ } +PRE(mach_port_extract_right) +{ +#pragma pack(4) + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_msg_type_name_t msgt_name; + } Request; +#pragma pack() + + Request *req = (Request *)ARG1; + + PRINT("mach_port_extract_right(%s, %s, %d)", + name_for_port(MACH_REMOTE), + name_for_port(req->name), req->msgt_name); + + AFTER = POST_FN(mach_port_extract_right); + + // fixme port tracker? +} + +POST(mach_port_extract_right) +{ + // fixme import_complex_message handles the returned result, right? +} + + PRE(mach_port_get_attributes) { #pragma pack(4) @@ -6092,6 +6233,7 @@ // GrP fixme semaphore destroy needed when thread creation fails // GrP fixme probably other cleanup too + // GrP fixme spinlocks might be good enough? // DDD: I'm not at all sure this is the right spot for this. It probably // should be in pthread_hijack instead, just before the call to @@ -6210,10 +6352,6 @@ } -POST(thread_policy) -{ -} - PRE(thread_policy) { mach_msg_header_t *mh = (mach_msg_header_t *)ARG1; @@ -6228,7 +6366,25 @@ AFTER = POST_FN(thread_policy); } +POST(thread_policy) +{ +} + +PRE(thread_policy_set) +{ + mach_msg_header_t *mh = (mach_msg_header_t *)ARG1; + + PRINT("thread_policy_set(%s, ...)", name_for_port(mh->msgh_request_port)); + + AFTER = POST_FN(thread_policy_set); +} + +POST(thread_policy_set) +{ +} + + PRE(thread_info) { mach_msg_header_t *mh = (mach_msg_header_t *)ARG1; @@ -6455,12 +6611,18 @@ case 3211: CALL_PRE(mach_port_get_set_status); return; + case 3212: + CALL_PRE(mach_port_move_member); + return; case 3213: CALL_PRE(mach_port_request_notification); return; case 3214: CALL_PRE(mach_port_insert_right); return; + case 3215: + CALL_PRE(mach_port_extract_right); + return; case 3217: CALL_PRE(mach_port_get_attributes); return; @@ -6602,6 +6764,9 @@ case 3616: CALL_PRE(thread_policy); return; + case 3617: + CALL_PRE(thread_policy_set); + return; default: // unknown message to a thread VG_(printf)("UNKNOWN thread message [id %d, to %s, reply 0x%x]\n", @@ -6766,7 +6931,7 @@ POST(mach_msg_unhandled) { - ML_(sync_mappings)("after", "mach_msg_unhandled", 0); + ML_(sync_mappings)("after", "mach_msg_receive (unhandled)", 0); } @@ -6906,11 +7071,12 @@ } +#if DARWIN_VERS <= DARWIN_10_5 PRE(__semwait_signal) { - /* args: int cond_sem, int mutex_sem, - int timeout, int relative, - time_t tv_sec, time_t tv_nsec */ + /* 10.5 args: int cond_sem, int mutex_sem, + int timeout, int relative, + time_t tv_sec, time_t tv_nsec */ PRINT("__semwait_signal(wait %s, signal %s, %ld, %ld, %lds:%ldns)", name_for_port(ARG1), name_for_port(ARG2), ARG3, ARG4, ARG5, ARG6); PRE_REG_READ6(long, "__semwait_signal", @@ -6920,8 +7086,33 @@ *flags |= SfMayBlock; } +#else +PRE(__semwait_signal) +{ + /* 10.5 args: int cond_sem, int mutex_sem, + int timeout, int relative, + const timespec *ts */ + PRINT("__semwait_signal(wait %s, signal %s, %ld, %ld, %#lx)", + name_for_port(ARG1), name_for_port(ARG2), ARG3, ARG4, ARG5); + PRE_REG_READ5(int, "__semwait_signal", + int,cond_sem, int,mutex_sem, + int,timeout, int,relative, + const struct vki_timespec *,ts); + + if (ARG5) PRE_MEM_READ ("__semwait_signal(ts)", + ARG5, sizeof(struct vki_timespec)); + + *flags |= SfMayBlock; +} +#endif +PRE(__thread_selfid) +{ + PRINT("__thread_selfid ()"); + PRE_REG_READ0(vki_uint64_t, "__thread_selfid"); +} + PRE(task_for_pid) { PRINT("task_for_pid(%s, %ld, %#lx)", name_for_port(ARG1), ARG2, ARG3); @@ -7474,7 +7665,11 @@ MACX_(__NR_sigreturn, sigreturn), // _____(__NR_chud), _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(186)), // ??? +#if DARWIN_VERS >= DARWIN_10_6 +// _____(__NR_fdatasync), +#else _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(187)), // ??? +#endif GENXY(__NR_stat, sys_newstat), GENXY(__NR_fstat, sys_newfstat), GENXY(__NR_lstat, sys_newlstat), @@ -7501,8 +7696,13 @@ // _____(__NR_ATPgetreq), // _____(__NR_ATPgetrsp), _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(213)), // Reserved for AppleTalk +#if DARWIN_VERS >= DARWIN_10_6 + _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(214)), // old kqueue_from_portset_np + _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(215)), // old kqueue_portset_np +#else // _____(__NR_kqueue_from_portset_np), // _____(__NR_kqueue_portset_np), +#endif // _____(__NR_mkcomplex), // _____(__NR_statv), // _____(__NR_lstatv), @@ -7515,8 +7715,13 @@ // _____(__NR_searchfs), GENX_(__NR_delete, sys_unlink), // _____(__NR_copyfile), +#if DARWIN_VERS >= DARWIN_10_6 +// _____(__NR_fgetattrlist), +// _____(__NR_fsetattrlist), +#else _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(228)), // ?? _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(229)), // ?? +#endif GENXY(__NR_poll, sys_poll), MACX_(__NR_watchevent, watchevent), MACXY(__NR_waitevent, waitevent), @@ -7532,7 +7737,11 @@ MACXY(__NR_fsctl, fsctl), MACX_(__NR_initgroups, initgroups), MACXY(__NR_posix_spawn, posix_spawn), +#if DARWIN_VERS >= DARWIN_10_6 +// _____(__NR_ffsctl), +#else _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(245)), // ??? +#endif _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(246)), // ??? // _____(__NR_nfsclnt), // _____(__NR_fhopen), @@ -7583,23 +7792,27 @@ // _____(__NR_identitysvc), // _____(__NR_shared_region_check_np), // _____(__NR_shared_region_map_np), +#if DARWIN_VERS >= DARWIN_10_6 +// _____(__NR_vm_pressure_monitor), +#else _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(296)), // old load_shared_file +#endif _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(297)), // old reset_shared_file _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(298)), // old new_system_shared_regions _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(299)), // old shared_region_map_file_np _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(300)), // old shared_region_make_private_np -// _____(__NR___pthread_mutex_destroy), -// _____(__NR___pthread_mutex_init), -// _____(__NR___pthread_mutex_lock), -// _____(__NR___pthread_mutex_trylock), -// _____(__NR___pthread_mutex_unlock), -// _____(__NR___pthread_cond_init), -// _____(__NR___pthread_cond_destroy), -// _____(__NR___pthread_cond_broadcast), -// _____(__NR___pthread_cond_signal), + _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(301)), // ??? + _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(302)), // ??? + _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(303)), // ??? + _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(304)), // ??? + _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(305)), // ??? + _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(306)), // ??? + _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(307)), // ??? + _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(308)), // ??? + _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(309)), // ??? // _____(__NR_getsid), // _____(__NR_settid_with_pid), -// _____(__NR___pthread_cond_timedwait), + _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(312)), // ??? // _____(__NR_aio_fsync), MACXY(__NR_aio_return, aio_return), MACX_(__NR_aio_suspend, aio_suspend), @@ -7608,7 +7821,7 @@ MACXY(__NR_aio_read, aio_read), MACX_(__NR_aio_write, aio_write), // _____(__NR_lio_listio), // 320 -// _____(__NR___pthread_cond_wait), + _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(321)), // ??? // _____(__NR_iopolicysys), _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(323)), // ??? // _____(__NR_mlockall), @@ -7651,15 +7864,23 @@ MACX_(__NR_bsdthread_terminate, bsdthread_terminate), MACXY(__NR_kqueue, kqueue), MACXY(__NR_kevent, kevent), -// _____(__NR_lchown), + GENX_(__NR_lchown, sys_lchown), // _____(__NR_stack_snapshot), MACX_(__NR_bsdthread_register, bsdthread_register), MACX_(__NR_workq_open, workq_open), MACXY(__NR_workq_ops, workq_ops), +#if DARWIN_VERS >= DARWIN_10_6 +// _____(__NR_kevent64), +#else _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(369)), // ??? +#endif _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(370)), // ??? _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(371)), // ??? +#if DARWIN_VERS >= DARWIN_10_6 + MACX_(__NR___thread_selfid, __thread_selfid), +#else _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(372)), // ??? +#endif _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(373)), // ??? _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(374)), // ??? _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(375)), // ??? @@ -7715,6 +7936,12 @@ // _____(__NR___mac_mount), // _____(__NR___mac_get_mount), // _____(__NR___mac_getfsstat), +#if DARWIN_VERS >= DARWIN_10_6 + MACXY(__NR_fsgetpath, fsgetpath), +// _____(__NR_audit_session_self), +// _____(__NR_audit_session_join), +#endif + // _____(__NR_MAXSYSCALL) MACX_(__NR_DARWIN_FAKE_SIGRETURN, FAKE_SIGRETURN) }; Modified: branches/MACOSX106/include/vki/vki-darwin.h =================================================================== --- branches/MACOSX106/include/vki/vki-darwin.h 2010-06-07 12:32:10 UTC (rev 11155) +++ branches/MACOSX106/include/vki/vki-darwin.h 2010-06-07 12:35:24 UTC (rev 11156) @@ -792,6 +792,11 @@ typedef struct eventreq vki_eventreq; +#include <sys/acl.h> + +#define vki_kauth_filesec kauth_filesec + + #include <sys/ptrace.h> #define VKI_PTRACE_TRACEME PT_TRACE_ME @@ -1021,6 +1026,10 @@ #define VKI_A_GETPINFO_ADDR A_GETPINFO_ADDR #define VKI_A_GETKAUDIT A_GETKAUDIT #define VKI_A_SETKAUDIT A_SETKAUDIT +#if DARWIN_VERS >= DARWIN_10_6 +#define VKI_A_SENDTRIGGER A_SENDTRIGGER +#define VKI_A_GETSINFO_ADDR A_GETSINFO_ADDR +#endif #include <sys/aio.h> Modified: branches/MACOSX106/include/vki/vki-scnums-darwin.h =================================================================== --- branches/MACOSX106/include/vki/vki-scnums-darwin.h 2010-06-07 12:32:10 UTC (rev 11155) +++ branches/MACOSX106/include/vki/vki-scnums-darwin.h 2010-06-07 12:35:24 UTC (rev 11156) @@ -32,6 +32,9 @@ #define __VKI_SCNUMS_DARWIN_H +// need DARWIN_10_x definitions +#include "config.h" + // osfmk/mach/i386/syscall_sw.h // There are two syscall number encodings in Darwin. @@ -376,7 +379,11 @@ #define __NR_sigreturn VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(184) #define __NR_chud VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(185) /* 186 */ +#if DARWIN_VERS >= DARWIN_10_6 +#define __NR_fdatasync VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(187) +#else /* 187 */ +#endif #define __NR_stat VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(188) #define __NR_fstat VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(189) #define __NR_lstat VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(190) @@ -403,8 +410,13 @@ #define __NR_ATPgetreq VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(211) #define __NR_ATPgetrsp VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(212) /* 213 Reserved for AppleTalk */ -#define __NR_kqueue_from_portset_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(214) -#define __NR_kqueue_portset_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(215) +#if DARWIN_VERS >= DARWIN_10_6 + /* 214 old kqueue_from_portset_np*/ + /* 215 old kqueue_portset_np*/ +#else +#define __NR_kqueue_from_portset_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(214) +#define __NR_kqueue_portset_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(215) +#endif #define __NR_mkcomplex VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(216) #define __NR_statv VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(217) #define __NR_lstatv VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(218) @@ -413,12 +425,17 @@ #define __NR_setattrlist VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(221) #define __NR_getdirentriesattr VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(222) #define __NR_exchangedata VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(223) - /* 224 checkuseraccess */ + /* 224 old checkuseraccess */ #define __NR_searchfs VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(225) #define __NR_delete VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(226) #define __NR_copyfile VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(227) +#if DARWIN_VERS >= DARWIN_10_6 +#define __NR_fgetattrlist VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(228) +#define __NR_fsetattrlist VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(229) +#else /* 228 */ /* 229 */ +#endif #define __NR_poll VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(230) #define __NR_watchevent VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(231) #define __NR_waitevent VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(232) @@ -434,7 +451,11 @@ #define __NR_fsctl VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(242) #define __NR_initgroups VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(243) #define __NR_posix_spawn VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(244) +#if DARWIN_VERS >= DARWIN_10_6 +#define __NR_ffsctl VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(245) +#else /* 245 */ +#endif /* 246 */ #define __NR_nfsclnt VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(247) #define __NR_fhopen VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(248) @@ -485,23 +506,27 @@ #define __NR_identitysvc VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(293) #define __NR_shared_region_check_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(294) #define __NR_shared_region_map_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(295) +#if DARWIN_VERS >= DARWIN_10_6 +#define __NR_vm_pressure_monitor VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(296) +#else /* 296 old load_shared_file */ +#endif /* 297 old reset_shared_file */ /* 298 old new_system_shared_regions */ /* 299 old shared_region_map_file_np */ /* 300 old shared_region_make_private_np */ -#define __NR___pthread_mutex_destroy VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(301) -#define __NR___pthread_mutex_init VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(302) -#define __NR___pthread_mutex_lock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(303) -#define __NR___pthread_mutex_trylock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(304) -#define __NR___pthread_mutex_unlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(305) -#define __NR___pthread_cond_init VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(306) -#define __NR___pthread_cond_destroy VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(307) -#define __NR___pthread_cond_broadcast VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(308) -#define __NR___pthread_cond_signal VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(309) + /* 301 */ + /* 302 */ + /* 303 */ + /* 304 */ + /* 305 */ + /* 306 */ + /* 307 */ + /* 308 */ + /* 309 */ #define __NR_getsid VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(310) #define __NR_settid_with_pid VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(311) -#define __NR___pthread_cond_timedwait VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(312) + /* 312 */ #define __NR_aio_fsync VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(313) #define __NR_aio_return VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(314) #define __NR_aio_suspend VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(315) @@ -510,7 +535,7 @@ #define __NR_aio_read VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(318) #define __NR_aio_write VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(319) #define __NR_lio_listio VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(320) -#define __NR___pthread_cond_wait VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(321) + /* 321 */ #define __NR_iopolicysys VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(322) /* 323 */ #define __NR_mlockall VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(324) @@ -559,10 +584,18 @@ #define __NR_bsdthread_register VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(366) #define __NR_workq_open VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(367) #define __NR_workq_ops VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(368) +#if DARWIN_VERS >= DARWIN_10_6 +#define __NR_kevent64 VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(369) +#else /* 369 */ +#endif /* 370 */ /* 371 */ +#if DARWIN_VERS >= DARWIN_10_6 +#define __NR___thread_selfid VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(372) // was UX64 +#else /* 372 */ +#endif /* 373 */ /* 374 */ /* 375 */ @@ -617,7 +650,19 @@ #define __NR___mac_mount VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(424) #define __NR___mac_get_mount VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(425) #define __NR___mac_getfsstat VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(426) +#if DARWIN_VERS >= DARWIN_10_6 +#define __NR_fsgetpath VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(427) +#define __NR_audit_session_self VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(428) +#define __NR_audit_session_join VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(429) +#endif + +#if DARWIN_VERS < DARWIN_10_6 #define __NR_MAXSYSCALL VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(427) +#elif DARWIN_VERSION < DARWIN_10_7 +#define __NR_MAXSYSCALL VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(430) +#else +#error unknown darwin version +#endif #define __NR_DARWIN_FAKE_SIGRETURN (1 + __NR_MAXSYSCALL) |
|
From: <gup...@ne...> - 2010-06-07 14:17:57
|
I am using callgrind on hardware with very small disk space. I'd like to know where should I begin making changes so that the callgrind logs (basic blocks, function before, function after) are written to a network socket instead of a log-file. Could someone be of help? SVG ____________________________________________________________ Project Management 100% Online. Project Management certificate from Villanova. Free info. http://thirdpartyoffers.netzero.net/TGL3241/4c0cff6029c7223d6eest04vuc |
|
From: <sv...@va...> - 2010-06-07 14:15:18
|
Author: sewardj
Date: 2010-06-07 15:15:08 +0100 (Mon, 07 Jun 2010)
New Revision: 11158
Log:
Remove stdio dependency from arc4random intercepts. (Filipe Cabecinhas).
See #205241 comment 30.
Modified:
branches/MACOSX106/coregrind/vg_preloaded.c
Modified: branches/MACOSX106/coregrind/vg_preloaded.c
===================================================================
--- branches/MACOSX106/coregrind/vg_preloaded.c 2010-06-07 12:36:06 UTC (rev 11157)
+++ branches/MACOSX106/coregrind/vg_preloaded.c 2010-06-07 14:15:08 UTC (rev 11158)
@@ -151,17 +151,18 @@
Darwin arc4random (rdar://6166275)
------------------------------------------------------------------ */
-#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
int VG_REPLACE_FUNCTION_ZU(libSystemZdZaZddylib, arc4random)(void);
int VG_REPLACE_FUNCTION_ZU(libSystemZdZaZddylib, arc4random)(void)
{
- static FILE *rnd = 0;
+ static int rnd = -1;
int result;
- if (!rnd) rnd = fopen("/dev/random", "r");
-
- fread(&result, sizeof(result), 1, rnd);
+ if (rnd < 0) rnd = open("/dev/random", O_RDONLY);
+
+ read(rnd, &result, sizeof(result));
return result;
}
|
|
From: <sv...@va...> - 2010-06-07 12:40:27
|
Author: sewardj Date: 2010-06-07 13:32:10 +0100 (Mon, 07 Jun 2010) New Revision: 11155 Log: Build system changes for MacOSX 10.6. (Part of a patch to add support for MacOSX 10.6, by Greg Parker, updated by Alexander Potapenko. See https://bugs.kde.org/show_bug.cgi?id=205241#c27) Modified: branches/MACOSX106/Makefile.am branches/MACOSX106/configure.in branches/MACOSX106/coregrind/Makefile.am Modified: branches/MACOSX106/Makefile.am =================================================================== --- branches/MACOSX106/Makefile.am 2010-06-07 11:32:31 UTC (rev 11154) +++ branches/MACOSX106/Makefile.am 2010-06-07 12:32:10 UTC (rev 11155) @@ -48,7 +48,8 @@ glibc-2.2-LinuxThreads-helgrind.supp \ glibc-2.X-drd.supp \ exp-ptrcheck.supp \ - darwin9.supp darwin9-drd.supp + darwin9.supp darwin9-drd.supp \ + darwin10.supp darwin10-drd.supp DEFAULT_SUPP_FILES = @DEFAULT_SUPP@ # We include all the base .supp files in the distribution, but not Modified: branches/MACOSX106/configure.in =================================================================== --- branches/MACOSX106/configure.in 2010-06-07 11:32:31 UTC (rev 11154) +++ branches/MACOSX106/configure.in 2010-06-07 12:32:10 UTC (rev 11155) @@ -259,6 +259,9 @@ *darwin*) AC_MSG_RESULT([ok (${host_os})]) VGCONF_OS="darwin" + AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5]) + AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6]) + AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7]) AC_MSG_CHECKING([for the kernel version]) kernel=`uname -r` @@ -266,21 +269,27 @@ # Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin # has only one relevant version, the OS version. The `uname` check # is a good way to get that version (i.e. "Darwin 9.6.0" is Mac OS - # X 10.5.6, and "Darwin 10.x" would presumably be Mac OS X 10.6.x - # Snow Leopard and darwin10.supp), and we don't know of an macros - # similar to __GLIBC__ to get that info. + # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard), + # and we don't know of an macros similar to __GLIBC__ to get that info. # # XXX: `uname -r` won't do the right thing for cross-compiles, but # that's not a problem yet. case "${kernel}" in 9.*) AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard]) + AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version]) DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}" ;; + 10.*) + AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard]) + AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version]) + DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}" + DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" + ;; *) AC_MSG_RESULT([unsupported (${kernel})]) - AC_MSG_ERROR([Valgrind works on Darwin 9.x (Mac OS X 10.5)]) + AC_MSG_ERROR([Valgrind works on Darwin 9.x and 10.x (Mac OS X 10.5 and 10.6)]) ;; esac ;; Modified: branches/MACOSX106/coregrind/Makefile.am =================================================================== --- branches/MACOSX106/coregrind/Makefile.am 2010-06-07 11:32:31 UTC (rev 11154) +++ branches/MACOSX106/coregrind/Makefile.am 2010-06-07 12:32:10 UTC (rev 11155) @@ -115,11 +115,13 @@ /usr/include/mach/vm_map.defs endif -# Be careful w.r.t. parellel builds. See section 27.9 of the automake info +# Be careful w.r.t. parallel builds. See section 27.9 of the automake info # page, "Handling Tools that Produce many Outputs". -$(mach_user_srcs): $(mach_defs) +$(abs_builddir)/m_mach: + mkdir -p $@ +$(mach_user_srcs): $(mach_defs) $(abs_builddir)/m_mach (cd m_mach && mig $(mach_defs)) -$(mach_hdrs): $(mach_defs) $(mach_user_srcs) +$(mach_hdrs): $(mach_defs) $(mach_user_srcs) $(abs_builddir)/m_mach (cd m_mach && mig $(mach_defs)) #---------------------------------------------------------------------------- |
|
From: <sv...@va...> - 2010-06-07 12:36:23
|
Author: sewardj Date: 2010-06-07 13:36:06 +0100 (Mon, 07 Jun 2010) New Revision: 11157 Log: Comment-only change. (Part of a patch to add support for MacOSX 10.6, by Greg Parker, updated by Alexander Potapenko. See https://bugs.kde.org/show_bug.cgi?id=205241#c27) Modified: branches/MACOSX106/darwin9-drd.supp Modified: branches/MACOSX106/darwin9-drd.supp =================================================================== --- branches/MACOSX106/darwin9-drd.supp 2010-06-07 12:35:24 UTC (rev 11156) +++ branches/MACOSX106/darwin9-drd.supp 2010-06-07 12:36:06 UTC (rev 11157) @@ -1,3 +1,6 @@ + +# DRD suppressions for Darwin 9.x / Mac OS X 10.5 Leopard + # # Suppression patterns for dyld, the dynamic loader. # |
|
From: <sv...@va...> - 2010-06-07 11:32:44
|
Author: sewardj
Date: 2010-06-07 12:32:31 +0100 (Mon, 07 Jun 2010)
New Revision: 11154
Log:
Initial suppression files for MacOSX 10.6.
Added:
branches/MACOSX106/darwin10-drd.supp
branches/MACOSX106/darwin10.supp
Added: branches/MACOSX106/darwin10-drd.supp
===================================================================
Added: branches/MACOSX106/darwin10.supp
===================================================================
--- branches/MACOSX106/darwin10.supp (rev 0)
+++ branches/MACOSX106/darwin10.supp 2010-06-07 11:32:31 UTC (rev 11154)
@@ -0,0 +1,273 @@
+
+# Suppressions for Darwin 10.x / Mac OS X 10.6 Snow Leopard
+
+##----------------------------------------------------------------------##
+# Memcheck
+##----------------------------------------------------------------------##
+
+{
+ mach_msg_trap-1
+ Memcheck:Param
+ mach_msg(msg.msgh_remote_port)
+ fun:mach_msg_trap
+ obj:/System/Library/Frameworks/CoreFoundation*
+ obj:/System/Library/Frameworks/ApplicationServices*
+}
+
+{
+ mach_msg_trap-2
+ Memcheck:Param
+ mach_msg(msg.msgh_remote_port)
+ fun:mach_msg_trap
+ obj:/System/Library/Frameworks/CoreFoundation*
+ obj:/System/Library/Frameworks/CoreServices*
+}
+
+{
+ mach_msg_trap-3
+ Memcheck:Param
+ mach_msg(msg.msgh_remote_port)
+ fun:mach_msg_trap
+ obj:/System/Library/Frameworks/CoreFoundation*
+ obj:/System/Library/Frameworks/Carbon*
+}
+
+{
+ mach_msg_trap-4
+ Memcheck:Param
+ mach_msg(msg.msgh_remote_port)
+ fun:mach_msg_trap
+ obj:/System/Library/Frameworks/CoreFoundation*
+ obj:/System/Library/Frameworks/CoreFoundation*
+}
+
+{
+ mach_msg_trap-5
+ Memcheck:Param
+ mach_msg(msg.msgh_remote_port)
+ fun:mach_msg_trap
+ obj:/System/Library/Frameworks/CoreFoundation*
+ obj:/System/Library/Frameworks/AppKit*
+}
+
+{
+ macos-Cond-1
+ Memcheck:Cond
+ fun:GetVariationInfoFromName
+ obj:/System/Library/Frameworks/ApplicationServices*
+ obj:/System/Library/Frameworks/ApplicationServices*
+}
+
+{
+ macos-Cond-2
+ Memcheck:Cond
+ fun:*PMMutex*Lock*
+ obj:/System/Library/Frameworks/ApplicationServices*
+ obj:/System/Library/Frameworks/ApplicationServices*
+}
+
+{
+ macos-Cond-3
+ Memcheck:Cond
+ fun:sseCGSBlendXXXX8888
+ obj:/System/Library/Frameworks/ApplicationServices*
+ obj:/System/Library/Frameworks/ApplicationServices*
+}
+
+{
+ macos-Cond-4
+ Memcheck:Cond
+ fun:*CASettingsStorage*RefreshSettings*
+ obj:/System/Library/Frameworks/CoreAudio*
+ obj:/System/Library/Frameworks/CoreAudio*
+}
+
+{
+ macos-Cond-5
+ Memcheck:Cond
+ fun:gle*
+ obj:/System/Library/Frameworks/OpenGL*
+ obj:/System/Library/Frameworks/OpenGL*
+}
+
+{
+ macos-Cond-6
+ Memcheck:Cond
+ fun:pthread_rwlock_init$UNIX2003
+ fun:main
+}
+
+# afaict this is legit. Might be caused by setenv("VAR=")
+# where the value string is empty (not sure)
+{
+ macos-Cond-7
+ Memcheck:Cond
+ fun:__setenv
+ fun:putenv*
+}
+
+{
+ macos-futimes-1
+ Memcheck:Param
+ futimes(tvp[1])
+ fun:futimes
+ obj:/usr/lib/libSystem*
+ obj:/usr/lib/libSystem*
+}
+
+{
+ macos-vsyslog-hole
+ Memcheck:Param
+ socketcall.sendto(msg)
+ fun:sendto$NOCANCEL$UNIX2003
+ fun:vsyslog
+}
+
+# Still-reachable memory.
+
+# I chopped this one off at libSystem_initializer, there were more frames.
+{
+ darwin-still-reachable-1
+ Memcheck:Leak
+ fun:calloc
+ fun:dwarf2_unwind_dyld_add_image_hook
+ fun:_ZN4dyld19registerAddCallbackEPFvPK11mach_headerlE
+ fun:_dyld_register_func_for_add_image
+ fun:__keymgr_initializer
+ fun:libSystem_initializer
+}
+
+# I chopped this one off at libSystem_initializer, there were more frames.
+{
+ darwin-still-reachable-2
+ Memcheck:Leak
+ fun:malloc
+ fun:get_or_create_key_element
+ fun:_keymgr_get_and_lock_processwide_ptr_2
+ fun:dwarf2_unwind_dyld_add_image_hook
+ fun:_ZN4dyld19registerAddCallbackEPFvPK11mach_headerlE
+ fun:_dyld_register_func_for_add_image
+ fun:__keymgr_initializer
+ fun:libSystem_initializer
+}
+
+{
+ darwin-still-reachable-3
+ Memcheck:Leak
+ fun:malloc
+ fun:__smakebuf
+ fun:__swsetup
+ fun:__sfvwrite
+ fun:puts
+}
+
+# Genuine leaks.
+# 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
+ fun:malloc_zone_malloc
+ fun:__setenv
+ fun:setenv$UNIX2003
+}
+{
+ macos-localeconv-leak
+ Memcheck:Leak
+ fun:malloc
+ fun:localeconv_l
+ fun:__vfprintf
+ fun:vsnprintf
+}
+
+##----------------------------------------------------------------------##
+# Helgrind
+##----------------------------------------------------------------------##
+
+# These ones were necessary to give no errors on a tiny non-threaded
+# program. I don't know if they're real problems or false positives (njn).
+
+# keymgr seems to deliberately do some bogus actions, and if they are bogus,
+# it passes the error codes back to the caller.
+{
+ __keymgr_initializer lock failed
+ Helgrind:PthAPIerror
+ fun:pthread_mutex_lock
+ fun:_dyld_register_func_for_*_image
+ fun:__keymgr_initializer
+ fun:libSystem_initializer
+}
+{
+ __keymgr_initializer unlock failed
+ Helgrind:PthAPIerror
+ fun:pthread_mutex_unlock
+ fun:_dyld_register_func_for_*_image
+ fun:__keymgr_initializer
+ fun:libSystem_initializer
+}
+{
+ __keymgr_initializer bogus unlock
+ Helgrind:UnlockBogus
+ fun:pthread_mutex_unlock
+ fun:_dyld_register_func_for_*_image
+ fun:__keymgr_initializer
+ fun:libSystem_initializer
+}
+
+# These ones were necessary to give no errors on a tiny threaded program.
+# I don't know if they're real problems or false positives (njn).
+
+#{
+# helgrind-darwinlibc-nuke-everything-in-dyld
+# Helgrind:Race
+# obj:/usr/lib/dyld
+#}
+
+{
+ helgrind-darwinlibc-nuke-everything-in-libSystem.B.dylib
+ Helgrind:Race
+ obj:/usr/lib/libSystem.B.dylib
+}
+
+# This would be better as "fun:\?\?\?" but string matching doesn't seem to
+# allow escaping meta-chars.
+#
+# This is very bad .. not only will it hide races in any
+# un-identified piece of code, the ??? also matches any 3-char
+# function name.
+{
+ helgrind-darwinlibc-nuke-everything-in-???-(unknown-code)
+ Helgrind:Race
+ fun:???
+}
+
+{
+ helgrind-darwinlibc--mythread_wrapper-*thread*start*
+ Helgrind:Race
+ fun:mythread_wrapper
+ fun:*thread*start*
+}
+
+{
+ helgrind-darwinlibc--pthread_create_WRK-pthread_create
+ Helgrind:Race
+ fun:pthread_create_WRK
+ fun:pthread_create
+}
+
+
+# Thread #9: Bug in libpthread: recursive write lock granted on
+# mutex/wrlock which does not support recursion
+# at 0x18696: pthread_cond_wait* (hg_intercepts.c:655)
+# by 0x2300B8: pthread_rwlock_wrlock$UNIX2003 (in /usr/lib/libSystem.B.dylib)
+# by 0x18F41: pthread_rwlock_wrlock* (hg_intercepts.c:1177)
+#
+# no idea what this is about
+#
+{
+ helgrind-darwin9--pthread-rwlock-kludgery
+ Helgrind:Misc
+ fun:pthread_cond_wait*
+ fun:pthread_rwlock_*lock*
+ fun:pthread_rwlock_*lock*
+}
|
|
From: <sv...@va...> - 2010-06-07 11:23:56
|
Author: sewardj
Date: 2010-06-07 12:23:47 +0100 (Mon, 07 Jun 2010)
New Revision: 11153
Log:
Indentation/comment-only changes.
Modified:
branches/MACOSX106/coregrind/m_main.c
Modified: branches/MACOSX106/coregrind/m_main.c
===================================================================
--- branches/MACOSX106/coregrind/m_main.c 2010-06-05 11:57:57 UTC (rev 11152)
+++ branches/MACOSX106/coregrind/m_main.c 2010-06-07 11:23:47 UTC (rev 11153)
@@ -1526,9 +1526,9 @@
// Ensure we're on a plausible stack.
// p: logging
//--------------------------------------------------------------
-#if defined(VGO_darwin)
+# if defined(VGO_darwin)
// Darwin doesn't use the interim stack.
-#else
+# else
VG_(debugLog)(1, "main", "Checking current stack is plausible\n");
{ HChar* limLo = (HChar*)(&VG_(interim_stack).bytes[0]);
HChar* limHi = limLo + sizeof(VG_(interim_stack));
@@ -1556,12 +1556,12 @@
VG_(debugLog)(0, "main", " Cannot continue. Sorry.\n");
VG_(exit)(1);
}
-#endif
+# endif
//--------------------------------------------------------------
// Start up the address space manager, and determine the
// approximate location of the client's stack
- // p: logging, plausible-stack, darwin-munmap
+ // p: logging, plausible-stack
//--------------------------------------------------------------
VG_(debugLog)(1, "main", "Starting the address space manager\n");
vg_assert(VKI_PAGE_SIZE == 4096 || VKI_PAGE_SIZE == 65536);
|