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
(4) |
2
(17) |
3
(9) |
4
(14) |
5
(10) |
6
(11) |
7
(8) |
|
8
(9) |
9
(11) |
10
(29) |
11
(27) |
12
(29) |
13
(36) |
14
(8) |
|
15
(18) |
16
(30) |
17
(25) |
18
(6) |
19
(16) |
20
(13) |
21
(10) |
|
22
(16) |
23
(7) |
24
(8) |
25
(13) |
26
(14) |
27
(14) |
28
(5) |
|
29
(6) |
30
(21) |
31
(14) |
|
|
|
|
|
From: <sv...@va...> - 2009-03-22 13:28:50
|
Author: sewardj
Date: 2009-03-22 13:28:44 +0000 (Sun, 22 Mar 2009)
New Revision: 9490
Log:
Fix compilation on VGP_ppc32_linux and VGP_ppc64_linux following
changes over the past couple of weeks.
Modified:
branches/DARWIN/coregrind/m_machine.c
branches/DARWIN/coregrind/m_syswrap/priv_types_n_macros.h
branches/DARWIN/coregrind/m_syswrap/syswrap-main.c
branches/DARWIN/coregrind/m_syswrap/syswrap-ppc32-linux.c
branches/DARWIN/coregrind/m_syswrap/syswrap-ppc64-linux.c
branches/DARWIN/exp-ptrcheck/h_main.c
branches/DARWIN/include/vki/vki-ppc32-linux.h
branches/DARWIN/include/vki/vki-ppc64-linux.h
branches/DARWIN/include/vki/vki-x86-linux.h
branches/DARWIN/memcheck/mc_machine.c
Modified: branches/DARWIN/coregrind/m_machine.c
===================================================================
--- branches/DARWIN/coregrind/m_machine.c 2009-03-22 12:36:32 UTC (rev 9489)
+++ branches/DARWIN/coregrind/m_machine.c 2009-03-22 13:28:44 UTC (rev 9490)
@@ -402,12 +402,20 @@
{ /* ppc32 doesn't seem to have a sane way to find out what insn
sets the CPU supports. So we have to arse around with
SIGILLs. Yuck. */
- vki_sigset_t saved_set, tmp_set;
- struct vki_sigaction saved_act, tmp_act;
+ vki_sigset_t saved_set, tmp_set;
+ vki_sigaction_fromK_t saved_act;
+ vki_sigaction_toK_t tmp_act;
volatile Bool have_F, have_V, have_FX, have_GX;
Int r;
+ /* This is a kludge. Really we ought to back-convert saved_act
+ into a toK_t using VG_(convert_sigaction_fromK_to_toK), but
+ since that's a no-op on all ppc32 platforms so far supported,
+ it's not worth the typing effort. At least include most basic
+ sanity check: */
+ vg_assert(sizeof(vki_sigaction_fromK_t) == sizeof(vki_sigaction_toK_t));
+
VG_(sigemptyset)(&tmp_set);
VG_(sigaddset)(&tmp_set, VKI_SIGILL);
@@ -508,17 +516,28 @@
#elif defined(VGA_ppc64)
{ /* Same idiocy as for ppc32 - arse around with SIGILLs. */
- vki_sigset_t saved_set, tmp_set;
- struct vki_sigaction saved_act, tmp_act;
+ vki_sigset_t saved_set, tmp_set;
+ vki_sigaction_fromK_t saved_act;
+ vki_sigaction_toK_t tmp_act;
volatile Bool have_F, have_V, have_FX, have_GX;
+ Int r;
+ /* This is a kludge. Really we ought to back-convert saved_act
+ into a toK_t using VG_(convert_sigaction_fromK_to_toK), but
+ since that's a no-op on all ppc64 platforms so far supported,
+ it's not worth the typing effort. At least include most basic
+ sanity check: */
+ vg_assert(sizeof(vki_sigaction_fromK_t) == sizeof(vki_sigaction_toK_t));
+
VG_(sigemptyset)(&tmp_set);
VG_(sigaddset)(&tmp_set, VKI_SIGILL);
- VG_(sigprocmask)(VKI_SIG_UNBLOCK, &tmp_set, &saved_set);
+ r = VG_(sigprocmask)(VKI_SIG_UNBLOCK, &tmp_set, &saved_set);
+ vg_assert(r == 0);
- VG_(sigaction)(VKI_SIGILL, NULL, &saved_act);
+ r = VG_(sigaction)(VKI_SIGILL, NULL, &saved_act);
+ vg_assert(r == 0);
tmp_act = saved_act;
/* NODEFER: signal handler does not return (from the kernel's point of
@@ -531,7 +550,8 @@
/* standard FP insns */
have_F = True;
tmp_act.ksa_handler = handler_sigill;
- VG_(sigaction)(VKI_SIGILL, &tmp_act, NULL);
+ r = VG_(sigaction)(VKI_SIGILL, &tmp_act, NULL);
+ vg_assert(r == 0);
if (__builtin_setjmp(env_sigill)) {
have_F = False;
} else {
@@ -541,7 +561,8 @@
/* Altivec insns */
have_V = True;
tmp_act.ksa_handler = handler_sigill;
- VG_(sigaction)(VKI_SIGILL, &tmp_act, NULL);
+ r = VG_(sigaction)(VKI_SIGILL, &tmp_act, NULL);
+ vg_assert(r == 0);
if (__builtin_setjmp(env_sigill)) {
have_V = False;
} else {
@@ -551,7 +572,8 @@
/* General-Purpose optional (fsqrt, fsqrts) */
have_FX = True;
tmp_act.ksa_handler = handler_sigill;
- VG_(sigaction)(VKI_SIGILL, &tmp_act, NULL);
+ r = VG_(sigaction)(VKI_SIGILL, &tmp_act, NULL);
+ vg_assert(r == 0);
if (__builtin_setjmp(env_sigill)) {
have_FX = False;
} else {
@@ -561,15 +583,18 @@
/* Graphics optional (stfiwx, fres, frsqrte, fsel) */
have_GX = True;
tmp_act.ksa_handler = handler_sigill;
- VG_(sigaction)(VKI_SIGILL, &tmp_act, NULL);
+ r = VG_(sigaction)(VKI_SIGILL, &tmp_act, NULL);
+ vg_assert(r == 0);
if (__builtin_setjmp(env_sigill)) {
have_GX = False;
} else {
__asm__ __volatile__(".long 0xFC000034"); /*frsqrte 0,0*/
}
- VG_(sigaction)(VKI_SIGILL, &saved_act, NULL);
- VG_(sigprocmask)(VKI_SIG_SETMASK, &saved_set, NULL);
+ r = VG_(sigaction)(VKI_SIGILL, &saved_act, NULL);
+ vg_assert(r == 0);
+ r = VG_(sigprocmask)(VKI_SIG_SETMASK, &saved_set, NULL);
+ vg_assert(r == 0);
/*
if (0)
VG_(printf)("F %d V %d FX %d GX %d\n",
Modified: branches/DARWIN/coregrind/m_syswrap/priv_types_n_macros.h
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/priv_types_n_macros.h 2009-03-22 12:36:32 UTC (rev 9489)
+++ branches/DARWIN/coregrind/m_syswrap/priv_types_n_macros.h 2009-03-22 13:28:44 UTC (rev 9490)
@@ -87,17 +87,18 @@
// the vex register state. For stack arguments (which have s_arg
// field names), the s_arg value is the offset from the stack pointer.
Int o_sysno;
-#if defined(VGP_x86_linux) || defined(VGP_amd64_linux)
+# if defined(VGP_x86_linux) || defined(VGP_amd64_linux) \
+ || defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
Int o_arg1;
Int o_arg2;
Int o_arg3;
Int o_arg4;
Int o_arg5;
Int o_arg6;
- Int dummy_arg7;
- Int dummy_arg8;
+ Int uu_arg7;
+ Int uu_arg8;
Int o_retval;
-#elif defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+# elif defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
Int o_arg1;
Int o_arg2;
Int o_arg3;
@@ -107,7 +108,7 @@
Int o_arg7;
Int o_arg8;
Int o_retval;
-#elif defined(VGP_x86_darwin)
+# elif defined(VGP_x86_darwin)
Int s_arg1;
Int s_arg2;
Int s_arg3;
@@ -118,7 +119,7 @@
Int s_arg8;
Int o_retval_lo;
Int o_retval_hi;
-#elif defined(VGP_amd64_darwin)
+# elif defined(VGP_amd64_darwin)
Int o_arg1;
Int o_arg2;
Int o_arg3;
@@ -129,9 +130,9 @@
Int s_arg8;
Int o_retval_lo;
Int o_retval_hi;
-#else
-# error Unknown platform
-#endif
+# else
+# error "Unknown platform"
+# endif
}
SyscallArgLayout;
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-main.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-main.c 2009-03-22 12:36:32 UTC (rev 9489)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-main.c 2009-03-22 13:28:44 UTC (rev 9490)
@@ -878,14 +878,14 @@
VexGuestPPC32State* gst = (VexGuestPPC32State*)gst_vanilla;
UInt old_cr = LibVEX_GuestPPC32_get_CR(gst);
vg_assert(canonical->what == SsComplete);
- if (canonical->sres.isError) {
+ if (sr_isError(canonical->sres)) {
/* set CR0.SO */
LibVEX_GuestPPC32_put_CR( old_cr | (1<<28), gst );
- gst->guest_GPR3 = canonical->sres.err;
+ gst->guest_GPR3 = sr_Err(canonical->sres);
} else {
/* clear CR0.SO */
LibVEX_GuestPPC32_put_CR( old_cr & ~(1<<28), gst );
- gst->guest_GPR3 = canonical->sres.res;
+ gst->guest_GPR3 = sr_Res(canonical->sres);
}
VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
OFFSET_ppc32_GPR3, sizeof(UWord) );
@@ -896,14 +896,14 @@
VexGuestPPC64State* gst = (VexGuestPPC64State*)gst_vanilla;
UInt old_cr = LibVEX_GuestPPC64_get_CR(gst);
vg_assert(canonical->what == SsComplete);
- if (canonical->sres.isError) {
+ if (sr_isError(canonical->sres)) {
/* set CR0.SO */
LibVEX_GuestPPC64_put_CR( old_cr | (1<<28), gst );
- gst->guest_GPR3 = canonical->sres.err;
+ gst->guest_GPR3 = sr_Err(canonical->sres);
} else {
/* clear CR0.SO */
LibVEX_GuestPPC64_put_CR( old_cr & ~(1<<28), gst );
- gst->guest_GPR3 = canonical->sres.res;
+ gst->guest_GPR3 = sr_Res(canonical->sres);
}
VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
OFFSET_ppc64_GPR3, sizeof(UWord) );
@@ -1022,8 +1022,8 @@
layout->o_arg4 = OFFSET_x86_ESI;
layout->o_arg5 = OFFSET_x86_EDI;
layout->o_arg6 = OFFSET_x86_EBP;
- layout->dummy_arg7 = -1; /* impossible value */
- layout->dummy_arg8 = -1; /* impossible value */
+ layout->uu_arg7 = -1; /* impossible value */
+ layout->uu_arg8 = -1; /* impossible value */
layout->o_retval = OFFSET_x86_EAX;
#elif defined(VGP_amd64_linux)
@@ -1034,8 +1034,8 @@
layout->o_arg4 = OFFSET_amd64_R10;
layout->o_arg5 = OFFSET_amd64_R8;
layout->o_arg6 = OFFSET_amd64_R9;
- layout->dummy_arg7 = -1; /* impossible value */
- layout->dummy_arg8 = -1; /* impossible value */
+ layout->uu_arg7 = -1; /* impossible value */
+ layout->uu_arg8 = -1; /* impossible value */
layout->o_retval = OFFSET_amd64_RAX;
#elif defined(VGP_ppc32_linux)
@@ -1046,8 +1046,8 @@
layout->o_arg4 = OFFSET_ppc32_GPR6;
layout->o_arg5 = OFFSET_ppc32_GPR7;
layout->o_arg6 = OFFSET_ppc32_GPR8;
- layout->o_arg7 = -1; /* impossible value */
- layout->o_arg8 = -1; /* impossible value */
+ layout->uu_arg7 = -1; /* impossible value */
+ layout->uu_arg8 = -1; /* impossible value */
layout->o_retval = OFFSET_ppc32_GPR3;
#elif defined(VGP_ppc64_linux)
@@ -1058,8 +1058,8 @@
layout->o_arg4 = OFFSET_ppc64_GPR6;
layout->o_arg5 = OFFSET_ppc64_GPR7;
layout->o_arg6 = OFFSET_ppc64_GPR8;
- layout->o_arg7 = -1; /* impossible value */
- layout->o_arg8 = -1; /* impossible value */
+ layout->uu_arg7 = -1; /* impossible value */
+ layout->uu_arg8 = -1; /* impossible value */
layout->o_retval = OFFSET_ppc64_GPR3;
#elif defined(VGP_ppc32_aix5)
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-ppc32-linux.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-ppc32-linux.c 2009-03-22 12:36:32 UTC (rev 9489)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-ppc32-linux.c 2009-03-22 13:28:44 UTC (rev 9490)
@@ -349,7 +349,7 @@
VG_(sigprocmask)(VKI_SIG_SETMASK, &savedmask, NULL);
out:
- if (res.isError) {
+ if (sr_isError(res)) {
/* clone failed */
VG_(cleanup_thread)(&ctst->arch);
ctst->status = VgTs_Empty;
@@ -1379,8 +1379,8 @@
}
PRE(sys_sigaction)
{
- struct vki_sigaction new, old;
- struct vki_sigaction *newp, *oldp;
+ vki_sigaction_toK_t new, *newp;
+ vki_sigaction_fromK_t old, *oldp;
PRINT("sys_sigaction ( %ld, %#lx, %#lx )", ARG1,ARG2,ARG3);
PRE_REG_READ3(int, "sigaction",
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-ppc64-linux.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-ppc64-linux.c 2009-03-22 12:36:32 UTC (rev 9489)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-ppc64-linux.c 2009-03-22 13:28:44 UTC (rev 9490)
@@ -379,7 +379,7 @@
VG_(sigprocmask)(VKI_SIG_SETMASK, &savedmask, NULL);
out:
- if (res.isError) {
+ if (sr_isError(res)) {
/* clone failed */
VG_(cleanup_thread)(&ctst->arch);
ctst->status = VgTs_Empty;
Modified: branches/DARWIN/exp-ptrcheck/h_main.c
===================================================================
--- branches/DARWIN/exp-ptrcheck/h_main.c 2009-03-22 12:36:32 UTC (rev 9489)
+++ branches/DARWIN/exp-ptrcheck/h_main.c 2009-03-22 13:28:44 UTC (rev 9490)
@@ -1533,7 +1533,7 @@
if (o == GOF(LR) && is4) goto exactly1;
if (o == GOF(CTR) && is4) goto exactly1;
if (o == GOF(CIA) && is4) goto none;
- if (o == GOF(CIA_AT_SC) && is4) goto none;
+ if (o == GOF(IP_AT_SYSCALL) && is4) goto none;
if (o == GOF(RESVN) && is4) goto none;
if (o == GOF(TISTART) && is4) goto none;
if (o == GOF(TILEN) && is4) goto none;
@@ -1697,7 +1697,7 @@
if (o == GOF(LR) && is8) goto exactly1;
if (o == GOF(CTR) && is8) goto exactly1;
if (o == GOF(CIA) && is8) goto none;
- if (o == GOF(CIA_AT_SC) && is8) goto none;
+ if (o == GOF(IP_AT_SYSCALL) && is8) goto none;
if (o == GOF(RESVN) && is8) goto none;
if (o == GOF(TISTART) && is8) goto none;
if (o == GOF(TILEN) && is8) goto none;
Modified: branches/DARWIN/include/vki/vki-ppc32-linux.h
===================================================================
--- branches/DARWIN/include/vki/vki-ppc32-linux.h 2009-03-22 12:36:32 UTC (rev 9489)
+++ branches/DARWIN/include/vki/vki-ppc32-linux.h 2009-03-22 13:28:44 UTC (rev 9490)
@@ -154,6 +154,10 @@
#define VKI_SS_ONSTACK 1
#define VKI_SS_DISABLE 2
+/* These are 'legacy' sigactions in which the size of sa_mask is fixed
+ (cannot be expanded at any future point) because it is sandwiched
+ between two other fields.
+ (there is identical kludgery in vki-x86-linux.h) */
struct vki_old_sigaction {
// [[Nb: a 'k' prefix is added to "sa_handler" because
// bits/sigaction.h (which gets dragged in somehow via signal.h)
@@ -165,7 +169,7 @@
__vki_sigrestore_t sa_restorer;
};
-struct vki_sigaction {
+struct vki_sigaction_base {
// [[See comment about extra 'k' above]]
__vki_sighandler_t ksa_handler;
unsigned long sa_flags;
@@ -173,6 +177,12 @@
vki_sigset_t sa_mask; /* mask last for extensibility */
};
+/* On Linux we use the same type for passing sigactions to
+ and from the kernel. Hence: */
+typedef struct vki_sigaction_base vki_sigaction_toK_t;
+typedef struct vki_sigaction_base vki_sigaction_fromK_t;
+
+
typedef struct vki_sigaltstack {
void __user *ss_sp;
int ss_flags;
Modified: branches/DARWIN/include/vki/vki-ppc64-linux.h
===================================================================
--- branches/DARWIN/include/vki/vki-ppc64-linux.h 2009-03-22 12:36:32 UTC (rev 9489)
+++ branches/DARWIN/include/vki/vki-ppc64-linux.h 2009-03-22 13:28:44 UTC (rev 9490)
@@ -164,13 +164,19 @@
__vki_sigrestore_t sa_restorer;
};
-struct vki_sigaction {
+struct vki_sigaction_base {
__vki_sighandler_t ksa_handler;
unsigned long sa_flags;
__vki_sigrestore_t sa_restorer;
vki_sigset_t sa_mask; /* mask last for extensibility */
};
+/* On Linux we use the same type for passing sigactions to
+ and from the kernel. Hence: */
+typedef struct vki_sigaction_base vki_sigaction_toK_t;
+typedef struct vki_sigaction_base vki_sigaction_fromK_t;
+
+
typedef struct vki_sigaltstack {
void __user *ss_sp;
int ss_flags;
Modified: branches/DARWIN/include/vki/vki-x86-linux.h
===================================================================
--- branches/DARWIN/include/vki/vki-x86-linux.h 2009-03-22 12:36:32 UTC (rev 9489)
+++ branches/DARWIN/include/vki/vki-x86-linux.h 2009-03-22 13:28:44 UTC (rev 9490)
@@ -151,7 +151,8 @@
/* These are 'legacy' sigactions in which the size of sa_mask is fixed
(cannot be expanded at any future point) because it is sandwiched
- between two other fields. */
+ between two other fields.
+ (there is identical kludgery in vki-ppc32-linux.h) */
struct vki_old_sigaction {
// [[Nb: a 'k' prefix is added to "sa_handler" because
// bits/sigaction.h (which gets dragged in somehow via signal.h)
Modified: branches/DARWIN/memcheck/mc_machine.c
===================================================================
--- branches/DARWIN/memcheck/mc_machine.c 2009-03-22 12:36:32 UTC (rev 9489)
+++ branches/DARWIN/memcheck/mc_machine.c 2009-03-22 13:28:44 UTC (rev 9490)
@@ -181,7 +181,7 @@
if (o == GOF(CTR) && sz == 8) return o;
if (o == GOF(CIA) && sz == 8) return -1;
- if (o == GOF(CIA_AT_SC) && sz == 8) return -1;
+ if (o == GOF(IP_AT_SYSCALL) && sz == 8) return -1;
if (o == GOF(RESVN) && sz == 8) return -1;
if (o == GOF(FPROUND) && sz == 4) return -1;
if (o == GOF(EMWARN) && sz == 4) return -1;
@@ -340,7 +340,7 @@
if (o == GOF(CTR) && sz == 4) return o;
if (o == GOF(CIA) && sz == 4) return -1;
- if (o == GOF(CIA_AT_SC) && sz == 4) return -1;
+ if (o == GOF(IP_AT_SYSCALL) && sz == 4) return -1;
if (o == GOF(RESVN) && sz == 4) return -1;
if (o == GOF(FPROUND) && sz == 4) return -1;
if (o == GOF(VRSAVE) && sz == 4) return -1;
|
|
From: <sv...@va...> - 2009-03-22 12:36:39
|
Author: sewardj
Date: 2009-03-22 12:36:32 +0000 (Sun, 22 Mar 2009)
New Revision: 9489
Log:
Unbreak the build on VGO_linux following r9485.
Modified:
branches/DARWIN/coregrind/m_libcfile.c
branches/DARWIN/coregrind/m_libcproc.c
Modified: branches/DARWIN/coregrind/m_libcfile.c
===================================================================
--- branches/DARWIN/coregrind/m_libcfile.c 2009-03-22 12:10:18 UTC (rev 9488)
+++ branches/DARWIN/coregrind/m_libcfile.c 2009-03-22 12:36:32 UTC (rev 9489)
@@ -108,20 +108,34 @@
SysRes VG_(open) ( const Char* pathname, Int flags, Int mode )
{
+# if defined(VGO_darwin)
SysRes res = VG_(do_syscall3)(__NR_open_nocancel,
(UWord)pathname, flags, mode);
+# else
+ SysRes res = VG_(do_syscall3)(__NR_open,
+ (UWord)pathname, flags, mode);
+# endif
return res;
}
void VG_(close) ( Int fd )
{
+ /* Hmm. Return value is not checked. That's uncool. */
+# if defined(VGO_darwin)
(void)VG_(do_syscall1)(__NR_close_nocancel, fd);
+# else
+ (void)VG_(do_syscall1)(__NR_close, fd);
+# endif
}
Int VG_(read) ( Int fd, void* buf, Int count)
{
Int ret;
+# if defined(VGO_darwin)
SysRes res = VG_(do_syscall3)(__NR_read_nocancel, fd, (UWord)buf, count);
+# else
+ SysRes res = VG_(do_syscall3)(__NR_read, fd, (UWord)buf, count);
+# endif
if (sr_isError(res)) {
ret = - (Int)(Word)sr_Err(res);
vg_assert(ret < 0);
@@ -135,7 +149,11 @@
Int VG_(write) ( Int fd, const void* buf, Int count)
{
Int ret;
+# if defined(VGO_darwin)
SysRes res = VG_(do_syscall3)(__NR_write_nocancel, fd, (UWord)buf, count);
+# else
+ SysRes res = VG_(do_syscall3)(__NR_write, fd, (UWord)buf, count);
+# endif
if (sr_isError(res)) {
ret = - (Int)(Word)sr_Err(res);
vg_assert(ret < 0);
@@ -149,9 +167,15 @@
Int VG_(select) ( Int nfds, void *rfds, void *wfds, void *efds, void *timeout)
{
Int ret;
+# if defined(VGO_darwin)
SysRes res = VG_(do_syscall5)(__NR_select_nocancel, nfds,
(Addr)rfds, (Addr)wfds,
(Addr)efds, (Addr)timeout);
+# else
+ SysRes res = VG_(do_syscall5)(__NR_select, nfds,
+ (Addr)rfds, (Addr)wfds,
+ (Addr)efds, (Addr)timeout);
+# endif
if (sr_isError(res)) {
ret = - (Int)(Word)sr_Err(res);
vg_assert(ret < 0);
@@ -350,7 +374,11 @@
/* Returns -1 on error. */
Int VG_(fcntl) ( Int fd, Int cmd, Addr arg )
{
+# if defined(VGO_darwin)
SysRes res = VG_(do_syscall3)(__NR_fcntl_nocancel, fd, cmd, arg);
+# else
+ SysRes res = VG_(do_syscall3)(__NR_fcntl, fd, cmd, arg);
+# endif
return sr_isError(res) ? -1 : sr_Res(res);
}
Modified: branches/DARWIN/coregrind/m_libcproc.c
===================================================================
--- branches/DARWIN/coregrind/m_libcproc.c 2009-03-22 12:10:18 UTC (rev 9488)
+++ branches/DARWIN/coregrind/m_libcproc.c 2009-03-22 12:36:32 UTC (rev 9489)
@@ -257,7 +257,11 @@
Int VG_(waitpid)(Int pid, Int *status, Int options)
{
-# if defined(VGO_linux) || defined(VGO_darwin)
+# if defined(VGO_linux)
+ SysRes res = VG_(do_syscall4)(__NR_wait4,
+ pid, (UWord)status, options, 0);
+ return sr_isError(res) ? -1 : sr_Res(res);
+# elif defined(VGO_darwin)
SysRes res = VG_(do_syscall4)(__NR_wait4_nocancel,
pid, (UWord)status, options, 0);
return sr_isError(res) ? -1 : sr_Res(res);
|
|
From: <sv...@va...> - 2009-03-22 12:10:23
|
Author: sewardj
Date: 2009-03-22 12:10:18 +0000 (Sun, 22 Mar 2009)
New Revision: 9488
Log:
Another supp, for a use of sys_futimes. Perhaps my wrapper for it is
wrong, but I don't see how.
Modified:
branches/DARWIN/darwin9.supp
Modified: branches/DARWIN/darwin9.supp
===================================================================
--- branches/DARWIN/darwin9.supp 2009-03-22 11:31:13 UTC (rev 9487)
+++ branches/DARWIN/darwin9.supp 2009-03-22 12:10:18 UTC (rev 9488)
@@ -70,3 +70,12 @@
obj:/System/Library/Frameworks/OpenGL*
obj:/System/Library/Frameworks/OpenGL*
}
+
+{
+ futimes-1
+ Memcheck:Param
+ futimes(tvp[1])
+ fun:futimes
+ obj:/usr/lib/libSystem*
+ obj:/usr/lib/libSystem*
+}
|
|
From: <sv...@va...> - 2009-03-22 11:31:28
|
Author: sewardj Date: 2009-03-22 11:31:13 +0000 (Sun, 22 Mar 2009) New Revision: 9487 Log: Build Memcheck on Darwin non-PIC. This gives a significant speedup, 10% or more for perf/bz2.c, according to very nonscientific testing. Really ought to build the entire system like this if it gives no problems. Modified: branches/DARWIN/memcheck/Makefile.am Modified: branches/DARWIN/memcheck/Makefile.am =================================================================== --- branches/DARWIN/memcheck/Makefile.am 2009-03-22 11:29:40 UTC (rev 9486) +++ branches/DARWIN/memcheck/Makefile.am 2009-03-22 11:31:13 UTC (rev 9487) @@ -161,7 +161,7 @@ memcheck_x86_darwin_SOURCES = $(MEMCHECK_SOURCES_COMMON) memcheck_x86_darwin_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -memcheck_x86_darwin_CFLAGS = $(AM_CFLAGS_X86_DARWIN) -O2 +memcheck_x86_darwin_CFLAGS = $(AM_CFLAGS_X86_DARWIN) -O2 -mdynamic-no-pic memcheck_x86_darwin_CCASFLAGS = $(AM_CCASFLAGS_X86_DARWIN) memcheck_x86_darwin_DEPENDENCIES = $(COREGRIND_LIBS_X86_DARWIN) memcheck_x86_darwin_LDADD = $(TOOL_LDADD_X86_DARWIN) |
|
From: <sv...@va...> - 2009-03-22 11:29:54
|
Author: sewardj
Date: 2009-03-22 11:29:40 +0000 (Sun, 22 Mar 2009)
New Revision: 9486
Log:
Remove the Darwin semaphore-based locking scheme and use the standard
pipe one instead. This only works correctly on Darwin following
r9485. Also, re-inline ML_(sema_fork_child).
Modified:
branches/DARWIN/coregrind/m_scheduler/priv_sema.h
branches/DARWIN/coregrind/m_scheduler/scheduler.c
branches/DARWIN/coregrind/m_scheduler/sema.c
Modified: branches/DARWIN/coregrind/m_scheduler/priv_sema.h
===================================================================
--- branches/DARWIN/coregrind/m_scheduler/priv_sema.h 2009-03-22 11:18:03 UTC (rev 9485)
+++ branches/DARWIN/coregrind/m_scheduler/priv_sema.h 2009-03-22 11:29:40 UTC (rev 9486)
@@ -31,7 +31,6 @@
#ifndef __PRIV_SEMA_H
#define __PRIV_SEMA_H
-#if defined(VGO_linux) || defined(VGO_aix5)
/* Not really a semaphore, but use a pipe for a token-passing scheme */
typedef struct {
Int pipe[2];
@@ -39,23 +38,12 @@
Bool held_as_LL; /* if held, True == held by a _LL call */
} vg_sema_t;
-#elif defined(VGO_darwin)
-typedef struct {
- semaphore_t lock;
- Bool held_as_LL; /* if held, True == held by a _LL call */
-} vg_sema_t;
-
-#else
-# error Unknown OS
-#endif
-
// Nb: this may be OS-specific, but let's not factor it out until we
// implement an OS port for which this isn't ok.
void ML_(sema_init) ( vg_sema_t *sema );
void ML_(sema_deinit) ( vg_sema_t *sema );
void ML_(sema_down) ( vg_sema_t *sema, Bool as_LL );
void ML_(sema_up) ( vg_sema_t *sema, Bool as_LL );
-void ML_(sema_fork_child)(vg_sema_t *sema);
#endif // __PRIV_SEMA_H
Modified: branches/DARWIN/coregrind/m_scheduler/scheduler.c
===================================================================
--- branches/DARWIN/coregrind/m_scheduler/scheduler.c 2009-03-22 11:18:03 UTC (rev 9485)
+++ branches/DARWIN/coregrind/m_scheduler/scheduler.c 2009-03-22 11:29:40 UTC (rev 9486)
@@ -324,7 +324,7 @@
"get_thread_out_of_syscall zaps tid %d lwp %d",
tid, VG_(threads)[tid].os_state.lwpid);
}
-# if VGO_darwin
+# if defined(VGO_darwin)
{
// GrP fixme use mach primitives on darwin?
// GrP fixme thread_abort_safely?
@@ -480,7 +480,10 @@
}
}
- ML_(sema_fork_child)(&the_BigLock);
+ /* re-init and take the sema */
+ ML_(sema_deinit)(&the_BigLock);
+ ML_(sema_init)(&the_BigLock);
+ ML_(sema_down)(&the_BigLock, False/*not LL*/);
}
Modified: branches/DARWIN/coregrind/m_scheduler/sema.c
===================================================================
--- branches/DARWIN/coregrind/m_scheduler/sema.c 2009-03-22 11:18:03 UTC (rev 9485)
+++ branches/DARWIN/coregrind/m_scheduler/sema.c 2009-03-22 11:29:40 UTC (rev 9486)
@@ -36,7 +36,6 @@
#include "pub_core_libcproc.h" // For VG_(gettid)()
#include "priv_sema.h"
-#if defined(VGO_linux) || defined(VGO_aix5)
/*
Slower (than the removed futex-based sema scheme) but more portable
pipe-based token passing scheme.
@@ -88,7 +87,7 @@
}
/* get a token */
-void ML_(sema_down)(vg_sema_t *sema)
+void ML_(sema_down)( vg_sema_t *sema, Bool as_LL )
{
Char buf[2];
Int ret;
@@ -115,13 +114,15 @@
if (sema_char == 'Z') sema_char = 'A'; else sema_char++;
sema->owner_lwpid = lwpid;
+ sema->held_as_LL = as_LL;
}
/* put token back */
-void ML_(sema_up)(vg_sema_t *sema)
+void ML_(sema_up)( vg_sema_t *sema, Bool as_LL )
{
Int ret;
Char buf[2];
+ vg_assert(as_LL == sema->held_as_LL);
buf[0] = sema_char;
buf[1] = 0;
vg_assert(sema->owner_lwpid != -1); /* must be initialised */
@@ -139,67 +140,6 @@
vg_assert(ret == 1);
}
-void ML_(sema_fork_child)(vg_sema_t *sema)
-{
- /* re-init and take the sema */
- ML_(sema_deinit)(sema);
- ML_(sema_init)(sema);
- ML_(sema_down)(sema, False/*not LL*/);
-}
-
-#elif defined(VGO_darwin)
-
-#include <mach/mach.h>
-#include <mach/task.h>
-#include <mach/semaphore.h>
-
-// GrP fixme being paranoid costs a lot of thread_self_trap calls
-
-void ML_(sema_init)(vg_sema_t *sema)
-{
- kern_return_t kr;
- kr = semaphore_create(mach_task_self(), &sema->lock, SYNC_POLICY_FIFO, 1);
- vg_assert(kr == 0);
-}
-
-void ML_(sema_deinit)(vg_sema_t *sema)
-{
- kern_return_t kr;
- kr = semaphore_destroy(mach_task_self(), sema->lock);
- vg_assert(kr == 0);
-}
-
-void ML_(sema_down)(vg_sema_t *sema, Bool as_LL)
-{
- kern_return_t kr;
- do {
- kr = semaphore_wait(sema->lock);
- } while (kr == KERN_ABORTED);
- vg_assert(kr == 0);
- sema->held_as_LL = as_LL;
-}
-
-void ML_(sema_up)(vg_sema_t *sema, Bool as_LL)
-{
- kern_return_t kr;
- vg_assert(as_LL == sema->held_as_LL);
- do {
- kr = semaphore_signal(sema->lock);
- } while (kr == KERN_ABORTED);
- vg_assert(kr == 0);
-}
-
-void ML_(sema_fork_child)(vg_sema_t *sema)
-{
- /* darwin: no deinit because child has no access to parent's semaphore */
- ML_(sema_init)(sema);
- ML_(sema_down)(sema, False/*not LL*/);
-}
-
-#else
-# error Unknown OS
-#endif
-
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
|
|
From: <sv...@va...> - 2009-03-22 11:18:13
|
Author: sewardj
Date: 2009-03-22 11:18:03 +0000 (Sun, 22 Mar 2009)
New Revision: 9485
Log:
On Darwin, it is essential to use _nocancel versions of syscalls
wherever possible, for reasons discussed at length in
Darwin-notes.txt.
Modified:
branches/DARWIN/coregrind/m_debuglog.c
branches/DARWIN/coregrind/m_libcfile.c
branches/DARWIN/coregrind/m_libcproc.c
branches/DARWIN/coregrind/m_libcsignal.c
branches/DARWIN/docs/internals/Darwin-notes.txt
Modified: branches/DARWIN/coregrind/m_debuglog.c
===================================================================
--- branches/DARWIN/coregrind/m_debuglog.c 2009-03-22 10:14:39 UTC (rev 9484)
+++ branches/DARWIN/coregrind/m_debuglog.c 2009-03-22 11:18:03 UTC (rev 9485)
@@ -46,6 +46,11 @@
/* This module is also notable because it is linked into both
stage1 and stage2. */
+/* IMPORTANT: on Darwin it is essential to use the _nocancel versions
+ of syscalls rather than the vanilla version, if a _nocancel version
+ is available. See docs/internals/Darwin-notes.txt for the reason
+ why. */
+
#include "pub_core_basics.h" /* basic types */
#include "pub_core_vkiscnums.h" /* for syscall numbers */
#include "pub_core_debuglog.h" /* our own iface */
@@ -395,6 +400,10 @@
#elif defined(VGP_x86_darwin)
+/* Using _SYSNO_INDEX rather than _SYSNO_NUM assumes that these are
+ Unix-class syscalls (which they are). Unfortunately _SYSNO_NUM
+ involves a C-style "cond ? :" expression which doesn't impress the
+ Darwin assembler very much. */
__attribute__((noinline))
static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
@@ -406,7 +415,8 @@
"pushl %%eax\n"
"movl $1, %%eax\n" /* push stderr */
"pushl %%eax\n"
- "movl $4, %%eax\n" /* %eax = __NR_write */
+ "movl $"VG_STRINGIFY(VG_DARWIN_SYSNO_INDEX(__NR_write_nocancel))
+ ", %%eax\n"
"pushl %%eax\n" /* push fake return address */
"int $0x80\n" /* write(stderr, buf, n) */
"jnc 1f\n" /* jump if no error */
@@ -425,7 +435,7 @@
{
UInt __res;
__asm__ volatile (
- "movl $20, %%eax\n" /* set %eax = __NR_getpid */
+ "movl $"VG_STRINGIFY(VG_DARWIN_SYSNO_INDEX(__NR_getpid))", %%eax\n"
"int $0x80\n" /* getpid() */
"movl %%eax, %0\n" /* set __res = eax */
: "=mr" (__res)
@@ -444,7 +454,8 @@
"movq $1, %%rdi\n" /* push stderr */
"movq %1, %%rsi\n" /* push buf */
"movl %2, %%edx\n" /* push n */
- "movl $" VG_STRINGIFY(VG_DARWIN_SYSNO_NUM(__NR_write)) ", %%eax\n"
+ "movl $"VG_STRINGIFY(VG_DARWIN_SYSNO_NUM(__NR_write_nocancel))
+ ", %%eax\n"
"syscall\n" /* write(stderr, buf, n) */
"jnc 1f\n" /* jump if no error */
"movq $-1, %%rax\n" /* return -1 if error */
@@ -460,7 +471,7 @@
{
UInt __res;
__asm__ volatile (
- "movl $" VG_STRINGIFY(VG_DARWIN_SYSNO_NUM(__NR_getpid)) ", %%eax\n"
+ "movl $"VG_STRINGIFY(VG_DARWIN_SYSNO_NUM(__NR_getpid))", %%eax\n"
"syscall\n" /* getpid() */
"movl %%eax, %0\n" /* set __res = eax */
: "=mr" (__res)
Modified: branches/DARWIN/coregrind/m_libcfile.c
===================================================================
--- branches/DARWIN/coregrind/m_libcfile.c 2009-03-22 10:14:39 UTC (rev 9484)
+++ branches/DARWIN/coregrind/m_libcfile.c 2009-03-22 11:18:03 UTC (rev 9485)
@@ -41,6 +41,11 @@
#include "pub_core_clientstate.h" // VG_(fd_hard_limit)
#include "pub_core_syscall.h"
+/* IMPORTANT: on Darwin it is essential to use the _nocancel versions
+ of syscalls rather than the vanilla version, if a _nocancel version
+ is available. See docs/internals/Darwin-notes.txt for the reason
+ why. */
+
/* ---------------------------------------------------------------------
File stuff
------------------------------------------------------------------ */
@@ -103,19 +108,20 @@
SysRes VG_(open) ( const Char* pathname, Int flags, Int mode )
{
- SysRes res = VG_(do_syscall3)(__NR_open, (UWord)pathname, flags, mode);
+ SysRes res = VG_(do_syscall3)(__NR_open_nocancel,
+ (UWord)pathname, flags, mode);
return res;
}
void VG_(close) ( Int fd )
{
- (void)VG_(do_syscall1)(__NR_close, fd);
+ (void)VG_(do_syscall1)(__NR_close_nocancel, fd);
}
Int VG_(read) ( Int fd, void* buf, Int count)
{
Int ret;
- SysRes res = VG_(do_syscall3)(__NR_read, fd, (UWord)buf, count);
+ SysRes res = VG_(do_syscall3)(__NR_read_nocancel, fd, (UWord)buf, count);
if (sr_isError(res)) {
ret = - (Int)(Word)sr_Err(res);
vg_assert(ret < 0);
@@ -129,7 +135,7 @@
Int VG_(write) ( Int fd, const void* buf, Int count)
{
Int ret;
- SysRes res = VG_(do_syscall3)(__NR_write, fd, (UWord)buf, count);
+ SysRes res = VG_(do_syscall3)(__NR_write_nocancel, fd, (UWord)buf, count);
if (sr_isError(res)) {
ret = - (Int)(Word)sr_Err(res);
vg_assert(ret < 0);
@@ -143,8 +149,9 @@
Int VG_(select) ( Int nfds, void *rfds, void *wfds, void *efds, void *timeout)
{
Int ret;
- SysRes res = VG_(do_syscall5)(__NR_select, nfds, (Addr)rfds, (Addr)wfds,
- (Addr)efds, (Addr)timeout);
+ SysRes res = VG_(do_syscall5)(__NR_select_nocancel, nfds,
+ (Addr)rfds, (Addr)wfds,
+ (Addr)efds, (Addr)timeout);
if (sr_isError(res)) {
ret = - (Int)(Word)sr_Err(res);
vg_assert(ret < 0);
@@ -343,7 +350,7 @@
/* Returns -1 on error. */
Int VG_(fcntl) ( Int fd, Int cmd, Addr arg )
{
- SysRes res = VG_(do_syscall3)(__NR_fcntl, fd, cmd, arg);
+ SysRes res = VG_(do_syscall3)(__NR_fcntl_nocancel, fd, cmd, arg);
return sr_isError(res) ? -1 : sr_Res(res);
}
@@ -554,11 +561,11 @@
{
SysRes res;
# if defined(VGP_amd64_darwin)
- res = VG_(do_syscall4)(__NR_pread, fd, (UWord)buf, count, offset);
+ res = VG_(do_syscall4)(__NR_pread_nocancel, fd, (UWord)buf, count, offset);
return res;
# elif defined(VGP_x86_darwin)
/* ppc32-darwin is the same, but with the args inverted */
- res = VG_(do_syscall5)(__NR_pread, fd, (UWord)buf, count,
+ res = VG_(do_syscall5)(__NR_pread_nocancel, fd, (UWord)buf, count,
offset & 0xffffffff, offset >> 32);
return res;
# elif defined(VGO_linux) || defined(VGO_aix5)
@@ -863,7 +870,7 @@
# elif defined(VGO_darwin)
SysRes res;
- res = VG_(do_syscall3)(__NR_accept, sock, (UWord)addr, (UWord)len);
+ res = VG_(do_syscall3)(__NR_accept_nocancel, sock, (UWord)addr, (UWord)len);
return sr_isError(res) ? -1 : sr_Res(res);
# else
@@ -896,7 +903,8 @@
# elif defined(VGO_darwin)
SysRes res;
- res = VG_(do_syscall3)(__NR_connect, sockfd, (UWord)serv_addr, addrlen);
+ res = VG_(do_syscall3)(__NR_connect_nocancel,
+ sockfd, (UWord)serv_addr, addrlen);
return sr_isError(res) ? -1 : sr_Res(res);
# else
@@ -937,7 +945,7 @@
# elif defined(VGP_x86_darwin) || defined(VGP_amd64_darwin)
SysRes res;
- res = VG_(do_syscall3)(__NR_write, sd, (UWord)msg, count);
+ res = VG_(do_syscall3)(__NR_write_nocancel, sd, (UWord)msg, count);
return sr_isError(res) ? -1 : sr_Res(res);
# else
Modified: branches/DARWIN/coregrind/m_libcproc.c
===================================================================
--- branches/DARWIN/coregrind/m_libcproc.c 2009-03-22 10:14:39 UTC (rev 9484)
+++ branches/DARWIN/coregrind/m_libcproc.c 2009-03-22 11:18:03 UTC (rev 9485)
@@ -49,6 +49,10 @@
/* --- !!! --- EXTERNAL HEADERS end --- !!! --- */
#endif
+/* IMPORTANT: on Darwin it is essential to use the _nocancel versions
+ of syscalls rather than the vanilla version, if a _nocancel version
+ is available. See docs/internals/Darwin-notes.txt for the reason
+ why. */
/* ---------------------------------------------------------------------
Command line and environment stuff
@@ -254,7 +258,8 @@
Int VG_(waitpid)(Int pid, Int *status, Int options)
{
# if defined(VGO_linux) || defined(VGO_darwin)
- SysRes res = VG_(do_syscall4)(__NR_wait4, pid, (UWord)status, options, 0);
+ SysRes res = VG_(do_syscall4)(__NR_wait4_nocancel,
+ pid, (UWord)status, options, 0);
return sr_isError(res) ? -1 : sr_Res(res);
# elif defined(VGO_aix5)
/* magic number 4 obtained by truss-ing a C program doing
Modified: branches/DARWIN/coregrind/m_libcsignal.c
===================================================================
--- branches/DARWIN/coregrind/m_libcsignal.c 2009-03-22 10:14:39 UTC (rev 9484)
+++ branches/DARWIN/coregrind/m_libcsignal.c 2009-03-22 11:18:03 UTC (rev 9485)
@@ -37,6 +37,11 @@
#include "pub_core_syscall.h"
#include "pub_core_libcsignal.h" /* self */
+/* IMPORTANT: on Darwin it is essential to use the _nocancel versions
+ of syscalls rather than the vanilla version, if a _nocancel version
+ is available. See docs/internals/Darwin-notes.txt for the reason
+ why. */
+
/* sigemptyset, sigfullset, sigaddset and sigdelset return 0 on
success and -1 on error. */
/* I believe the indexing scheme in ->sig[] is also correct for
Modified: branches/DARWIN/docs/internals/Darwin-notes.txt
===================================================================
--- branches/DARWIN/docs/internals/Darwin-notes.txt 2009-03-22 10:14:39 UTC (rev 9484)
+++ branches/DARWIN/docs/internals/Darwin-notes.txt 2009-03-22 11:18:03 UTC (rev 9485)
@@ -1,6 +1,53 @@
-Valgrind-developer notes, todos re the MacOSX port.
+Valgrind-developer notes, re the MacOSX port
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+JRS 22 Mar 09: re these comments in m_libc* and m_debuglog:
+
+/* IMPORTANT: on Darwin it is essential to use the _nocancel versions
+ of syscalls rather than the vanilla version, if a _nocancel version
+ is available. See docs/internals/Darwin-notes.txt for the reason
+ why. */
+
+when Valgrind does (for its own purposes, not for the client)
+read/write/open/close etc syscalls, it really is critical to use the
+_nocancel versions of syscalls rather than the vanilla versions. This
+holds throughout the entire code base: whenever V does a syscall for
+its own purposes, we must use the _nocancel version if it exists.
+This is of course most prevalent in m_libc* since all of our
+own-purpose (non-client) syscalls should get routed through there.
+
+Why? Because on Darwin, pthread cancellation is done within the
+kernel (unlike on Linux, iiuc). And read/write/open/close and a whole
+bunch of other syscalls to do with stream I/O are cancellation points.
+So what can happen is, client informs the kernel that a given thread
+is to be cancelled. Then at the next (eg) VG_(printf) call by that
+thread, which leads to a sys_write, the write syscall gets hit by the
+cancellation request, and is duly nuked by the kernel. Of course from
+the outside it looks as if the thread had mysteriously disappeared off
+the radar for no reason.
+
+In short, we need to use _nocancel versions in order to ensure that
+cancellation requests only take effect at the places where the client
+does a syscall, and not the places where Valgrind does syscalls.
+
+How observed: using the standard pipe-based implementation in
+coregrind/m_scheduler/sema.c, none/tests/pth_cancel1 would hang
+(compared to succeeding using native Darwin semaphores). And if the
+"pause()" call in said test is turned into a spin ("while (1) ;") then
+the entire Valgrind run mysteriously disappears, rather than spinning
+using native Darwin semaphores.
+
+Because the pipe-based semaphore intensively uses sys_read/sys_write,
+it is not surprising that it inadvertantly was eating up cancellation
+requests directed to client threads. With abovementioned change in
+force the pipe-based semaphore appears to work correctly.
+
+
+
+Valgrind-developer notes, todos re the MacOSX port
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
* m_syswrap/syscall-amd64-darwin.S
- correct signal mask is not applied during syscall
- restart-labels are completely bogus
|
|
From: <sv...@va...> - 2009-03-22 10:14:47
|
Author: bart Date: 2009-03-22 10:14:39 +0000 (Sun, 22 Mar 2009) New Revision: 9484 Log: Updated 3.5.0 bug list. Modified: trunk/NEWS Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2009-03-22 09:32:26 UTC (rev 9483) +++ trunk/NEWS 2009-03-22 10:14:39 UTC (rev 9484) @@ -55,8 +55,16 @@ Now, only default.supp is installed. This should not affect users as the other installed suppression files were not read. +n-i-bz DRD - race conditions between pthread_barrier_wait() and + pthread_barrier_destroy() calls are now reported. +n-i-bz DRD - added "first observed at" information in error + messages related to synchronization objects. +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. + Release 3.4.1 (28 February 2009) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.4.1 is a bug-fix release that fixes some regressions and assertion |
|
From: <sv...@va...> - 2009-03-22 09:32:34
|
Author: sewardj Date: 2009-03-22 09:32:26 +0000 (Sun, 22 Mar 2009) New Revision: 9483 Log: Update. Modified: branches/DARWIN/docs/internals/Darwin-notes.txt Modified: branches/DARWIN/docs/internals/Darwin-notes.txt =================================================================== --- branches/DARWIN/docs/internals/Darwin-notes.txt 2009-03-22 00:49:24 UTC (rev 9482) +++ branches/DARWIN/docs/internals/Darwin-notes.txt 2009-03-22 09:32:26 UTC (rev 9483) @@ -1,7 +1,7 @@ Valgrind-developer notes, todos re the MacOSX port. -* m_syswrap/syscall-x86-darwin.S +* m_syswrap/syscall-amd64-darwin.S - correct signal mask is not applied during syscall - restart-labels are completely bogus @@ -42,13 +42,6 @@ -------- -Urr. Nastyness. There seem to be 4 different syscall types on -Darwin, with 4 different conventions for returning results. In order -to determine which syscall type we've got, it is sufficient to look at -the syscall number. Is that correct? If that's not true, then it -becomes impossible to write VG_UCONTEXT_SYSCALL_SYSRES for Darwin. - - m_main doesn't read symbols for the valgrind exe itself, which is annoying. On minimal investigation it seems that the executable isn't even listed by aspacem. This is very strange and not in accordance @@ -73,18 +66,13 @@ contains some ifdeffery. Clean up. -Get rid of priv_types_n_macros.h: RES2, getRES2, etc - - PRE(sys_fork), #ifdeffery syswrap-generic.c: VG_(init_preopened_fds) is #ifdefd for Darwin -scheduler.c: fi VEX_TRC_JMP_NODECODE and VEX_TRC_JMP_SIGSEGV -also: get rid of VG_(lock), VG_(unlock), VG_(unlock_lwpid) -also: VG_(get_thread_out_of_syscall) +scheduler.c: #ifdeffery in VG_(get_thread_out_of_syscall) look at notes in coregrind/Makefile.am re Mach RPC interface |
|
From: Bart V. A. <bar...@gm...> - 2009-03-22 08:32:40
|
Nightly build on georgia-tech-cellbuzz-native ( cellbuzz, ppc64, Fedora 7, native ) started at 2009-03-22 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-03-22 04:39:21
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2009-03-22 03:05:08 GMT 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-03-22 04:29:29
|
Nightly build on vauxhall ( x86_64, Fedora 10 ) started at 2009-03-22 03:20:17 GMT 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 == 487 tests, 0 stderr failures, 0 stdout failures, 0 post failures == |
|
From: Tom H. <th...@cy...> - 2009-03-22 03:52:16
|
Nightly build on mg ( x86_64, Fedora 9 ) started at 2009-03-22 03:10:05 GMT 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: Dan K. <da...@ke...> - 2009-03-22 01:47:46
|
On Sat, Mar 21, 2009 at 6:38 PM, Dan Kegel <da...@ke...> wrote:
> On Wed, Nov 12, 2008 at 12:59 AM, Julian Seward <js...@ac...> wrote:
>> On Wednesday 12 November 2008, Dan Kegel wrote:
>>> With valgrind from svn, I'm getting this error fairly frequently
>>> when running any of Wine's 3D unit tests. It seems to
>>> be triggered by a bug in the platform's nvidia opengl driver.
>>> Would you like more info?
>>
>> Yes, all the parameters to get_StackTrace_wrk that are not
>> marked /*OUT*/.
>
> I'm getting this reliably now running chromium's base_unittests.exe
> under current valgrind trunk.
And, bonus deal, I'm still getting it on the 3d tests. To repeat that scenario,
$ cd wine-git/dlls/d3d9/tests
$ valgrind --trace-children=yes ~/wine32/wine d3d9_test.exe.so volume.c
And here's the tail end of the long output for that case:
...
n_ips=12 fp_min=0x7f2046c0 fp_max_orig=0xfe980ffc, fp_max=0xfe980ffc
ip=0x4cb903e fp=0x7f2046f8
ipsF[1]=0x096e8112
ipsF[2]=0x096e8313
ipsF[3]=0x096ebc8a
ipsF[4]=0x096c60ad
--21819-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11
(SIGSEGV) - exiting
--21819-- si_code=2; Faulting address: 0xC1D0004C; sp: 0x4798d3c
valgrind: the 'impossible' happened:
Killed by fatal signal
n_ips=100 fp_min=0x4798d3c fp_max_orig=0x4798ff0, fp_max=0x4798ffc
ip=0x3803b138 fp=0x4798d64
ipsF[1]=0x3803b2cf
ipsF[2]=0x38025178
ipsF[3]=0x38002e7b
ipsF[4]=0x380033d5
ipsF[5]=0x3804f982
ipsF[6]=0x3806c378
ipsF[7]=0xffffffff
==21819== at 0x3803B138: vgPlain_get_StackTrace_wrk (m_stacktrace.c:162)
==21819== by 0x3803B2CF: vgPlain_get_StackTrace (m_stacktrace.c:483)
==21819== by 0x38025178: record_ExeContext_wrk (m_execontext.c:316)
==21819== by 0x38002E7B: vgMemCheck_new_block (mc_malloc_wrappers.c:214)
==21819== by 0x380033D5: vgMemCheck_malloc (mc_malloc_wrappers.c:235)
==21819== by 0x3804F982: vgPlain_scheduler (scheduler.c:1303)
==21819== by 0x3806C378: run_a_thread_NORETURN (syswrap-linux.c:89)
|
|
From: Dan K. <da...@ke...> - 2009-03-22 01:45:28
|
On Wed, Nov 12, 2008 at 12:59 AM, Julian Seward <js...@ac...> wrote: > On Wednesday 12 November 2008, Dan Kegel wrote: >> With valgrind from svn, I'm getting this error fairly frequently >> when running any of Wine's 3D unit tests. It seems to >> be triggered by a bug in the platform's nvidia opengl driver. >> Would you like more info? > > Yes, all the parameters to get_StackTrace_wrk that are not > marked /*OUT*/. I'm getting this reliably now running chromium's base_unittests.exe under current valgrind trunk. To repeat: wget http://kegel.com/wine/base_unittests.tgz tar -xzvf base_unittests.tgz wine notepad & // to avoid having to valgrind service startup valgrind -v --trace-children=yes wine chrome/Debug/base_unittests.exe I turned on the debug flag in m_stacktrace.c, as that seems to print out what you were after. That generated a huge amount of output; here's just the last bit: ... n_ips=12 fp_min=0x7f21eb34 fp_max_orig=0xfe8f6ffc, fp_max=0xfe8f6ffc ip=0x4cb70f2 fp=0x7f21eb7c ipsF[1]=0x06f65cdb ipsF[2]=0x09ea9c4d ipsF[3]=0x09ea9f27 ipsF[4]=0x09ed15c8 ipsF[5]=0x09d009e0 ipsF[6]=0x09d01435 ipsF[7]=0x09d01ebc ipsF[8]=0x09cf0284 ipsF[9]=0x083ba3ca ipsF[10]=0x083ba7f6 ipsF[11]=0x083bac2a n_ips=12 fp_min=0x7f21eaf4 fp_max_orig=0xfe8f6ffc, fp_max=0xfe8f6ffc ip=0x4cb903e fp=0x7f21eb2c ipsF[1]=0x04cb91bf ipsF[2]=0x06f672ce ipsF[3]=0x0732de98 --21633-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exiting --21633-- si_code=2; Faulting address: 0xFBAD8005; sp: 0x4798d3c valgrind: the 'impossible' happened: Killed by fatal signal n_ips=100 fp_min=0x4798d3c fp_max_orig=0x4798ff0, fp_max=0x4798ffc ip=0x3803b138 fp=0x4798d64 ipsF[1]=0x3803b2cf ipsF[2]=0x38025178 ipsF[3]=0x38002e7b ipsF[4]=0x380033d5 ipsF[5]=0x3804f982 ipsF[6]=0x3806c378 ipsF[7]=0xffffffff ==21633== at 0x3803B138: vgPlain_get_StackTrace_wrk (m_stacktrace.c:162) ==21633== by 0x3803B2CF: vgPlain_get_StackTrace (m_stacktrace.c:483) ==21633== by 0x38025178: record_ExeContext_wrk (m_execontext.c:316) ==21633== by 0x38002E7B: vgMemCheck_new_block (mc_malloc_wrappers.c:214) ==21633== by 0x380033D5: vgMemCheck_malloc (mc_malloc_wrappers.c:235) ==21633== by 0x3804F982: vgPlain_scheduler (scheduler.c:1303) ==21633== by 0x3806C378: run_a_thread_NORETURN (syswrap-linux.c:89) I've put the log with and without debug=1, compressed with rzip, up at http://kegel.com/wine/log2.rz and http://kegel.com/wine/log3.rz. - Dan |
|
From: <sv...@va...> - 2009-03-22 00:49:31
|
Author: sewardj
Date: 2009-03-22 00:49:24 +0000 (Sun, 22 Mar 2009)
New Revision: 9482
Log:
Redo the suppressions in a more general way, mostly relying on library
names, pretty much as the Linux standard suppressions do.
Modified:
branches/DARWIN/darwin9.supp
Modified: branches/DARWIN/darwin9.supp
===================================================================
--- branches/DARWIN/darwin9.supp 2009-03-22 00:39:22 UTC (rev 9481)
+++ branches/DARWIN/darwin9.supp 2009-03-22 00:49:24 UTC (rev 9482)
@@ -5,85 +5,68 @@
#
{
- macos-10.5-pasteboard-1
+ mach_msg_trap-1
Memcheck:Param
mach_msg(msg.msgh_remote_port)
fun:mach_msg_trap
- fun:CFPasteboardCreate
- fun:*Pasteboard*
+ obj:/System/Library/Frameworks/CoreFoundation*
+ obj:/System/Library/Frameworks/ApplicationServices*
}
{
- macos-10.5-pasteboard-2
+ mach_msg_trap-2
Memcheck:Param
mach_msg(msg.msgh_remote_port)
fun:mach_msg_trap
- fun:CFPasteboardCreate
- fun:*PB*
+ obj:/System/Library/Frameworks/CoreFoundation*
+ obj:/System/Library/Frameworks/CoreServices*
}
{
- macos-10.5-pasteboard-3
+ mach_msg_trap-3
Memcheck:Param
mach_msg(msg.msgh_remote_port)
fun:mach_msg_trap
- fun:CFPasteboardCreate
- fun:*Prefs*
+ obj:/System/Library/Frameworks/CoreFoundation*
+ obj:/System/Library/Frameworks/Carbon*
}
{
- macos-10.5-pasteboard-4
- Memcheck:Param
- mach_msg(msg.msgh_remote_port)
- fun:mach_msg_trap
- fun:CFPasteboardCreate
- fun:CacheFMMapData
-}
-
-{
- macos-10.5-gle-1
+ macos-Cond-1
Memcheck:Cond
- fun:gleUpdate*
- ...
- fun:gleUpdate*
+ fun:GetVariationInfoFromName
+ obj:/System/Library/Frameworks/ApplicationServices*
+ obj:/System/Library/Frameworks/ApplicationServices*
}
{
- macos-10.5-gle-2
+ macos-Cond-2
Memcheck:Cond
- fun:gleUpdate*
- ...
- fun:gleInitialize*
+ fun:*PMMutex*Lock*
+ obj:/System/Library/Frameworks/ApplicationServices*
+ obj:/System/Library/Frameworks/ApplicationServices*
}
{
- macos-10.5-PMMutex-1
+ macos-Cond-3
Memcheck:Cond
- fun:_ZN7PMMutex*
- fun:_ZN7PMMutex*
- fun:_ZN7PMMutex*
+ fun:sseCGSBlendXXXX8888
+ obj:/System/Library/Frameworks/ApplicationServices*
+ obj:/System/Library/Frameworks/ApplicationServices*
}
{
- macos-10.5-misc-1
+ macos-Cond-4
Memcheck:Cond
- fun:GetVariationInfoFromName
- fun:_Z22FindBestFamilyInstanceP23privateFontObjectRecordPsS1_Pt
- fun:FOGetFontFamilyInstanceFromFont
+ fun:*CASettingsStorage*RefreshSettings*
+ obj:/System/Library/Frameworks/CoreAudio*
+ obj:/System/Library/Frameworks/CoreAudio*
}
{
- macos-10.5-misc-2
+ macos-Cond-5
Memcheck:Cond
- fun:_ZN17CASettingsStorage15RefreshSettingsEv
- fun:_ZNK17CASettingsStorage15CopyCFTypeValueEPK10__CFStringRPKvS4_
- fun:_ZNK17CASettingsStorage14CopyArrayValueEPK10__CFStringRPK9__CFArrayS5_
+ fun:gle*
+ obj:/System/Library/Frameworks/OpenGL*
+ obj:/System/Library/Frameworks/OpenGL*
}
-
-{
- macos-10.5-misc-3
- Memcheck:Cond
- fun:*ImageContent*
- fun:*IconView*LoadIconData*
- fun:*IconView*InitializeCommon*
-}
|
|
From: <sv...@va...> - 2009-03-22 00:39:28
|
Author: sewardj
Date: 2009-03-22 00:39:22 +0000 (Sun, 22 Mar 2009)
New Revision: 9481
Log:
PRE(sys_pathconf): remove bogus fd-validity check. Probably a copy-n-paste
error from PRE(sys_fpathconf).
Modified:
branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-03-21 17:14:02 UTC (rev 9480)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-03-22 00:39:22 UTC (rev 9481)
@@ -2838,9 +2838,6 @@
PRINT("pathconf(%#lx(%s), %ld)", ARG1,(char *)ARG1,ARG2);
PRE_REG_READ2(long,"pathconf", const char *,"path", int,"name");
PRE_MEM_RASCIIZ("pathconf(path)", ARG1);
-
- if (!ML_(fd_allowed)(ARG1, "pathconf", tid, False))
- SET_STATUS_Failure( VKI_EBADF );
}
|