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
(32) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
(17) |
2
(11) |
3
(6) |
4
(6) |
|
5
(10) |
6
(5) |
7
(3) |
8
(7) |
9
(4) |
10
(4) |
11
(3) |
|
12
(3) |
13
(17) |
14
(18) |
15
(32) |
16
(22) |
17
(18) |
18
(10) |
|
19
(4) |
20
(3) |
21
(8) |
22
(15) |
23
(32) |
24
(28) |
25
(18) |
|
26
(20) |
27
(16) |
28
(28) |
29
(28) |
30
(27) |
|
|
|
From: Filipe C. <fi...@gm...> - 2009-04-05 11:11:15
|
Hi,
How can I enable a 64bit build in darwin? I even tried
--enable-only64bit but it would only build a 32bit binary:
Maximum build arch: x86
Primary build arch: x86
Build OS: darwin
Primary build target: X86_DARWIN
Secondary build target:
How can I make it build a 64bit version? (Or one with both arches)
Regards,
F
P.S: configure line: ./configure --prefix=/Users/filcab/valgrind/
--enable-only64bit
sv...@va... wrote:
> Author: sewardj
> Date: 2009-04-05 11:28:46 +0100 (Sun, 05 Apr 2009)
> New Revision: 9517
>
> Log:
> Unbreak the 64-bit build following recent SysRes/syscall hackery, so
> it now builds again on 64-bit Darwin and can run small programs.
> Support for syscalls interrupted by signals is still lacking, but
> fixing it is mostly a case of enabling the __NR___pthread_sigmask
> calls in syscall-amd64-darwin.S, fixing
> ML_(fixup_guest_state_to_restart_syscall), and setting IP_AT_SYSCALL
> in the Vex front end for amd64.
>
>
>
> Modified:
> branches/DARWIN/coregrind/m_signals.c
> branches/DARWIN/coregrind/m_syscall.c
> branches/DARWIN/coregrind/m_syswrap/syscall-amd64-darwin.S
> branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
> branches/DARWIN/coregrind/m_syswrap/syswrap-main.c
> branches/DARWIN/coregrind/m_vki.c
> branches/DARWIN/coregrind/pub_core_syscall.h
> branches/DARWIN/include/pub_tool_basics.h
>
>
> Modified: branches/DARWIN/coregrind/m_signals.c
> ===================================================================
> --- branches/DARWIN/coregrind/m_signals.c 2009-04-04 15:14:55 UTC (rev 9516)
> +++ branches/DARWIN/coregrind/m_signals.c 2009-04-05 10:28:46 UTC (rev 9517)
> @@ -370,7 +370,8 @@
> static inline Addr VG_UCONTEXT_STACK_PTR( void* ucV ) {
> I_die_here;
> }
> - static inline SysRes VG_UCONTEXT_SYSCALL_SYSRES( void* ucV ) {
> + static inline SysRes VG_UCONTEXT_SYSCALL_SYSRES( void* ucV,
> + UWord scclass ) {
> I_die_here;
> }
> static inline Addr VG_UCONTEXT_LINK_REG( void* ucV ) {
>
> Modified: branches/DARWIN/coregrind/m_syscall.c
> ===================================================================
> --- branches/DARWIN/coregrind/m_syscall.c 2009-04-04 15:14:55 UTC (rev 9516)
> +++ branches/DARWIN/coregrind/m_syscall.c 2009-04-05 10:28:46 UTC (rev 9517)
> @@ -192,22 +192,37 @@
> return res;
> }
>
> -static SysRes mk_SysRes_amd64_darwin ( UWord val, UWord val2, UWord errflag ) {
> - I_die_here;
> - /*
> +SysRes VG_(mk_SysRes_amd64_darwin) ( UChar scclass, Bool isErr,
> + ULong wHI, ULong wLO )
> +{
> SysRes res;
> - res.isError = errflag != 0;
> - if (res.isError) {
> - res.err = val;
> - res.res = 0;
> - res.res2 = 0;
> - } else {
> - res.err = 0;
> - res.res = val;
> - res.res2 = val2;
> + res._wHI = 0;
> + res._wLO = 0;
> + res._mode = 0; /* invalid */
> + vg_assert(isErr == False || isErr == True);
> + vg_assert(sizeof(UWord) == sizeof(ULong));
> + switch (scclass) {
> + case VG_DARWIN_SYSCALL_CLASS_UNIX:
> + res._wLO = wLO;
> + res._wHI = wHI;
> + res._mode = isErr ? SysRes_UNIX_ERR : SysRes_UNIX_OK;
> + break;
> + case VG_DARWIN_SYSCALL_CLASS_MACH:
> + vg_assert(!isErr);
> + vg_assert(wHI == 0);
> + res._wLO = wLO;
> + res._mode = SysRes_MACH;
> + break;
> + case VG_DARWIN_SYSCALL_CLASS_MDEP:
> + vg_assert(!isErr);
> + vg_assert(wHI == 0);
> + res._wLO = wLO;
> + res._mode = SysRes_MDEP;
> + break;
> + default:
> + vg_assert(0);
> }
> return res;
> - */
> }
>
> /* Generic constructors. We assume (without checking if this makes
> @@ -559,6 +574,8 @@
> Error:
> * MACH,MDEP: no error is returned
> * UNIX: the carry flag indicates success or failure
> +
> + nb here, sizeof(UWord) == sizeof(UInt)
> */
>
> __private_extern__ ULong
> @@ -616,13 +633,15 @@
> The kernel's syscall calling convention is:
> * the syscall number goes in rax
> * the args are passed to the syscall in registers and the stack
> - * the call instruction is `syscall`
> + * the call instruction is 'syscall'
> Return value:
> * MACH,MDEP: the return value comes back in rax
> - * UNIX: the return value comes back in rdx:rax
> + * UNIX: the return value comes back in rdx:rax (hi64:lo64)
> Error:
> * MACH,MDEP: no error is returned
> * UNIX: the carry flag indicates success or failure
> +
> + nb here, sizeof(UWord) == sizeof(ULong)
> */
>
> __private_extern__ UWord
> @@ -630,8 +649,8 @@
> UWord a4, UWord a5, UWord a6, /* rcx, r8, r9 */
> UWord a7, UWord a8, /* 8(rsp), 16(rsp) */
> UWord syscall_no, /* 24(rsp) */
> - /*OUT*/UWord *errflag, /* 32(rsp) */
> - /*OUT*/UWord *res2 ); /* 40(rsp) */
> + /*OUT*/ULong* errflag, /* 32(rsp) */
> + /*OUT*/ULong* res2 ); /* 40(rsp) */
> // Unix syscall: 128-bit return in rax:rdx, with LSB in rax
> // error indicated by carry flag: clear=good, set=bad
> asm(".private_extern _do_syscall_unix_WRK\n"
> @@ -767,18 +786,16 @@
> return VG_(mk_SysRes_x86_darwin)( scclass, err ? True : False, wHI, wLO );
>
> # elif defined(VGP_amd64_darwin)
> - UWord err = 0;
> - UWord val = 0, val2 = 0;
> + ULong wLO = 0, wHI = 0, err = 0;
> UChar scclass = VG_DARWIN_SYSNO_CLASS(sysno);
> - switch (VG_DARWIN_SYSNO_CLASS(sysno)) {
> + switch (scclass) {
> case VG_DARWIN_SYSCALL_CLASS_UNIX:
> - case VG_DARWIN_SYSCALL_CLASS_UX64:
> - val = do_syscall_unix_WRK(a1,a2,a3,a4,a5,a6,a7,a8,
> - VG_DARWIN_SYSNO_NUM(sysno), &err, &val2);
> + wLO = do_syscall_unix_WRK(a1,a2,a3,a4,a5,a6,a7,a8,
> + VG_DARWIN_SYSNO_NUM(sysno), &err, &wHI);
> break;
> case VG_DARWIN_SYSCALL_CLASS_MACH:
> case VG_DARWIN_SYSCALL_CLASS_MDEP:
> - val = do_syscall_mach_WRK(a1,a2,a3,a4,a5,a6,a7,a8,
> + wLO = do_syscall_mach_WRK(a1,a2,a3,a4,a5,a6,a7,a8,
> VG_DARWIN_SYSNO_NUM(sysno));
> err = 0;
> break;
> @@ -786,8 +803,8 @@
> vg_assert(0);
> break;
> }
> - return mk_SysRes_amd64_darwin( val, val2, err );
> -
> + return VG_(mk_SysRes_amd64_darwin)( scclass, err ? True : False, wHI, wLO );
> +
> #else
> # error Unknown platform
> #endif
>
> Modified: branches/DARWIN/coregrind/m_syswrap/syscall-amd64-darwin.S
> ===================================================================
> --- branches/DARWIN/coregrind/m_syswrap/syscall-amd64-darwin.S 2009-04-04 15:14:55 UTC (rev 9516)
> +++ branches/DARWIN/coregrind/m_syswrap/syscall-amd64-darwin.S 2009-04-05 10:28:46 UTC (rev 9517)
> @@ -67,11 +67,12 @@
> const vki_sigset_t *sysmask, // rdx
> const vki_sigset_t *postmask, // rcx
> Int sigsetSzB) // r8
> -
> +
> + Note that sigsetSzB is totally ignored (and irrelevant).
> */
>
> /* from vki_arch.h */
> -#define VKI_SIG_SETMASK 2
> +#define VKI_SIG_SETMASK 3
>
> /* DO_SYSCALL MACH|MDEP|UNIX */
> #define MACH 1
> @@ -92,7 +93,7 @@
>
> L_$0_1: /* Even though we can't take a signal until the sigprocmask completes,
> start the range early.
> - If eip is in the range [1,2), the syscall hasn't been started yet */
> + If rip is in the range [1,2), the syscall hasn't been started yet */
>
> /* Set the signal mask which should be current during the syscall. */
> /* GrP fixme signals
> @@ -195,10 +196,6 @@
> _ML_(do_syscall_for_client_unix_WRK):
> DO_SYSCALL UNIX
>
> -.globl _ML_(do_syscall_for_client_ux64_WRK)
> -_ML_(do_syscall_for_client_ux64_WRK):
> - jmp _ML_(do_syscall_for_client_unix_WRK)
> -
> .globl _ML_(do_syscall_for_client_mach_WRK)
> _ML_(do_syscall_for_client_mach_WRK):
> DO_SYSCALL MACH
> @@ -212,18 +209,45 @@
> VG_(fixup_guest_state_after_syscall_interrupted) can do the
> right thing */
>
> -/* GrP fixme wrong */
> -.globl _ML_(blksys_setup)
> -.globl _ML_(blksys_restart)
> -.globl _ML_(blksys_complete)
> -.globl _ML_(blksys_committed)
> -.globl _ML_(blksys_finished)
> -_ML_(blksys_setup): .quad L_1_1
> -_ML_(blksys_restart): .quad L_1_2
> -_ML_(blksys_complete): .quad L_1_3
> -_ML_(blksys_committed): .quad L_1_4
> -_ML_(blksys_finished): .quad L_1_5
> +/* eg MK_L_SCLASS_N(UNIX,99) produces L_3_99
> + since UNIX is #defined to 3 at the top of this file */
> +#define FOO(scclass,labelno) L_##scclass##_##labelno
> +#define MK_L_SCCLASS_N(scclass,labelno) FOO(scclass,labelno)
>
> +.globl _ML_(blksys_setup_MACH)
> +.globl _ML_(blksys_restart_MACH)
> +.globl _ML_(blksys_complete_MACH)
> +.globl _ML_(blksys_committed_MACH)
> +.globl _ML_(blksys_finished_MACH)
> +_ML_(blksys_setup_MACH): .quad MK_L_SCCLASS_N(MACH,1)
> +_ML_(blksys_restart_MACH): .quad MK_L_SCCLASS_N(MACH,2)
> +_ML_(blksys_complete_MACH): .quad MK_L_SCCLASS_N(MACH,3)
> +_ML_(blksys_committed_MACH): .quad MK_L_SCCLASS_N(MACH,4)
> +_ML_(blksys_finished_MACH): .quad MK_L_SCCLASS_N(MACH,5)
> +
> +.globl _ML_(blksys_setup_MDEP)
> +.globl _ML_(blksys_restart_MDEP)
> +.globl _ML_(blksys_complete_MDEP)
> +.globl _ML_(blksys_committed_MDEP)
> +.globl _ML_(blksys_finished_MDEP)
> +_ML_(blksys_setup_MDEP): .quad MK_L_SCCLASS_N(MDEP,1)
> +_ML_(blksys_restart_MDEP): .quad MK_L_SCCLASS_N(MDEP,2)
> +_ML_(blksys_complete_MDEP): .quad MK_L_SCCLASS_N(MDEP,3)
> +_ML_(blksys_committed_MDEP): .quad MK_L_SCCLASS_N(MDEP,4)
> +_ML_(blksys_finished_MDEP): .quad MK_L_SCCLASS_N(MDEP,5)
> +
> +.globl _ML_(blksys_setup_UNIX)
> +.globl _ML_(blksys_restart_UNIX)
> +.globl _ML_(blksys_complete_UNIX)
> +.globl _ML_(blksys_committed_UNIX)
> +.globl _ML_(blksys_finished_UNIX)
> +_ML_(blksys_setup_UNIX): .quad MK_L_SCCLASS_N(UNIX,1)
> +_ML_(blksys_restart_UNIX): .quad MK_L_SCCLASS_N(UNIX,2)
> +_ML_(blksys_complete_UNIX): .quad MK_L_SCCLASS_N(UNIX,3)
> +_ML_(blksys_committed_UNIX): .quad MK_L_SCCLASS_N(UNIX,4)
> +_ML_(blksys_finished_UNIX): .quad MK_L_SCCLASS_N(UNIX,5)
> +
> +
> /*--------------------------------------------------------------------*/
> /*--- end ---*/
> /*--------------------------------------------------------------------*/
>
> Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
> ===================================================================
> --- branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-04-04 15:14:55 UTC (rev 9516)
> +++ branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-04-05 10:28:46 UTC (rev 9517)
> @@ -6854,7 +6854,14 @@
> ThreadState *tst = VG_(get_ThreadState)(tid);
> tst->os_state.pthread = ARG1;
> tst->arch.vex.guest_GS_0x60 = ARG1;
> - SET_STATUS_Success(0x60);
> + // SET_STATUS_Success(0x60);
> + // see comments on x86 case just above
> + SET_STATUS_from_SysRes(
> + VG_(mk_SysRes_amd64_darwin)(
> + VG_DARWIN_SYSNO_CLASS(__NR_pthread_set_self),
> + False, 0, 0x60
> + )
> + );
> }
>
> #else
>
> Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-main.c
> ===================================================================
> --- branches/DARWIN/coregrind/m_syswrap/syswrap-main.c 2009-04-04 15:14:55 UTC (rev 9516)
> +++ branches/DARWIN/coregrind/m_syswrap/syswrap-main.c 2009-04-05 10:28:46 UTC (rev 9517)
> @@ -79,12 +79,12 @@
> Mach traps: result is in r3, and there is no error flag.
> ppc64 r0 r3 r4 r5 r6 r7 r8 ?? ?? r3+CR0.SO (== ARG1)
> x86 eax +4 +8 +12 +16 +20 +24 +28 +32 edx:eax, eflags.c
> - amd64 rax rdi rsi rdx rcx r8 r9 stk stk 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)". Apparently
> - 0(%esp) is some kind of return address (perhaps for syscalls done
> - with "sysenter"?) I don't think it is relevant for syscalls done
> - with "int $0x80/1/2".
> + For x86-darwin, "+N" denotes "in memory at N(%esp)"; ditto
> + amd64-darwin. Apparently 0(%esp) is some kind of return address
> + (perhaps for syscalls done with "sysenter"?) I don't think it is
> + relevant for syscalls done with "int $0x80/1/2".
> */
>
> /* This is the top level of the system-call handler module. All
> @@ -595,7 +595,7 @@
> canonical->arg7 = stack[2];
> canonical->arg8 = stack[3];
>
> - PRINT("SYSCALL[%d,?](%5lld) syscall(#%x, ...); please stand by...\n",
> + PRINT("SYSCALL[%d,?](%5lld) syscall(#%lx, ...); please stand by...\n",
> VG_(getpid)(), /*tid,*/ (Long)0,
> VG_DARWIN_SYSNO_PRINT(canonical->sysno));
> }
> @@ -787,53 +787,35 @@
> canonical->what = SsComplete;
>
> # elif defined(VGP_amd64_darwin)
> + /* duplicates logic in m_signals.VG_UCONTEXT_SYSCALL_SYSRES */
> VexGuestAMD64State* gst = (VexGuestAMD64State*)gst_vanilla;
> - UInt carry = 1 & LibVEX_GuestAMD64_get_rflags(gst);
> - UInt err;
> - UWord val;
> - UWord val2;
> -
> + ULong carry = 1 & LibVEX_GuestAMD64_get_rflags(gst);
> + ULong err = 0;
> + ULong wLO = 0;
> + ULong wHI = 0;
> switch (gst->guest_SC_CLASS) {
> - case VG_DARWIN_SYSCALL_CLASS_UX64:
> - // int $0x80 = Unix, 128-bit result
> - err = carry;
> - val = gst->guest_RAX;
> - val2 = gst->guest_RDX;
> - break;
> - case VG_DARWIN_SYSCALL_CLASS_UNIX:
> - // syscall = Unix, 64-bit result
> - err = carry;
> - val = gst->guest_RAX;
> - val2 = 0;
> - break;
> - case VG_DARWIN_SYSCALL_CLASS_MACH:
> - // int $0x81 = Mach, 64-bit result
> - err = 0;
> - val = gst->guest_RAX;
> - val2 = 0;
> - break;
> - case VG_DARWIN_SYSCALL_CLASS_MDEP:
> - // int $0x82 = mdep, 64-bit result
> - err = 0;
> - val = gst->guest_RAX;
> - val2 = 0;
> - break;
> - default:
> - vg_assert(0);
> - break;
> + case VG_DARWIN_SYSCALL_CLASS_UNIX:
> + // syscall = Unix, 128-bit result
> + err = carry;
> + wLO = gst->guest_RAX;
> + wHI = gst->guest_RDX;
> + break;
> + case VG_DARWIN_SYSCALL_CLASS_MACH:
> + // syscall = Mach, 64-bit result
> + wLO = gst->guest_RAX;
> + break;
> + case VG_DARWIN_SYSCALL_CLASS_MDEP:
> + // syscall = mdep, 64-bit result
> + wLO = gst->guest_RAX;
> + break;
> + default:
> + vg_assert(0);
> + break;
> }
> -
> - if (err) {
> - canonical->sres.isError = True;
> - canonical->sres.res = 0;
> - canonical->sres.res2 = 0;
> - canonical->sres.err = val;
> - } else {
> - canonical->sres.isError = False;
> - canonical->sres.res = val;
> - canonical->sres.res2 = val2;
> - canonical->sres.err = 0;
> - }
> + canonical->sres = VG_(mk_SysRes_amd64_darwin)(
> + gst->guest_SC_CLASS, err ? True : False,
> + wHI, wLO
> + );
> canonical->what = SsComplete;
>
> # else
> @@ -935,8 +917,7 @@
> SysRes sres = canonical->sres;
> vg_assert(canonical->what == SsComplete);
> /* Unfortunately here we have to break abstraction and look
> - directly inside 'res', in order to decide what to do. There are
> - 6 cases (yuck). */
> + directly inside 'res', in order to decide what to do. */
> switch (sres._mode) {
> case SysRes_MACH: // int $0x81 = Mach, 32-bit result
> case SysRes_MDEP: // int $0x82 = mdep, 32-bit result
> @@ -966,39 +947,35 @@
>
> #elif defined(VGP_amd64_darwin)
> VexGuestAMD64State* gst = (VexGuestAMD64State*)gst_vanilla;
> - UWord val =
> - canonical->sres.isError ? canonical->sres.err : canonical->sres.res;
> + SysRes sres = canonical->sres;
> vg_assert(canonical->what == SsComplete);
> -
> - switch (gst->guest_SC_CLASS) {
> - case VG_DARWIN_SYSCALL_CLASS_UNIX:
> - // syscall = Unix, 32-bit result
> - if (!canonical->sres.isError) gst->guest_RDX = canonical->sres.res2;
> - VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
> - OFFSET_amd64_RDX, sizeof(UWord) );
> - gst->guest_RAX = val;
> - LibVEX_GuestAMD64_put_rflag_c(canonical->sres.isError, gst);
> - VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
> - OFFSET_amd64_RAX, sizeof(UWord) );
> - // fixme sets defined for entire rflags, not just bit c
> - VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
> - offsetof(VexGuestAMD64State, guest_CC_DEP1), sizeof(ULong) );
> - break;
> - case VG_DARWIN_SYSCALL_CLASS_MACH:
> - // int $0x81 = Mach, 32-bit result
> - gst->guest_RAX = val;
> - VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
> - OFFSET_amd64_RAX, sizeof(UWord) );
> - break;
> - case VG_DARWIN_SYSCALL_CLASS_MDEP:
> - // int $0x82 = mdep, 32-bit result
> - gst->guest_RAX = val;
> - VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
> - OFFSET_amd64_RAX, sizeof(UWord) );
> - break;
> - default:
> - vg_assert(0);
> - break;
> + /* Unfortunately here we have to break abstraction and look
> + directly inside 'res', in order to decide what to do. */
> + switch (sres._mode) {
> + case SysRes_MACH: // syscall = Mach, 64-bit result
> + case SysRes_MDEP: // syscall = mdep, 64-bit result
> + gst->guest_RAX = sres._wLO;
> + VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
> + OFFSET_amd64_RAX, sizeof(ULong) );
> + break;
> + case SysRes_UNIX_OK: // syscall = Unix, 128-bit result
> + case SysRes_UNIX_ERR: // syscall = Unix, 128-bit error
> + gst->guest_RAX = sres._wLO;
> + VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
> + OFFSET_amd64_RAX, sizeof(ULong) );
> + gst->guest_RDX = sres._wHI;
> + VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
> + OFFSET_amd64_RDX, sizeof(ULong) );
> + LibVEX_GuestAMD64_put_rflag_c( sres._mode==SysRes_UNIX_ERR ? 1 : 0,
> + gst );
> + // fixme sets defined for entire rflags, not just bit c
> + // DDD: this breaks exp-ptrcheck.
> + VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
> + offsetof(VexGuestAMD64State, guest_CC_DEP1), sizeof(ULong) );
> + break;
> + default:
> + vg_assert(0);
> + break;
> }
>
> # else
>
> Modified: branches/DARWIN/coregrind/m_vki.c
> ===================================================================
> --- branches/DARWIN/coregrind/m_vki.c 2009-04-04 15:14:55 UTC (rev 9516)
> +++ branches/DARWIN/coregrind/m_vki.c 2009-04-05 10:28:46 UTC (rev 9517)
> @@ -123,7 +123,8 @@
> # endif
> }
> /* also .. */
> - /* VKI_SET_SIGMASK is hardwired into syscall-x86-darwin.S */
> + /* VKI_SET_SIGMASK is hardwired into syscall-x86-darwin.S and
> + syscall-amd64-darwin.S */
> vg_assert(VKI_SIG_SETMASK == 3);
>
> # else
>
> Modified: branches/DARWIN/coregrind/pub_core_syscall.h
> ===================================================================
> --- branches/DARWIN/coregrind/pub_core_syscall.h 2009-04-04 15:14:55 UTC (rev 9516)
> +++ branches/DARWIN/coregrind/pub_core_syscall.h 2009-04-05 10:28:46 UTC (rev 9517)
> @@ -77,7 +77,8 @@
> extern SysRes VG_(mk_SysRes_ppc64_aix5) ( ULong val, ULong err );
> extern SysRes VG_(mk_SysRes_x86_darwin) ( UChar scclass, Bool isErr,
> UInt wHI, UInt wLO );
> -//extern SysRes VG_(mk_SysRes_amd64_darwin) ( UWord val, UWord val2, UWord err );
> +extern SysRes VG_(mk_SysRes_amd64_darwin)( UChar scclass, Bool isErr,
> + ULong wHI, ULong wLO );
> extern SysRes VG_(mk_SysRes_Error) ( UWord val );
> extern SysRes VG_(mk_SysRes_Success) ( UWord val );
>
>
> Modified: branches/DARWIN/include/pub_tool_basics.h
> ===================================================================
> --- branches/DARWIN/include/pub_tool_basics.h 2009-04-04 15:14:55 UTC (rev 9516)
> +++ branches/DARWIN/include/pub_tool_basics.h 2009-04-05 10:28:46 UTC (rev 9517)
> @@ -156,8 +156,8 @@
> When _mode is SysRes_UNIX_ERR, _wHI:_wLO holds the error code.
> Probably the high word of an error is always ignored by
> userspace, but we have to record it, so that we can correctly
> - update both EDX and EAX (in guest state) given a SysRes, if
> - we're required to.
> + update both {R,E}DX and {R,E}AX (in guest state) given a SysRes,
> + if we're required to.
> */
> #if defined(VGO_linux)
> typedef
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Valgrind-developers mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-developers
|
|
From: <sv...@va...> - 2009-04-05 11:02:39
|
Author: bart
Date: 2009-04-05 12:02:29 +0100 (Sun, 05 Apr 2009)
New Revision: 9519
Log:
Fixed typo in usage instructions: replaced bin/night by bin/nightly.
Modified:
trunk/nightly/bin/nightly
Modified: trunk/nightly/bin/nightly
===================================================================
--- trunk/nightly/bin/nightly 2009-04-05 11:01:19 UTC (rev 9518)
+++ trunk/nightly/bin/nightly 2009-04-05 11:02:29 UTC (rev 9519)
@@ -41,7 +41,7 @@
#----------------------------------------------------------------------------
# Must have exactly two arguments
if [ $# -ne 2 ] ; then
- echo "usage: bin/night /path/to/valgrind/nightly <tag>"
+ echo "usage: $0 /path/to/valgrind/nightly <tag>"
exit 1
fi
|
|
From: <sv...@va...> - 2009-04-05 11:01:29
|
Author: bart
Date: 2009-04-05 12:01:19 +0100 (Sun, 05 Apr 2009)
New Revision: 9518
Log:
Updated list of bugs fixed in 3.5.0.
Modified:
trunk/NEWS
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2009-04-05 10:28:46 UTC (rev 9517)
+++ trunk/NEWS 2009-04-05 11:01:19 UTC (rev 9518)
@@ -62,6 +62,7 @@
n-i-bz DRD - added new client request, VG_USERREQ__DRD_CLEAN_MEMORY.
187048 DRD - the mutex attribute PTHREAD_PROCESS_SHARED is now
interpreted correctly.
+188046 Removed a bashism from the configure script.
|
|
From: <sv...@va...> - 2009-04-05 10:29:00
|
Author: sewardj
Date: 2009-04-05 11:28:46 +0100 (Sun, 05 Apr 2009)
New Revision: 9517
Log:
Unbreak the 64-bit build following recent SysRes/syscall hackery, so
it now builds again on 64-bit Darwin and can run small programs.
Support for syscalls interrupted by signals is still lacking, but
fixing it is mostly a case of enabling the __NR___pthread_sigmask
calls in syscall-amd64-darwin.S, fixing
ML_(fixup_guest_state_to_restart_syscall), and setting IP_AT_SYSCALL
in the Vex front end for amd64.
Modified:
branches/DARWIN/coregrind/m_signals.c
branches/DARWIN/coregrind/m_syscall.c
branches/DARWIN/coregrind/m_syswrap/syscall-amd64-darwin.S
branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
branches/DARWIN/coregrind/m_syswrap/syswrap-main.c
branches/DARWIN/coregrind/m_vki.c
branches/DARWIN/coregrind/pub_core_syscall.h
branches/DARWIN/include/pub_tool_basics.h
Modified: branches/DARWIN/coregrind/m_signals.c
===================================================================
--- branches/DARWIN/coregrind/m_signals.c 2009-04-04 15:14:55 UTC (rev 9516)
+++ branches/DARWIN/coregrind/m_signals.c 2009-04-05 10:28:46 UTC (rev 9517)
@@ -370,7 +370,8 @@
static inline Addr VG_UCONTEXT_STACK_PTR( void* ucV ) {
I_die_here;
}
- static inline SysRes VG_UCONTEXT_SYSCALL_SYSRES( void* ucV ) {
+ static inline SysRes VG_UCONTEXT_SYSCALL_SYSRES( void* ucV,
+ UWord scclass ) {
I_die_here;
}
static inline Addr VG_UCONTEXT_LINK_REG( void* ucV ) {
Modified: branches/DARWIN/coregrind/m_syscall.c
===================================================================
--- branches/DARWIN/coregrind/m_syscall.c 2009-04-04 15:14:55 UTC (rev 9516)
+++ branches/DARWIN/coregrind/m_syscall.c 2009-04-05 10:28:46 UTC (rev 9517)
@@ -192,22 +192,37 @@
return res;
}
-static SysRes mk_SysRes_amd64_darwin ( UWord val, UWord val2, UWord errflag ) {
- I_die_here;
- /*
+SysRes VG_(mk_SysRes_amd64_darwin) ( UChar scclass, Bool isErr,
+ ULong wHI, ULong wLO )
+{
SysRes res;
- res.isError = errflag != 0;
- if (res.isError) {
- res.err = val;
- res.res = 0;
- res.res2 = 0;
- } else {
- res.err = 0;
- res.res = val;
- res.res2 = val2;
+ res._wHI = 0;
+ res._wLO = 0;
+ res._mode = 0; /* invalid */
+ vg_assert(isErr == False || isErr == True);
+ vg_assert(sizeof(UWord) == sizeof(ULong));
+ switch (scclass) {
+ case VG_DARWIN_SYSCALL_CLASS_UNIX:
+ res._wLO = wLO;
+ res._wHI = wHI;
+ res._mode = isErr ? SysRes_UNIX_ERR : SysRes_UNIX_OK;
+ break;
+ case VG_DARWIN_SYSCALL_CLASS_MACH:
+ vg_assert(!isErr);
+ vg_assert(wHI == 0);
+ res._wLO = wLO;
+ res._mode = SysRes_MACH;
+ break;
+ case VG_DARWIN_SYSCALL_CLASS_MDEP:
+ vg_assert(!isErr);
+ vg_assert(wHI == 0);
+ res._wLO = wLO;
+ res._mode = SysRes_MDEP;
+ break;
+ default:
+ vg_assert(0);
}
return res;
- */
}
/* Generic constructors. We assume (without checking if this makes
@@ -559,6 +574,8 @@
Error:
* MACH,MDEP: no error is returned
* UNIX: the carry flag indicates success or failure
+
+ nb here, sizeof(UWord) == sizeof(UInt)
*/
__private_extern__ ULong
@@ -616,13 +633,15 @@
The kernel's syscall calling convention is:
* the syscall number goes in rax
* the args are passed to the syscall in registers and the stack
- * the call instruction is `syscall`
+ * the call instruction is 'syscall'
Return value:
* MACH,MDEP: the return value comes back in rax
- * UNIX: the return value comes back in rdx:rax
+ * UNIX: the return value comes back in rdx:rax (hi64:lo64)
Error:
* MACH,MDEP: no error is returned
* UNIX: the carry flag indicates success or failure
+
+ nb here, sizeof(UWord) == sizeof(ULong)
*/
__private_extern__ UWord
@@ -630,8 +649,8 @@
UWord a4, UWord a5, UWord a6, /* rcx, r8, r9 */
UWord a7, UWord a8, /* 8(rsp), 16(rsp) */
UWord syscall_no, /* 24(rsp) */
- /*OUT*/UWord *errflag, /* 32(rsp) */
- /*OUT*/UWord *res2 ); /* 40(rsp) */
+ /*OUT*/ULong* errflag, /* 32(rsp) */
+ /*OUT*/ULong* res2 ); /* 40(rsp) */
// Unix syscall: 128-bit return in rax:rdx, with LSB in rax
// error indicated by carry flag: clear=good, set=bad
asm(".private_extern _do_syscall_unix_WRK\n"
@@ -767,18 +786,16 @@
return VG_(mk_SysRes_x86_darwin)( scclass, err ? True : False, wHI, wLO );
# elif defined(VGP_amd64_darwin)
- UWord err = 0;
- UWord val = 0, val2 = 0;
+ ULong wLO = 0, wHI = 0, err = 0;
UChar scclass = VG_DARWIN_SYSNO_CLASS(sysno);
- switch (VG_DARWIN_SYSNO_CLASS(sysno)) {
+ switch (scclass) {
case VG_DARWIN_SYSCALL_CLASS_UNIX:
- case VG_DARWIN_SYSCALL_CLASS_UX64:
- val = do_syscall_unix_WRK(a1,a2,a3,a4,a5,a6,a7,a8,
- VG_DARWIN_SYSNO_NUM(sysno), &err, &val2);
+ wLO = do_syscall_unix_WRK(a1,a2,a3,a4,a5,a6,a7,a8,
+ VG_DARWIN_SYSNO_NUM(sysno), &err, &wHI);
break;
case VG_DARWIN_SYSCALL_CLASS_MACH:
case VG_DARWIN_SYSCALL_CLASS_MDEP:
- val = do_syscall_mach_WRK(a1,a2,a3,a4,a5,a6,a7,a8,
+ wLO = do_syscall_mach_WRK(a1,a2,a3,a4,a5,a6,a7,a8,
VG_DARWIN_SYSNO_NUM(sysno));
err = 0;
break;
@@ -786,8 +803,8 @@
vg_assert(0);
break;
}
- return mk_SysRes_amd64_darwin( val, val2, err );
-
+ return VG_(mk_SysRes_amd64_darwin)( scclass, err ? True : False, wHI, wLO );
+
#else
# error Unknown platform
#endif
Modified: branches/DARWIN/coregrind/m_syswrap/syscall-amd64-darwin.S
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syscall-amd64-darwin.S 2009-04-04 15:14:55 UTC (rev 9516)
+++ branches/DARWIN/coregrind/m_syswrap/syscall-amd64-darwin.S 2009-04-05 10:28:46 UTC (rev 9517)
@@ -67,11 +67,12 @@
const vki_sigset_t *sysmask, // rdx
const vki_sigset_t *postmask, // rcx
Int sigsetSzB) // r8
-
+
+ Note that sigsetSzB is totally ignored (and irrelevant).
*/
/* from vki_arch.h */
-#define VKI_SIG_SETMASK 2
+#define VKI_SIG_SETMASK 3
/* DO_SYSCALL MACH|MDEP|UNIX */
#define MACH 1
@@ -92,7 +93,7 @@
L_$0_1: /* Even though we can't take a signal until the sigprocmask completes,
start the range early.
- If eip is in the range [1,2), the syscall hasn't been started yet */
+ If rip is in the range [1,2), the syscall hasn't been started yet */
/* Set the signal mask which should be current during the syscall. */
/* GrP fixme signals
@@ -195,10 +196,6 @@
_ML_(do_syscall_for_client_unix_WRK):
DO_SYSCALL UNIX
-.globl _ML_(do_syscall_for_client_ux64_WRK)
-_ML_(do_syscall_for_client_ux64_WRK):
- jmp _ML_(do_syscall_for_client_unix_WRK)
-
.globl _ML_(do_syscall_for_client_mach_WRK)
_ML_(do_syscall_for_client_mach_WRK):
DO_SYSCALL MACH
@@ -212,18 +209,45 @@
VG_(fixup_guest_state_after_syscall_interrupted) can do the
right thing */
-/* GrP fixme wrong */
-.globl _ML_(blksys_setup)
-.globl _ML_(blksys_restart)
-.globl _ML_(blksys_complete)
-.globl _ML_(blksys_committed)
-.globl _ML_(blksys_finished)
-_ML_(blksys_setup): .quad L_1_1
-_ML_(blksys_restart): .quad L_1_2
-_ML_(blksys_complete): .quad L_1_3
-_ML_(blksys_committed): .quad L_1_4
-_ML_(blksys_finished): .quad L_1_5
+/* eg MK_L_SCLASS_N(UNIX,99) produces L_3_99
+ since UNIX is #defined to 3 at the top of this file */
+#define FOO(scclass,labelno) L_##scclass##_##labelno
+#define MK_L_SCCLASS_N(scclass,labelno) FOO(scclass,labelno)
+.globl _ML_(blksys_setup_MACH)
+.globl _ML_(blksys_restart_MACH)
+.globl _ML_(blksys_complete_MACH)
+.globl _ML_(blksys_committed_MACH)
+.globl _ML_(blksys_finished_MACH)
+_ML_(blksys_setup_MACH): .quad MK_L_SCCLASS_N(MACH,1)
+_ML_(blksys_restart_MACH): .quad MK_L_SCCLASS_N(MACH,2)
+_ML_(blksys_complete_MACH): .quad MK_L_SCCLASS_N(MACH,3)
+_ML_(blksys_committed_MACH): .quad MK_L_SCCLASS_N(MACH,4)
+_ML_(blksys_finished_MACH): .quad MK_L_SCCLASS_N(MACH,5)
+
+.globl _ML_(blksys_setup_MDEP)
+.globl _ML_(blksys_restart_MDEP)
+.globl _ML_(blksys_complete_MDEP)
+.globl _ML_(blksys_committed_MDEP)
+.globl _ML_(blksys_finished_MDEP)
+_ML_(blksys_setup_MDEP): .quad MK_L_SCCLASS_N(MDEP,1)
+_ML_(blksys_restart_MDEP): .quad MK_L_SCCLASS_N(MDEP,2)
+_ML_(blksys_complete_MDEP): .quad MK_L_SCCLASS_N(MDEP,3)
+_ML_(blksys_committed_MDEP): .quad MK_L_SCCLASS_N(MDEP,4)
+_ML_(blksys_finished_MDEP): .quad MK_L_SCCLASS_N(MDEP,5)
+
+.globl _ML_(blksys_setup_UNIX)
+.globl _ML_(blksys_restart_UNIX)
+.globl _ML_(blksys_complete_UNIX)
+.globl _ML_(blksys_committed_UNIX)
+.globl _ML_(blksys_finished_UNIX)
+_ML_(blksys_setup_UNIX): .quad MK_L_SCCLASS_N(UNIX,1)
+_ML_(blksys_restart_UNIX): .quad MK_L_SCCLASS_N(UNIX,2)
+_ML_(blksys_complete_UNIX): .quad MK_L_SCCLASS_N(UNIX,3)
+_ML_(blksys_committed_UNIX): .quad MK_L_SCCLASS_N(UNIX,4)
+_ML_(blksys_finished_UNIX): .quad MK_L_SCCLASS_N(UNIX,5)
+
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-04-04 15:14:55 UTC (rev 9516)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-04-05 10:28:46 UTC (rev 9517)
@@ -6854,7 +6854,14 @@
ThreadState *tst = VG_(get_ThreadState)(tid);
tst->os_state.pthread = ARG1;
tst->arch.vex.guest_GS_0x60 = ARG1;
- SET_STATUS_Success(0x60);
+ // SET_STATUS_Success(0x60);
+ // see comments on x86 case just above
+ SET_STATUS_from_SysRes(
+ VG_(mk_SysRes_amd64_darwin)(
+ VG_DARWIN_SYSNO_CLASS(__NR_pthread_set_self),
+ False, 0, 0x60
+ )
+ );
}
#else
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-main.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-main.c 2009-04-04 15:14:55 UTC (rev 9516)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-main.c 2009-04-05 10:28:46 UTC (rev 9517)
@@ -79,12 +79,12 @@
Mach traps: result is in r3, and there is no error flag.
ppc64 r0 r3 r4 r5 r6 r7 r8 ?? ?? r3+CR0.SO (== ARG1)
x86 eax +4 +8 +12 +16 +20 +24 +28 +32 edx:eax, eflags.c
- amd64 rax rdi rsi rdx rcx r8 r9 stk stk 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)". Apparently
- 0(%esp) is some kind of return address (perhaps for syscalls done
- with "sysenter"?) I don't think it is relevant for syscalls done
- with "int $0x80/1/2".
+ For x86-darwin, "+N" denotes "in memory at N(%esp)"; ditto
+ amd64-darwin. Apparently 0(%esp) is some kind of return address
+ (perhaps for syscalls done with "sysenter"?) I don't think it is
+ relevant for syscalls done with "int $0x80/1/2".
*/
/* This is the top level of the system-call handler module. All
@@ -595,7 +595,7 @@
canonical->arg7 = stack[2];
canonical->arg8 = stack[3];
- PRINT("SYSCALL[%d,?](%5lld) syscall(#%x, ...); please stand by...\n",
+ PRINT("SYSCALL[%d,?](%5lld) syscall(#%lx, ...); please stand by...\n",
VG_(getpid)(), /*tid,*/ (Long)0,
VG_DARWIN_SYSNO_PRINT(canonical->sysno));
}
@@ -787,53 +787,35 @@
canonical->what = SsComplete;
# elif defined(VGP_amd64_darwin)
+ /* duplicates logic in m_signals.VG_UCONTEXT_SYSCALL_SYSRES */
VexGuestAMD64State* gst = (VexGuestAMD64State*)gst_vanilla;
- UInt carry = 1 & LibVEX_GuestAMD64_get_rflags(gst);
- UInt err;
- UWord val;
- UWord val2;
-
+ ULong carry = 1 & LibVEX_GuestAMD64_get_rflags(gst);
+ ULong err = 0;
+ ULong wLO = 0;
+ ULong wHI = 0;
switch (gst->guest_SC_CLASS) {
- case VG_DARWIN_SYSCALL_CLASS_UX64:
- // int $0x80 = Unix, 128-bit result
- err = carry;
- val = gst->guest_RAX;
- val2 = gst->guest_RDX;
- break;
- case VG_DARWIN_SYSCALL_CLASS_UNIX:
- // syscall = Unix, 64-bit result
- err = carry;
- val = gst->guest_RAX;
- val2 = 0;
- break;
- case VG_DARWIN_SYSCALL_CLASS_MACH:
- // int $0x81 = Mach, 64-bit result
- err = 0;
- val = gst->guest_RAX;
- val2 = 0;
- break;
- case VG_DARWIN_SYSCALL_CLASS_MDEP:
- // int $0x82 = mdep, 64-bit result
- err = 0;
- val = gst->guest_RAX;
- val2 = 0;
- break;
- default:
- vg_assert(0);
- break;
+ case VG_DARWIN_SYSCALL_CLASS_UNIX:
+ // syscall = Unix, 128-bit result
+ err = carry;
+ wLO = gst->guest_RAX;
+ wHI = gst->guest_RDX;
+ break;
+ case VG_DARWIN_SYSCALL_CLASS_MACH:
+ // syscall = Mach, 64-bit result
+ wLO = gst->guest_RAX;
+ break;
+ case VG_DARWIN_SYSCALL_CLASS_MDEP:
+ // syscall = mdep, 64-bit result
+ wLO = gst->guest_RAX;
+ break;
+ default:
+ vg_assert(0);
+ break;
}
-
- if (err) {
- canonical->sres.isError = True;
- canonical->sres.res = 0;
- canonical->sres.res2 = 0;
- canonical->sres.err = val;
- } else {
- canonical->sres.isError = False;
- canonical->sres.res = val;
- canonical->sres.res2 = val2;
- canonical->sres.err = 0;
- }
+ canonical->sres = VG_(mk_SysRes_amd64_darwin)(
+ gst->guest_SC_CLASS, err ? True : False,
+ wHI, wLO
+ );
canonical->what = SsComplete;
# else
@@ -935,8 +917,7 @@
SysRes sres = canonical->sres;
vg_assert(canonical->what == SsComplete);
/* Unfortunately here we have to break abstraction and look
- directly inside 'res', in order to decide what to do. There are
- 6 cases (yuck). */
+ directly inside 'res', in order to decide what to do. */
switch (sres._mode) {
case SysRes_MACH: // int $0x81 = Mach, 32-bit result
case SysRes_MDEP: // int $0x82 = mdep, 32-bit result
@@ -966,39 +947,35 @@
#elif defined(VGP_amd64_darwin)
VexGuestAMD64State* gst = (VexGuestAMD64State*)gst_vanilla;
- UWord val =
- canonical->sres.isError ? canonical->sres.err : canonical->sres.res;
+ SysRes sres = canonical->sres;
vg_assert(canonical->what == SsComplete);
-
- switch (gst->guest_SC_CLASS) {
- case VG_DARWIN_SYSCALL_CLASS_UNIX:
- // syscall = Unix, 32-bit result
- if (!canonical->sres.isError) gst->guest_RDX = canonical->sres.res2;
- VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
- OFFSET_amd64_RDX, sizeof(UWord) );
- gst->guest_RAX = val;
- LibVEX_GuestAMD64_put_rflag_c(canonical->sres.isError, gst);
- VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
- OFFSET_amd64_RAX, sizeof(UWord) );
- // fixme sets defined for entire rflags, not just bit c
- VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
- offsetof(VexGuestAMD64State, guest_CC_DEP1), sizeof(ULong) );
- break;
- case VG_DARWIN_SYSCALL_CLASS_MACH:
- // int $0x81 = Mach, 32-bit result
- gst->guest_RAX = val;
- VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
- OFFSET_amd64_RAX, sizeof(UWord) );
- break;
- case VG_DARWIN_SYSCALL_CLASS_MDEP:
- // int $0x82 = mdep, 32-bit result
- gst->guest_RAX = val;
- VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
- OFFSET_amd64_RAX, sizeof(UWord) );
- break;
- default:
- vg_assert(0);
- break;
+ /* Unfortunately here we have to break abstraction and look
+ directly inside 'res', in order to decide what to do. */
+ switch (sres._mode) {
+ case SysRes_MACH: // syscall = Mach, 64-bit result
+ case SysRes_MDEP: // syscall = mdep, 64-bit result
+ gst->guest_RAX = sres._wLO;
+ VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
+ OFFSET_amd64_RAX, sizeof(ULong) );
+ break;
+ case SysRes_UNIX_OK: // syscall = Unix, 128-bit result
+ case SysRes_UNIX_ERR: // syscall = Unix, 128-bit error
+ gst->guest_RAX = sres._wLO;
+ VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
+ OFFSET_amd64_RAX, sizeof(ULong) );
+ gst->guest_RDX = sres._wHI;
+ VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
+ OFFSET_amd64_RDX, sizeof(ULong) );
+ LibVEX_GuestAMD64_put_rflag_c( sres._mode==SysRes_UNIX_ERR ? 1 : 0,
+ gst );
+ // fixme sets defined for entire rflags, not just bit c
+ // DDD: this breaks exp-ptrcheck.
+ VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
+ offsetof(VexGuestAMD64State, guest_CC_DEP1), sizeof(ULong) );
+ break;
+ default:
+ vg_assert(0);
+ break;
}
# else
Modified: branches/DARWIN/coregrind/m_vki.c
===================================================================
--- branches/DARWIN/coregrind/m_vki.c 2009-04-04 15:14:55 UTC (rev 9516)
+++ branches/DARWIN/coregrind/m_vki.c 2009-04-05 10:28:46 UTC (rev 9517)
@@ -123,7 +123,8 @@
# endif
}
/* also .. */
- /* VKI_SET_SIGMASK is hardwired into syscall-x86-darwin.S */
+ /* VKI_SET_SIGMASK is hardwired into syscall-x86-darwin.S and
+ syscall-amd64-darwin.S */
vg_assert(VKI_SIG_SETMASK == 3);
# else
Modified: branches/DARWIN/coregrind/pub_core_syscall.h
===================================================================
--- branches/DARWIN/coregrind/pub_core_syscall.h 2009-04-04 15:14:55 UTC (rev 9516)
+++ branches/DARWIN/coregrind/pub_core_syscall.h 2009-04-05 10:28:46 UTC (rev 9517)
@@ -77,7 +77,8 @@
extern SysRes VG_(mk_SysRes_ppc64_aix5) ( ULong val, ULong err );
extern SysRes VG_(mk_SysRes_x86_darwin) ( UChar scclass, Bool isErr,
UInt wHI, UInt wLO );
-//extern SysRes VG_(mk_SysRes_amd64_darwin) ( UWord val, UWord val2, UWord err );
+extern SysRes VG_(mk_SysRes_amd64_darwin)( UChar scclass, Bool isErr,
+ ULong wHI, ULong wLO );
extern SysRes VG_(mk_SysRes_Error) ( UWord val );
extern SysRes VG_(mk_SysRes_Success) ( UWord val );
Modified: branches/DARWIN/include/pub_tool_basics.h
===================================================================
--- branches/DARWIN/include/pub_tool_basics.h 2009-04-04 15:14:55 UTC (rev 9516)
+++ branches/DARWIN/include/pub_tool_basics.h 2009-04-05 10:28:46 UTC (rev 9517)
@@ -156,8 +156,8 @@
When _mode is SysRes_UNIX_ERR, _wHI:_wLO holds the error code.
Probably the high word of an error is always ignored by
userspace, but we have to record it, so that we can correctly
- update both EDX and EAX (in guest state) given a SysRes, if
- we're required to.
+ update both {R,E}DX and {R,E}AX (in guest state) given a SysRes,
+ if we're required to.
*/
#if defined(VGO_linux)
typedef
|
|
From: Bart V. A. <bar...@gm...> - 2009-04-05 08:31:11
|
Nightly build on georgia-tech-cellbuzz-native ( cellbuzz, ppc64, Fedora 7, native ) started at 2009-04-05 02:00:01 EDT Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... done Regression test results follow == 407 tests, 36 stderr failures, 9 stdout failures, 0 post failures == exp-ptrcheck/tests/bad_percentify (stderr) exp-ptrcheck/tests/base (stderr) exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/fp (stderr) exp-ptrcheck/tests/globalerr (stderr) exp-ptrcheck/tests/hackedbz2 (stderr) exp-ptrcheck/tests/hp_bounds (stderr) exp-ptrcheck/tests/hp_dangle (stderr) exp-ptrcheck/tests/justify (stderr) exp-ptrcheck/tests/partial_bad (stderr) exp-ptrcheck/tests/partial_good (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) exp-ptrcheck/tests/realloc (stderr) exp-ptrcheck/tests/stackerr (stderr) exp-ptrcheck/tests/strcpy (stderr) exp-ptrcheck/tests/supp (stderr) exp-ptrcheck/tests/tricky (stderr) exp-ptrcheck/tests/unaligned (stderr) exp-ptrcheck/tests/zero (stderr) helgrind/tests/hg05_race2 (stderr) memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cases-full (stderr) memcheck/tests/leak-cases-summary (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/origin5-bz2 (stderr) memcheck/tests/varinfo1 (stderr) memcheck/tests/varinfo2 (stderr) memcheck/tests/varinfo3 (stderr) memcheck/tests/varinfo4 (stderr) memcheck/tests/varinfo5 (stderr) memcheck/tests/varinfo6 (stderr) memcheck/tests/wrap8 (stderr) none/tests/linux/mremap (stderr) none/tests/linux/mremap2 (stdout) none/tests/ppc32/jm-fp (stdout) none/tests/ppc32/jm-vmx (stdout) none/tests/ppc32/round (stdout) none/tests/ppc32/test_gx (stdout) none/tests/ppc64/jm-fp (stdout) none/tests/ppc64/jm-vmx (stdout) none/tests/ppc64/round (stdout) none/tests/shell_valid2 (stderr) none/tests/shell_valid3 (stderr) |
|
From: Tom H. <th...@cy...> - 2009-04-05 03:04:59
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2009-04-05 03:05:08 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 478 tests, 4 stderr failures, 0 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) |
|
From: Tom H. <th...@cy...> - 2009-04-05 02:47:10
|
Nightly build on mg ( x86_64, Fedora 9 ) started at 2009-04-05 03:10:05 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 484 tests, 4 stderr failures, 1 stdout failure, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) none/tests/linux/mremap2 (stdout) |
|
From: <sv...@va...> - 2009-04-04 15:15:03
|
Author: bart
Date: 2009-04-04 16:14:55 +0100 (Sat, 04 Apr 2009)
New Revision: 9516
Log:
Generalized a suppression pattern.
Modified:
trunk/glibc-2.X-drd.supp
Modified: trunk/glibc-2.X-drd.supp
===================================================================
--- trunk/glibc-2.X-drd.supp 2009-04-04 14:36:51 UTC (rev 9515)
+++ trunk/glibc-2.X-drd.supp 2009-04-04 15:14:55 UTC (rev 9516)
@@ -336,7 +336,6 @@
fun:_ZN14QReadWriteLock12lockForWriteEv
fun:_ZN14QObjectPrivate11clearGuardsEP7QObject
fun:_ZN7QObjectD2Ev
- fun:_ZN20QEventDispatcherGlibD0Ev
}
{
libQtCore-QObjectPrivate::clearGuards(QObject*)
|
|
From: <sv...@va...> - 2009-04-04 14:37:03
|
Author: bart
Date: 2009-04-04 15:36:51 +0100 (Sat, 04 Apr 2009)
New Revision: 9515
Log:
Fixed bug #188046: replaced a bashism by a POSIX compliant shell statement.
Modified:
trunk/configure.in
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2009-04-04 10:21:19 UTC (rev 9514)
+++ trunk/configure.in 2009-04-04 14:36:51 UTC (rev 9515)
@@ -67,7 +67,7 @@
# If no AR variable was specified, look up the name of the archiver. Otherwise
# do not touch the AR variable.
if test "x$AR" = "x"; then
- AC_PATH_PROGS([AR], ["${LD%ld}ar" "ar"], [ar])
+ AC_PATH_PROGS([AR], [`echo $LD | sed 's/ld$/ar/'` "ar"], [ar])
fi
AC_ARG_VAR([AR],[Archiver command])
|
|
From: <sv...@va...> - 2009-04-04 10:21:32
|
Author: sewardj
Date: 2009-04-04 11:21:19 +0100 (Sat, 04 Apr 2009)
New Revision: 9514
Log:
Non-functional changes for VG_(sync_mappings) and associated fns:
- break long lines & misc formatting changes
- keep track of number of calls to VG_(sync_mappings) and
mach_vm_region_recurse, and optionally print them
- remove unused global var "sync_mapping_num"
Modified:
branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c
Modified: branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c
===================================================================
--- branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c 2009-04-03 20:15:56 UTC (rev 9513)
+++ branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c 2009-04-04 10:21:19 UTC (rev 9514)
@@ -3319,6 +3319,8 @@
((vm_prot & VM_PROT_EXECUTE) ? VKI_PROT_EXEC : 0) ;
}
+static UInt stats_machcalls = 0;
+
static void
parse_procselfmaps (
void (*record_mapping)( Addr addr, SizeT len, UInt prot,
@@ -3341,10 +3343,13 @@
kern_return_t kr;
while (1) {
- mach_msg_type_number_t info_count = VM_REGION_SUBMAP_SHORT_INFO_COUNT_64;
+ mach_msg_type_number_t info_count
+ = VM_REGION_SUBMAP_SHORT_INFO_COUNT_64;
+ stats_machcalls++;
kr = mach_vm_region_recurse(mach_task_self(), &addr, &size, &depth,
(vm_region_info_t)&info, &info_count);
- if (kr) return;
+ if (kr)
+ return;
if (info.is_submap) {
depth++;
continue;
@@ -3369,11 +3374,11 @@
// GrP hack
-extern void ML_(notify_aspacem_and_tool_of_mmap) ( Addr a, SizeT len, UInt prot, UInt flags, Int fd, Off64T offset );
+extern void ML_(notify_aspacem_and_tool_of_mmap)
+ ( Addr a, SizeT len, UInt prot, UInt flags, Int fd, Off64T offset );
extern void ML_(notify_aspacem_and_tool_of_munmap) ( Addr a, SizeT len );
static const HChar *sync_mapping_when;
static const HChar *sync_mapping_where;
-static Int sync_mapping_num;
static void add_mapping_callback(Addr addr, SizeT len, UInt prot,
ULong dev, ULong ino, Off64T offset,
const UChar *filename)
@@ -3404,30 +3409,34 @@
else if (nsegments[i].kind == SkFree || nsegments[i].kind == SkResvn) {
/* Add mapping for SkResvn regions */
if (VG_(clo_trace_syscalls))
- VG_(debugLog)(0,"aspacem","\nadded region %p..%p at %s:%d (%s)",
+ VG_(debugLog)(0,"aspacem","\nadded region %p..%p at %s (%s)",
(void*)addr, (void*)(addr+len),
- sync_mapping_where, sync_mapping_num, sync_mapping_when);
+ sync_mapping_where,
+ sync_mapping_when);
ML_(notify_aspacem_and_tool_of_mmap)
(addr, len, prot, VKI_MAP_PRIVATE, 0, offset);
return;
}
- else if (nsegments[i].kind == SkAnonC || nsegments[i].kind == SkFileC || nsegments[i].kind == SkShmC) {
+ else if (nsegments[i].kind == SkAnonC || nsegments[i].kind == SkFileC
+ || nsegments[i].kind == SkShmC) {
/* Check permissions on client regions */
// fixme
seg_prot = 0;
if (nsegments[i].hasR) seg_prot |= VKI_PROT_READ;
if (nsegments[i].hasW) seg_prot |= VKI_PROT_WRITE;
-#if defined(VGA_x86)
+# if defined(VGA_x86)
// fixme sloppyXcheck
// darwin: kernel X ignored and spuriously changes? (vm_copy)
seg_prot |= (prot & VKI_PROT_EXEC);
-#else
+# else
if (nsegments[i].hasX) seg_prot |= VKI_PROT_EXEC;
-#endif
+# endif
if (seg_prot != prot) {
if (VG_(clo_trace_syscalls))
- VG_(debugLog)(0,"aspacem","\nregion %p..%p permission mismatch (kernel %x, V %x)",
- (void*)nsegments[i].start, (void*)(nsegments[i].end+1), prot, seg_prot);
+ VG_(debugLog)(0,"aspacem","\nregion %p..%p permission "
+ "mismatch (kernel %x, V %x)",
+ (void*)nsegments[i].start,
+ (void*)(nsegments[i].end+1), prot, seg_prot);
}
}
else {
@@ -3457,9 +3466,12 @@
if (nsegments[i].kind != SkFree && nsegments[i].kind != SkResvn) {
// V has a mapping, kernel doesn't
if (VG_(clo_trace_syscalls))
- VG_(debugLog)(0,"aspacem","\nremoved region 0x%010llx..0x%010llx at %s:%d (%s)",
- (ULong)nsegments[i].start, (ULong)(nsegments[i].end+1),
- sync_mapping_where, sync_mapping_num, sync_mapping_when);
+ VG_(debugLog)(0,"aspacem","\nremoved region 0x%010llx..0x%010llx"
+ " at %s (%s)",
+ (ULong)nsegments[i].start,
+ (ULong)(nsegments[i].end+1),
+ sync_mapping_where,
+ sync_mapping_when);
ML_(notify_aspacem_and_tool_of_munmap)
(nsegments[i].start, 1+(nsegments[i].end-nsegments[i].start));
return;
@@ -3470,10 +3482,15 @@
void VG_(sync_mappings)(const HChar *when, const HChar *where, Int num)
{
- sync_mapping_when = when ?: "?";
- sync_mapping_where = where ?: "?";
- sync_mapping_num = 0;
- parse_procselfmaps(&add_mapping_callback, &remove_mapping_callback);
+ static UInt stats_synccalls = 1;
+ sync_mapping_when = when ?: "?";
+ sync_mapping_where = where ?: "?";
+ parse_procselfmaps(&add_mapping_callback, &remove_mapping_callback);
+ if (0)
+ VG_(debugLog)(0,"aspacem",
+ "[%u,%u] VG_(sync_mappings)(%s, %s, %d)\n",
+ stats_synccalls++, stats_machcalls, when, where, num
+ );
}
|
|
From: Bart V. A. <bar...@gm...> - 2009-04-04 08:21:29
|
Nightly build on georgia-tech-cellbuzz-native ( cellbuzz, ppc64, Fedora 7, native ) started at 2009-04-04 02:00:01 EDT Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... done Regression test results follow == 407 tests, 36 stderr failures, 9 stdout failures, 0 post failures == exp-ptrcheck/tests/bad_percentify (stderr) exp-ptrcheck/tests/base (stderr) exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/fp (stderr) exp-ptrcheck/tests/globalerr (stderr) exp-ptrcheck/tests/hackedbz2 (stderr) exp-ptrcheck/tests/hp_bounds (stderr) exp-ptrcheck/tests/hp_dangle (stderr) exp-ptrcheck/tests/justify (stderr) exp-ptrcheck/tests/partial_bad (stderr) exp-ptrcheck/tests/partial_good (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) exp-ptrcheck/tests/realloc (stderr) exp-ptrcheck/tests/stackerr (stderr) exp-ptrcheck/tests/strcpy (stderr) exp-ptrcheck/tests/supp (stderr) exp-ptrcheck/tests/tricky (stderr) exp-ptrcheck/tests/unaligned (stderr) exp-ptrcheck/tests/zero (stderr) helgrind/tests/hg05_race2 (stderr) memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cases-full (stderr) memcheck/tests/leak-cases-summary (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/origin5-bz2 (stderr) memcheck/tests/varinfo1 (stderr) memcheck/tests/varinfo2 (stderr) memcheck/tests/varinfo3 (stderr) memcheck/tests/varinfo4 (stderr) memcheck/tests/varinfo5 (stderr) memcheck/tests/varinfo6 (stderr) memcheck/tests/wrap8 (stderr) none/tests/linux/mremap (stderr) none/tests/linux/mremap2 (stdout) none/tests/ppc32/jm-fp (stdout) none/tests/ppc32/jm-vmx (stdout) none/tests/ppc32/round (stdout) none/tests/ppc32/test_gx (stdout) none/tests/ppc64/jm-fp (stdout) none/tests/ppc64/jm-vmx (stdout) none/tests/ppc64/round (stdout) none/tests/shell_valid2 (stderr) none/tests/shell_valid3 (stderr) |
|
From: Tom H. <th...@cy...> - 2009-04-04 03:05:44
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2009-04-04 03:05:05 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 478 tests, 4 stderr failures, 0 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) |
|
From: Tom H. <th...@cy...> - 2009-04-04 02:47:24
|
Nightly build on mg ( x86_64, Fedora 9 ) started at 2009-04-04 03:10:05 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 484 tests, 4 stderr failures, 1 stdout failure, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) none/tests/linux/mremap2 (stdout) |
|
From: <sv...@va...> - 2009-04-03 20:16:34
|
Author: sewardj
Date: 2009-04-03 21:15:56 +0100 (Fri, 03 Apr 2009)
New Revision: 9513
Log:
Another suppression.
Modified:
branches/DARWIN/darwin9.supp
Modified: branches/DARWIN/darwin9.supp
===================================================================
--- branches/DARWIN/darwin9.supp 2009-04-03 19:40:46 UTC (rev 9512)
+++ branches/DARWIN/darwin9.supp 2009-04-03 20:15:56 UTC (rev 9513)
@@ -41,6 +41,15 @@
}
{
+ 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
|
|
From: <sv...@va...> - 2009-04-03 19:41:26
|
Author: sewardj
Date: 2009-04-03 20:40:46 +0100 (Fri, 03 Apr 2009)
New Revision: 9512
Log:
Handle sys_sigreturn in an extremely kludgey and broken way; but at least
there's some documentation about what it is and how to do better.
Modified:
branches/DARWIN/coregrind/m_syswrap/priv_syswrap-darwin.h
branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
branches/DARWIN/coregrind/m_syswrap/syswrap-x86-darwin.c
branches/DARWIN/include/vki/vki-darwin.h
Modified: branches/DARWIN/coregrind/m_syswrap/priv_syswrap-darwin.h
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/priv_syswrap-darwin.h 2009-04-02 07:19:25 UTC (rev 9511)
+++ branches/DARWIN/coregrind/m_syswrap/priv_syswrap-darwin.h 2009-04-03 19:40:46 UTC (rev 9512)
@@ -145,6 +145,7 @@
DECL_TEMPLATE(darwin, sys_ioctl);
DECL_TEMPLATE(darwin, sys_futimes);
DECL_TEMPLATE(darwin, sys_FAKE_SIGRETURN);
+DECL_TEMPLATE(darwin, sys_sigreturn);
// Mach message helpers
DECL_TEMPLATE(darwin, host_info);
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-04-02 07:19:25 UTC (rev 9511)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-04-03 19:40:46 UTC (rev 9512)
@@ -6693,6 +6693,7 @@
an explanation of what follows. */
/* This handles the fake signal-return system call created by
sigframe-x86-darwin.c. */
+ /* See also comments just below on PRE(sys_sigreturn). */
PRINT("FAKE_SIGRETURN ( )");
@@ -6714,6 +6715,82 @@
}
+PRE(sys_sigreturn)
+{
+ /* This is the "real" sigreturn. But because we construct all the
+ signal frames ourselves (of course, in m_sigframe), this cannot
+ happen as a result of normal signal delivery. I think it
+ happens only when doing siglongjmp, in which case Darwin's Libc
+ appears to use it for two different purposes: to mess with the
+ per-thread sigaltstack flags (as per arg 2), or to restore the
+ thread's state from a ucontext* (as per arg 1). */
+
+ PRINT("sigreturn ( uctx=%#lx, infostyle=%#lx )", ARG1, ARG2);
+
+ vg_assert(VG_(is_valid_tid)(tid));
+ vg_assert(tid >= 1 && tid < VG_N_THREADS);
+ vg_assert(VG_(is_running_thread)(tid));
+
+ if (ARG2 == VKI_UC_SET_ALT_STACK) {
+ /* This is confusing .. the darwin kernel sources imply there is
+ a per-thread on-altstack/not-on-altstack flag, which is set
+ by this flag. Just ignore it and claim success for the time
+ being. */
+ VG_(debugLog)(0, "syswrap-darwin",
+ "WARNING: Ignoring sys_sigreturn( ..., "
+ "UC_SET_ALT_STACK );\n");
+ SET_STATUS_Success(0);
+ return;
+ }
+ if (ARG2 == VKI_UC_RESET_ALT_STACK) {
+ /* Ditto */
+ VG_(debugLog)(0, "syswrap-darwin",
+ "WARNING: Ignoring sys_sigreturn( ..., "
+ "UC_RESET_ALT_STACK );\n");
+ SET_STATUS_Success(0);
+ return;
+ }
+
+ /* Otherwise claim this isn't supported. (Could be
+ catastrophic).
+
+ What do we have to do if we do need to support it?
+
+ 1. Change the second argument of VG_(sigframe_destroy) from
+ "Bool isRT" to "UInt sysno", so we can pass the syscall
+ number, so it can distinguish this case from the
+ __NR_DARWIN_FAKE_SIGRETURN case.
+
+ 2. In VG_(sigframe_destroy), look at sysno to distinguish the
+ cases. For __NR_DARWIN_FAKE_SIGRETURN, behave as at present.
+ For this case, restore the thread's CPU state (or at least
+ the integer regs) from the ucontext in ARG1 (and do all the
+ other "signal-returns" stuff too).
+
+ 3. For (2), how do we know where the ucontext is? One way is to
+ temporarily copy ARG1 into this thread's guest_EBX (or any
+ other int reg), and have VG_(sigframe_destroy) read
+ guest_EBX. Why is it ok to trash guest_EBX (or any other int
+ reg)? Because VG_(sigframe_destroy) is just about to
+ overwrite all the regs anyway -- since the primary purpose of
+ calling it is to restore the register state from the ucontext
+ pointed to by ARG1.
+
+ Hey, it's uggerly. But at least it's documented.
+ */
+ /* But in the meantime ... */
+ VG_(debugLog)(0, "syswrap-darwin",
+ "WARNING: Ignoring sys_sigreturn( uctx=..., 0 );\n");
+ VG_(debugLog)(0, "syswrap-darwin",
+ "WARNING: Thread/program/Valgrind "
+ "will likely segfault now.\n");
+ VG_(debugLog)(0, "syswrap-darwin",
+ "WARNING: Please file a bug report at "
+ "http://www.valgrind.org.\n");
+ SET_STATUS_Failure( VKI_ENOSYS );
+}
+
+
/* ---------------------------------------------------------------------
machine-dependent traps
------------------------------------------------------------------ */
@@ -6991,7 +7068,7 @@
GENX_(__NR_setgid, sys_setgid),
MACX_(__NR_setegid, sys_setegid),
MACX_(__NR_seteuid, sys_seteuid),
-// _____(__NR_sigreturn),
+ MACX_(__NR_sigreturn, sys_sigreturn),
// _____(__NR_chud),
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(186)), // ???
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(187)), // ???
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-x86-darwin.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-x86-darwin.c 2009-04-02 07:19:25 UTC (rev 9511)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-x86-darwin.c 2009-04-03 19:40:46 UTC (rev 9512)
@@ -46,7 +46,6 @@
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
#include "pub_core_scheduler.h"
-#include "pub_core_sigframe.h" // For VG_(sigframe_destroy)()
#include "pub_core_signals.h"
#include "pub_core_syscall.h"
#include "pub_core_syswrap.h"
Modified: branches/DARWIN/include/vki/vki-darwin.h
===================================================================
--- branches/DARWIN/include/vki/vki-darwin.h 2009-04-02 07:19:25 UTC (rev 9511)
+++ branches/DARWIN/include/vki/vki-darwin.h 2009-04-03 19:40:46 UTC (rev 9512)
@@ -504,7 +504,10 @@
#define VKI_SA_ONESHOT SA_RESETHAND
#define VKI_SA_NOMASK SA_NODEFER
+#define VKI_UC_SET_ALT_STACK 0x40000000
+#define VKI_UC_RESET_ALT_STACK 0x80000000
+
#include <sys/errno.h>
#define VKI_EPERM EPERM
|
|
From: Bart V. A. <bar...@gm...> - 2009-04-03 08:21:06
|
Nightly build on georgia-tech-cellbuzz-native ( cellbuzz, ppc64, Fedora 7, native ) started at 2009-04-03 02:00:02 EDT Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... done Regression test results follow == 407 tests, 36 stderr failures, 9 stdout failures, 0 post failures == exp-ptrcheck/tests/bad_percentify (stderr) exp-ptrcheck/tests/base (stderr) exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/fp (stderr) exp-ptrcheck/tests/globalerr (stderr) exp-ptrcheck/tests/hackedbz2 (stderr) exp-ptrcheck/tests/hp_bounds (stderr) exp-ptrcheck/tests/hp_dangle (stderr) exp-ptrcheck/tests/justify (stderr) exp-ptrcheck/tests/partial_bad (stderr) exp-ptrcheck/tests/partial_good (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) exp-ptrcheck/tests/realloc (stderr) exp-ptrcheck/tests/stackerr (stderr) exp-ptrcheck/tests/strcpy (stderr) exp-ptrcheck/tests/supp (stderr) exp-ptrcheck/tests/tricky (stderr) exp-ptrcheck/tests/unaligned (stderr) exp-ptrcheck/tests/zero (stderr) helgrind/tests/hg05_race2 (stderr) memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cases-full (stderr) memcheck/tests/leak-cases-summary (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/origin5-bz2 (stderr) memcheck/tests/varinfo1 (stderr) memcheck/tests/varinfo2 (stderr) memcheck/tests/varinfo3 (stderr) memcheck/tests/varinfo4 (stderr) memcheck/tests/varinfo5 (stderr) memcheck/tests/varinfo6 (stderr) memcheck/tests/wrap8 (stderr) none/tests/linux/mremap (stderr) none/tests/linux/mremap2 (stdout) none/tests/ppc32/jm-fp (stdout) none/tests/ppc32/jm-vmx (stdout) none/tests/ppc32/round (stdout) none/tests/ppc32/test_gx (stdout) none/tests/ppc64/jm-fp (stdout) none/tests/ppc64/jm-vmx (stdout) none/tests/ppc64/round (stdout) none/tests/shell_valid2 (stderr) none/tests/shell_valid3 (stderr) |
|
From: Tom H. <th...@cy...> - 2009-04-03 03:04:39
|
Nightly build on vauxhall ( x86_64, Fedora 10 ) started at 2009-04-03 03:20:05 BST
Results differ from 24 hours ago
Checking out valgrind source tree ... done
Configuring valgrind ... done
Building valgrind ... done
Running regression tests ... failed
Regression test results follow
== 487 tests, 1 stderr failure, 0 stdout failures, 0 post failures ==
drd/tests/qt4_mutex (stderr)
=================================================
== Results from 24 hours ago ==
=================================================
Checking out valgrind source tree ... done
Configuring valgrind ... done
Building valgrind ... done
Running regression tests ... done
Regression test results follow
== 487 tests, 0 stderr failures, 0 stdout failures, 0 post failures ==
=================================================
== Difference between 24 hours ago and now ==
=================================================
*** old.short Fri Apr 3 03:42:09 2009
--- new.short Fri Apr 3 04:04:18 2009
***************
*** 4,6 ****
Building valgrind ... done
! Running regression tests ... done
--- 4,6 ----
Building valgrind ... done
! Running regression tests ... failed
***************
*** 8,10 ****
! == 487 tests, 0 stderr failures, 0 stdout failures, 0 post failures ==
--- 8,11 ----
! == 487 tests, 1 stderr failure, 0 stdout failures, 0 post failures ==
! drd/tests/qt4_mutex (stderr)
|
|
From: Tom H. <th...@cy...> - 2009-04-03 03:03:14
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2009-04-03 03:05:04 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 478 tests, 4 stderr failures, 0 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) |
|
From: Tom H. <th...@cy...> - 2009-04-03 02:47:22
|
Nightly build on mg ( x86_64, Fedora 9 ) started at 2009-04-03 03:10:05 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 484 tests, 4 stderr failures, 1 stdout failure, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) none/tests/linux/mremap2 (stdout) |
|
From: Filipe C. <fi...@gm...> - 2009-04-02 17:59:30
|
Done and uploaded. Thanks :-) F Greg Parker wrote: > On Apr 2, 2009, at 6:45 AM, Filipe Cabecinhas wrote: >> +// These constants aren't in a standard header... >> +// I got them from the latest kernel sources: >> +// xnu-1228.3.13 - Mac OS X 10.5.6 - Darwin 9.6 >> +#define VKI_CS_OPS_STATUS 0 /* return status */ >> +#define VKI_CS_OPS_MARKINVALID 1 /* invalidate process */ >> +#define VKI_CS_OPS_MARKHARD 2 /* set HARD flag */ >> +#define VKI_CS_OPS_MARKKILL 3 /* set KILL flag (sticky) */ >> +#define VKI_CS_OPS_PIDPATH 4 /* get executable's >> pathname */ >> +#define VKI_CS_OPS_CDHASH 5 /* get code directory >> hash */ > > You should include the kernel file you found them in: > // xnu-1228.3.13/bsd/sys/codesign.h > > |
|
From: Greg P. <gp...@ap...> - 2009-04-02 17:30:51
|
On Apr 2, 2009, at 6:45 AM, Filipe Cabecinhas wrote: > +// These constants aren't in a standard header... > +// I got them from the latest kernel sources: > +// xnu-1228.3.13 - Mac OS X 10.5.6 - Darwin 9.6 > +#define VKI_CS_OPS_STATUS 0 /* return status */ > +#define VKI_CS_OPS_MARKINVALID 1 /* invalidate process */ > +#define VKI_CS_OPS_MARKHARD 2 /* set HARD flag */ > +#define VKI_CS_OPS_MARKKILL 3 /* set KILL flag > (sticky) */ > +#define VKI_CS_OPS_PIDPATH 4 /* get executable's > pathname */ > +#define VKI_CS_OPS_CDHASH 5 /* get code directory > hash */ You should include the kernel file you found them in: // xnu-1228.3.13/bsd/sys/codesign.h -- Greg Parker gp...@ap... Runtime Wrangler |
|
From: Filipe C. <fi...@gm...> - 2009-04-02 13:46:00
|
Sorry, forgot to svn update. Now it applies cleanly :-) (But this mail can be useless because when you come back the source may have already changed again) Regards, F Nicholas Nethercote wrote: > On Thu, Apr 2, 2009 at 4:25 AM, Filipe Cabecinhas <fi...@gm...> wrote: >> Hi, >> >> First of all... valgrind can now run iTunes :-) >> Patch: >> http://web.ist.utl.pt/~filipe.cabecinhas/patches/valgrind-F_ADDSIGS-csops.patch > > That's great, thanks. I'll look at it and commit when I get back from > vacation, should be about 2 weeks from now. > > Nick |
|
From: Nicholas N. <n.n...@gm...> - 2009-04-02 12:16:38
|
On Thu, Apr 2, 2009 at 4:25 AM, Filipe Cabecinhas <fi...@gm...> wrote: > Hi, > > First of all... valgrind can now run iTunes :-) > Patch: > http://web.ist.utl.pt/~filipe.cabecinhas/patches/valgrind-F_ADDSIGS-csops.patch That's great, thanks. I'll look at it and commit when I get back from vacation, should be about 2 weeks from now. Nick |
|
From: Filipe C. <fi...@gm...> - 2009-04-02 09:25:32
|
Hi, First of all... valgrind can now run iTunes :-) Patch: http://web.ist.utl.pt/~filipe.cabecinhas/patches/valgrind-F_ADDSIGS-csops.patch There were two missing system calls where valgrind bombed out: fcntl(F_ADDSIGS) - add detached signatures csops(...) - code signing operations (syscall number 169) The fcntl is there to add a signature that, instead of being in the executable file, resides in a separate file. the csops() syscall performs various operations on a process: - query the process' status - mark the process as invalid, set HARD or KILL flag - get the executable's pathname - get the code directory hash Attached is a small test program for the various operations (that used to bomb out with valgrind). It receives a PID as argument (if it's called with no arguments it just analyses itself) and performs the query operations (STATUS, PIDPATH and CDHASH). Superuser permissions are necessary. To try out the various flags start, for example, an md5 program (you can check that it's signed using "codesign -vvvv `which md5`"), and query the flags (it should have flag 0x1, meaning that it's valid). Mark the processa as KILL if invalid and then mark it as invalid to see it get killed by the system. iTunes would add the signatures and, when the KILL flag was set using csops(), kill itself. I implemented csops() to do a no-op when passed a MARK* operation. I didn't keep track of the marks but I guess we could do that. I don't know if it's possible to redirect the F_ADDSIGS parameter that says which code is signed so we could keep the program valid (if that original code isn't touched by valgrind), but that would be nice (and stealthy :-) ). Regards, F Example: I run md5 in a terminal and it sits idle waiting for input. In another terminal: [filcab@farnsworth ~/Desktop] $ sudo ./a 10874 errno: 0, res: 0, status: 1 (0x1) errno: 0, res: 0, path: /sbin/md5 errno: 0, res: 0, hash: 690e1b75356209a6b171860339387a836ea45df3 ### I change a.c to mark the process as KILL before the query ops [filcab@farnsworth ~/Desktop] $ make a && sudo ./a 10874 cc a.c -o a errno: 0, res: 0 errno: 0, res: 0, status: 513 (0x201) errno: 0, res: 0, path: /sbin/md5 errno: 0, res: 0, hash: 690e1b75356209a6b171860339387a836ea45df3 ### I change a.c to mark the process as invalid before the query ops ### errno 3 == No such process [filcab@farnsworth ~/Desktop] $ make a && sudo ./a 10874 cc a.c -o a errno: 0, res: 0 errno: 3, res: 4294967295, status: 0 (0) errno: 3, res: 4294967295, path: errno: 3, res: 4294967295, hash: 0000000000000000000000000000000000000000 [filcab@farnsworth ~/Desktop] $ |
|
From: Bart V. A. <bar...@gm...> - 2009-04-02 08:20:53
|
Nightly build on georgia-tech-cellbuzz-native ( cellbuzz, ppc64, Fedora 7, native ) started at 2009-04-02 02:00:02 EDT Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... done Regression test results follow == 407 tests, 36 stderr failures, 9 stdout failures, 0 post failures == exp-ptrcheck/tests/bad_percentify (stderr) exp-ptrcheck/tests/base (stderr) exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/fp (stderr) exp-ptrcheck/tests/globalerr (stderr) exp-ptrcheck/tests/hackedbz2 (stderr) exp-ptrcheck/tests/hp_bounds (stderr) exp-ptrcheck/tests/hp_dangle (stderr) exp-ptrcheck/tests/justify (stderr) exp-ptrcheck/tests/partial_bad (stderr) exp-ptrcheck/tests/partial_good (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) exp-ptrcheck/tests/realloc (stderr) exp-ptrcheck/tests/stackerr (stderr) exp-ptrcheck/tests/strcpy (stderr) exp-ptrcheck/tests/supp (stderr) exp-ptrcheck/tests/tricky (stderr) exp-ptrcheck/tests/unaligned (stderr) exp-ptrcheck/tests/zero (stderr) helgrind/tests/hg05_race2 (stderr) memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cases-full (stderr) memcheck/tests/leak-cases-summary (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/origin5-bz2 (stderr) memcheck/tests/varinfo1 (stderr) memcheck/tests/varinfo2 (stderr) memcheck/tests/varinfo3 (stderr) memcheck/tests/varinfo4 (stderr) memcheck/tests/varinfo5 (stderr) memcheck/tests/varinfo6 (stderr) memcheck/tests/wrap8 (stderr) none/tests/linux/mremap (stderr) none/tests/linux/mremap2 (stdout) none/tests/ppc32/jm-fp (stdout) none/tests/ppc32/jm-vmx (stdout) none/tests/ppc32/round (stdout) none/tests/ppc32/test_gx (stdout) none/tests/ppc64/jm-fp (stdout) none/tests/ppc64/jm-vmx (stdout) none/tests/ppc64/round (stdout) none/tests/shell_valid2 (stderr) none/tests/shell_valid3 (stderr) |