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
(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-28 19:19:49
|
Hi,
Filipe Cabecinhas wrote:
>> There's also memcheck/tests/darwin/scalar.c, which is intended to test
>> all the arguments to all syscalls for undefinedness (at least, most of
>> them). If you can understand how it works, additions to it for the
>> new syscalls (or any other syscalls) would be welcome.
> I'll take a peek at it, when I can. :-)
I took a peek at it and inserted some calls to csops and sem_{init,destroy}.
Here is the patch.
I think I understood what the Xs Ym mean...
Xs: X "scalar" arguments
Ym: Y "memory" (pointer) arguments.
Regards,
Filipe
|
|
From: Michael S. <ms...@xi...> - 2009-04-28 17:33:49
|
On Tue, Apr 28, 2009 at 10:28 AM, Michael Sweet <ms...@ap...> wrote: > I don't think you can reuse a socket after a failed connect()... That is indeed the problem here. Which is... not mentioned in the documentation - the manpage (this from linux, but the osx one has similar wording) says "connection-based protocol sockets may successfully connect() only once" - but this didn't connect _successfully_. However, changing the test program to close the socket and create a new one makes it work. Arguably a bug in darwin, but easy enough to work around. Mike |
|
From: Michael S. <ms...@ap...> - 2009-04-28 17:28:36
|
I don't think you can reuse a socket after a failed connect()... On Apr 28, 2009, at 12:03 AM, Nicholas Nethercote wrote: > Hi, > > none/tests/fdleak_ipv4 doesn't work on Darwin. I can't work out why, > but I don't know much about network programming. If anyone who does > (Filipe?) it would be very helpful. > > The program forks and creates a client process and a server process. > If the server process runs first and reaches accept() before the > client tries to connect(), it works fine. I tested this by inserting > a sleep() in the client. > > But without that sleep(), on my machine usually the client reaches > connect() first. It fails with "connection refused", which is > reasonable, because the server hasn't started listening/accepting > connections. But then on the retry, after the sleep(1), the connect() > fails with an invalid argument. And this repeats 10 times around the > client's connect() loop until the client gives up. > > It's the invalid argument errors that I don't understand. I looked at > the xnu kernel sources, AFAICT the only way to get EINVAL from > connect() is to make the 3rd arg (address_len) too small but that's > definitely not the case. Besides, if we don't get EINVAL on the first > try, why should we get it on subsequent tries with identical > arguments? > > Finally, the server process never shuts down, it just hangs waiting > for accept(), which complicates subsequent runs. > > Any ideas? I attach a version which prints messages before and after > each network operation, which makes it easier to debug. > > Nick > < > fdleak_ipv4 > .c > > > ------------------------------------------------------------------------------ > Register Now & Save for Velocity, the Web Performance & Operations > Conference from O'Reilly Media. Velocity features a full day of > expert-led, hands-on workshops and two days of sessions from industry > leaders in dedicated Performance & Operations tracks. Use code > vel09scf > and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf_______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers ________________________________________ Michael R Sweet, Senior Printing System Engineer |
|
From: Filipe C. <fi...@gm...> - 2009-04-28 17:25:28
|
Bart Van Assche wrote: > On Tue, Apr 28, 2009 at 5:53 PM, Filipe Cabecinhas <fi...@gm...> wrote: >> Bart Van Assche wrote: >>> On Tue, Apr 28, 2009 at 9:03 AM, Nicholas Nethercote >>> <n.n...@gm...> wrote: >>>> none/tests/fdleak_ipv4 doesn't work on Darwin. I can't work out why, >>>> but I don't know much about network programming. If anyone who does >>>> (Filipe?) it would be very helpful. >>> Some remarks (found via source reading): >>> * The statement "setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &one, >>> sizeof(int));" should be checked. While Linux accepts both one-byte >>> and four-byte arguments for SO_REUSEADDR, some platforms only accept >>> one-byte arguments when setting a boolean socket option. >>> * The statement "addr.sin_port = 12321;" should be "addr.sin_port = >>> htons(12321);", otherwise port number 12321 will be used on big endian >>> systems and port number 8496 on little-endian systems. >>> >> Isn't that already being done? With the DO(...) macro? > > Are we looking at the same source code ? I didn't find any htons() > call in the DO() macro in none/tests/fdleak.h on the DARWIN branch. > > Bart. I'm sorry, I was only addressing your first point, not the second. In my (attached) patch I added both htons(). The patch creates the socket inside the client loop and closes it on error (printing the error), creating a new socket again. I also changed the filter_fdleak to filter out lines containing (only) "connect: Connection refused". I also got this error: +./fdleak_ipv4: +dSYM directory has wrong UUID; consider using --auto-run-dsymutil=yes I ran with that argument and then (after creating the *.dSYM/), ran the regtest again and it worked. Shouldn't gcc create the directory when running with -g? Regards, Filipe |
|
From: Michael S. <ms...@xi...> - 2009-04-28 17:17:14
|
On Tue, Apr 28, 2009 at 12:03 AM, Nicholas Nethercote <n.n...@gm...> wrote: > Hi, > > none/tests/fdleak_ipv4 doesn't work on Darwin. I can't work out why, > but I don't know much about network programming. If anyone who does > (Filipe?) it would be very helpful. > > The program forks and creates a client process and a server process. > If the server process runs first and reaches accept() before the > client tries to connect(), it works fine. I tested this by inserting > a sleep() in the client. > > But without that sleep(), on my machine usually the client reaches > connect() first. It fails with "connection refused", which is > reasonable, because the server hasn't started listening/accepting > connections. But then on the retry, after the sleep(1), the connect() > fails with an invalid argument. And this repeats 10 times around the > client's connect() loop until the client gives up. The only other thing I can see that other source I've compared to does differently is to memset() the sockaddr_in to zero before filling in the other fields. Might darwin be checking that the other fields (which are just padding?) are zeroed? I see you've checked the kernel sources, which I haven't... but it's the only suggestion I have. Mike |
|
From: Bart V. A. <bar...@gm...> - 2009-04-28 15:59:46
|
On Tue, Apr 28, 2009 at 5:53 PM, Filipe Cabecinhas <fi...@gm...> wrote: > Bart Van Assche wrote: >> >> On Tue, Apr 28, 2009 at 9:03 AM, Nicholas Nethercote >> <n.n...@gm...> wrote: >>> >>> none/tests/fdleak_ipv4 doesn't work on Darwin. I can't work out why, >>> but I don't know much about network programming. If anyone who does >>> (Filipe?) it would be very helpful. >> >> Some remarks (found via source reading): >> * The statement "setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &one, >> sizeof(int));" should be checked. While Linux accepts both one-byte >> and four-byte arguments for SO_REUSEADDR, some platforms only accept >> one-byte arguments when setting a boolean socket option. >> * The statement "addr.sin_port = 12321;" should be "addr.sin_port = >> htons(12321);", otherwise port number 12321 will be used on big endian >> systems and port number 8496 on little-endian systems. >> > Isn't that already being done? With the DO(...) macro? Are we looking at the same source code ? I didn't find any htons() call in the DO() macro in none/tests/fdleak.h on the DARWIN branch. Bart. |
|
From: Filipe C. <fi...@gm...> - 2009-04-28 15:53:29
|
Hi, Bart Van Assche wrote: > On Tue, Apr 28, 2009 at 9:03 AM, Nicholas Nethercote > <n.n...@gm...> wrote: >> none/tests/fdleak_ipv4 doesn't work on Darwin. I can't work out why, >> but I don't know much about network programming. If anyone who does >> (Filipe?) it would be very helpful. > > Some remarks (found via source reading): > * The statement "setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &one, > sizeof(int));" should be checked. While Linux accepts both one-byte > and four-byte arguments for SO_REUSEADDR, some platforms only accept > one-byte arguments when setting a boolean socket option. > * The statement "addr.sin_port = 12321;" should be "addr.sin_port = > htons(12321);", otherwise port number 12321 will be used on big endian > systems and port number 8496 on little-endian systems. > Isn't that already being done? With the DO(...) macro? As for the error... The "Single UNIX specification" (http://www.unix.org/single_unix_specification/ ) says, about connect: -------------------------------- APPLICATION USAGE If connect() fails, the state of the socket is unspecified. Conforming applications should close the file descriptor and create a new socket before attempting to reconnect. -------------------------------- In Linux it may work, but it's not guaranteed to work on a UNIX. I'm creating a new socket in every iteration right now but still have some differences on the stderr side (some ellipsis we're not expecting and an extra connection refused). I'll see what's happening and make a patch later today. Regards, Filipe |
|
From: <sv...@va...> - 2009-04-28 14:37:35
|
Author: sewardj
Date: 2009-04-28 15:37:31 +0100 (Tue, 28 Apr 2009)
New Revision: 9666
Log:
Use 0x%lx rather than %p to print a pointer value, since the latter
behaves differently with NULL on different platforms. Gives
consistent behaviour across Darwin and Linux.
Modified:
branches/DARWIN/none/tests/x86/badseg.c
branches/DARWIN/none/tests/x86/badseg.stdout.exp
Modified: branches/DARWIN/none/tests/x86/badseg.c
===================================================================
--- branches/DARWIN/none/tests/x86/badseg.c 2009-04-28 14:35:34 UTC (rev 9665)
+++ branches/DARWIN/none/tests/x86/badseg.c 2009-04-28 14:37:31 UTC (rev 9666)
@@ -4,8 +4,8 @@
static void handler(int sig, siginfo_t *info, void *v)
{
- printf("info: sig=%d code=%d addr=%p\n",
- info->si_signo, info->si_code, info->si_addr);
+ printf("info: sig=%d code=%d addr=0x%lx\n",
+ info->si_signo, info->si_code, (unsigned long)info->si_addr);
exit(0);
}
Modified: branches/DARWIN/none/tests/x86/badseg.stdout.exp
===================================================================
--- branches/DARWIN/none/tests/x86/badseg.stdout.exp 2009-04-28 14:35:34 UTC (rev 9665)
+++ branches/DARWIN/none/tests/x86/badseg.stdout.exp 2009-04-28 14:37:31 UTC (rev 9666)
@@ -1 +1 @@
-info: sig=11 code=128 addr=(nil)
+info: sig=11 code=128 addr=0x0
|
|
From: <sv...@va...> - 2009-04-28 14:35:37
|
Author: sewardj
Date: 2009-04-28 15:35:34 +0100 (Tue, 28 Apr 2009)
New Revision: 9665
Log:
Fill in just enough of the presented siginfo to make
none/test/x86/badseg pass on Darwin.
Modified:
branches/DARWIN/coregrind/m_sigframe/sigframe-x86-darwin.c
Modified: branches/DARWIN/coregrind/m_sigframe/sigframe-x86-darwin.c
===================================================================
--- branches/DARWIN/coregrind/m_sigframe/sigframe-x86-darwin.c 2009-04-28 11:19:43 UTC (rev 9664)
+++ branches/DARWIN/coregrind/m_sigframe/sigframe-x86-darwin.c 2009-04-28 14:35:34 UTC (rev 9665)
@@ -70,8 +70,8 @@
VexGuestX86State gst;
VexGuestX86State gshadow1;
VexGuestX86State gshadow2;
- UChar fake_siginfo[ sizeof(vki_siginfo_t) ];
- UChar fake_ucontext[ sizeof(struct vki_ucontext) ];
+ vki_siginfo_t fake_siginfo;
+ struct vki_ucontext fake_ucontext;
UInt magicPI;
UInt sigNo_private;
vki_sigset_t mask; // saved sigmask; restore when hdlr returns
@@ -147,6 +147,11 @@
frame->mask = tst->sig_mask;
frame->magicPI = 0x31415927;
+ /* Minimally fill in the siginfo and ucontext. Note, utter
+ lameness prevails. Be underwhelmed, be very underwhelmed. */
+ frame->fake_siginfo.si_signo = sigNo;
+ frame->fake_siginfo.si_code = siginfo->si_code;
+
/* Set up stack pointer */
vg_assert(esp == (Addr)&frame->returnAddr);
VG_(set_SP)(tid, esp);
|
|
From: <sv...@va...> - 2009-04-28 11:19:54
|
Author: bart Date: 2009-04-28 12:19:43 +0100 (Tue, 28 Apr 2009) New Revision: 9664 Log: Added more comments. Modified: trunk/drd/tests/pth_create_glibc_2_0.c Modified: trunk/drd/tests/pth_create_glibc_2_0.c =================================================================== --- trunk/drd/tests/pth_create_glibc_2_0.c 2009-04-28 08:11:50 UTC (rev 9663) +++ trunk/drd/tests/pth_create_glibc_2_0.c 2009-04-28 11:19:43 UTC (rev 9664) @@ -1,4 +1,9 @@ -/* Test program that invokes pthread_create@GLIBC_2.0(). */ +/* + * Test program that invokes pthread_create@GLIBC_2.0(). + * + * Note: pthread_create@GLIBC_2.0() is only available in 32-bit glibc versions, + * not in 64-bit versions. + */ #include <pthread.h> |
|
From: Bart V. A. <bar...@gm...> - 2009-04-28 10:00:37
|
On Tue, Apr 28, 2009 at 9:20 AM, Bart Van Assche <bar...@gm...> wrote: > On Tue, Apr 28, 2009 at 9:03 AM, Nicholas Nethercote > <n.n...@gm...> wrote: >> none/tests/fdleak_ipv4 doesn't work on Darwin. I can't work out why, >> but I don't know much about network programming. If anyone who does >> (Filipe?) it would be very helpful. > > Some remarks (found via source reading): > * The statement "setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &one, > sizeof(int));" should be checked. While Linux accepts both one-byte > and four-byte arguments for SO_REUSEADDR, some platforms only accept > one-byte arguments when setting a boolean socket option. An update: at least for the 2.6.29 Linux kernel, a SOL_SOCKET option must have at least the size of an integer or it is rejected with error code EINVAL. SOL_IP setsockopt arguments can be either of type int or of type uchar. See also the kernel source files net/socket.c, net/core/sock.c and net/ipv4/ip_sockglue.c. Bart. |
|
From: <sv...@va...> - 2009-04-28 08:11:53
|
Author: njn
Date: 2009-04-28 09:11:50 +0100 (Tue, 28 Apr 2009)
New Revision: 9663
Log:
Merged r9646 (nightly/bin/nightly tweaks) from the trunk.
Modified:
branches/DARWIN/nightly/bin/nightly
Modified: branches/DARWIN/nightly/bin/nightly
===================================================================
--- branches/DARWIN/nightly/bin/nightly 2009-04-28 08:00:23 UTC (rev 9662)
+++ branches/DARWIN/nightly/bin/nightly 2009-04-28 08:11:50 UTC (rev 9663)
@@ -6,9 +6,14 @@
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
-# Helper function
+# Helper functions
#----------------------------------------------------------------------------
+# Returns the revision number of the source files with date $1.
+get_svn_revision() {
+ svn info -r "{$1}" "${valgrind_svn_repo}" | sed -n 's/^Revision: //p'
+}
+
runcmd () {
logfile=$1
str=$2
@@ -39,7 +44,10 @@
#----------------------------------------------------------------------------
# Startup
#----------------------------------------------------------------------------
-# Must have at two arguments
+
+valgrind_svn_repo="svn://svn.valgrind.org/valgrind/trunk"
+
+# Must have exactly two arguments
if [ $# -ne 2 ] ; then
echo "usage: $0 /path/to/valgrind/nightly <tag>"
exit 1
@@ -57,6 +65,10 @@
cd $ABT_TOP
+# Clean up output files produced by a previous run.
+rm -rf diffs diff.short final Inst new.short new.verbose old.short old.verbose
+rm -rf sendmail.log unchanged.log valgrind
+
# Setup any relevant environment variables from conf/<tag>.conf.
source conf/$ABT_MACHINE.conf
if [ "${ABT_JOBS}" = "" ]; then
@@ -71,12 +83,20 @@
# Check out, build, test
#----------------------------------------------------------------------------
+svn_old_rev="`get_svn_revision ${svn_old_date}`"
+svn_new_rev="`get_svn_revision ${svn_new_date}`"
+if [ "${svn_old_rev}" = "${svn_new_rev}" ]; then
+ echo "Both {$svn_old_date} and {$svn_new_date} correspond to r${svn_new_rev}"\
+ "-- skipping nightly build." >unchanged.log
+ exit 0
+fi
+
# Do everything twice -- once for the 24 hours old Valgrind, and once
# for the current one.
for logfile in old new ; do
- # Remove the old valgrind/ and vex/ directories
- rm -rf valgrind vex
+ # Remove the old valgrind directory.
+ rm -rf valgrind
# Remove old short and verbose log files, and start the new ones
for ext in short verbose ; do
@@ -95,7 +115,7 @@
# Check out, build, run tests
runcmd $logfile \
"Checking out valgrind source tree" \
- "svn co svn://svn.valgrind.org/valgrind/trunk -r {$svn_date} valgrind" && \
+ "svn co ${valgrind_svn_repo} -r {$svn_date} valgrind" && \
\
runcmd $logfile \
"Configuring valgrind " \
@@ -167,7 +187,6 @@
# Gather up the diffs (at most the first 100 lines for each one) into a
# single file.
MAX_LINES=100
-rm -f diffs
diff_files=`find . -name '*.diff'`
if [ z"$diff_files" = z ] ; then
echo "Congratulations, all tests passed!" >> diffs
|
|
From: <sv...@va...> - 2009-04-28 08:00:28
|
Author: njn
Date: 2009-04-28 09:00:23 +0100 (Tue, 28 Apr 2009)
New Revision: 9662
Log:
Merge r9661 (remove m_signals.c magic numbers) from the DARWIN branch.
Modified:
trunk/coregrind/m_signals.c
Modified: trunk/coregrind/m_signals.c
===================================================================
--- trunk/coregrind/m_signals.c 2009-04-28 07:53:14 UTC (rev 9661)
+++ trunk/coregrind/m_signals.c 2009-04-28 08:00:23 UTC (rev 9662)
@@ -1155,6 +1155,11 @@
#endif
}
+// This is an arbitrary si_code that we only use internally. It corresponds
+// to the value SI_KERNEL on Linux, but that's not really of any significance
+// as far as I can determine.
+#define VKI_SEGV_MADE_UP_GPF 0x80
+
/*
Perform the default action of a signal. If the signal is fatal, it
marks all threads as needing to exit, but it doesn't actually kill
@@ -1245,7 +1250,7 @@
switch(info->si_code) {
case VKI_SEGV_MAPERR: event = "Access not within mapped region"; break;
case VKI_SEGV_ACCERR: event = "Bad permissions for mapped region"; break;
- case 128:
+ case VKI_SEGV_MADE_UP_GPF:
/* General Protection Fault: The CPU/kernel
isn't telling us anything useful, but this
is commonly the result of exceeding a
@@ -1477,19 +1482,19 @@
// permissions are bad.
void VG_(synth_fault_perms)(ThreadId tid, Addr addr)
{
- synth_fault_common(tid, addr, 2);
+ synth_fault_common(tid, addr, VKI_SEGV_ACCERR);
}
// Synthesize a fault where the address there's nothing mapped at the address.
void VG_(synth_fault_mapping)(ThreadId tid, Addr addr)
{
- synth_fault_common(tid, addr, 1);
+ synth_fault_common(tid, addr, VKI_SEGV_MAPERR);
}
// Synthesize a misc memory fault.
void VG_(synth_fault)(ThreadId tid)
{
- synth_fault_common(tid, 0, 0x80);
+ synth_fault_common(tid, 0, VKI_SEGV_MADE_UP_GPF);
}
// Synthesise a SIGILL.
|
|
From: Bart V. A. <bar...@gm...> - 2009-04-28 07:55:20
|
Nightly build on georgia-tech-cellbuzz-native ( cellbuzz, ppc64, Fedora 7, native ) started at 2009-04-28 02:21:46 EDT Results differ 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, 12 stdout failures, 0 post failures == exp-ptrcheck/tests/bad_percentify (stdout) 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 (stdout) 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 (stdout) 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) ================================================= == 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 == 407 tests, 37 stderr failures, 12 stdout failures, 0 post failures == drd/tests/pth_create_chain (stderr) exp-ptrcheck/tests/bad_percentify (stdout) 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 (stdout) 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 (stdout) 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) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Tue Apr 28 03:08:22 2009 --- new.short Tue Apr 28 03:54:36 2009 *************** *** 8,11 **** ! == 407 tests, 37 stderr failures, 12 stdout failures, 0 post failures == ! drd/tests/pth_create_chain (stderr) exp-ptrcheck/tests/bad_percentify (stdout) --- 8,10 ---- ! == 407 tests, 36 stderr failures, 12 stdout failures, 0 post failures == exp-ptrcheck/tests/bad_percentify (stdout) |
|
From: <sv...@va...> - 2009-04-28 07:53:20
|
Author: njn
Date: 2009-04-28 08:53:14 +0100 (Tue, 28 Apr 2009)
New Revision: 9661
Log:
Get rid of some magic numbers in m_signals.c.
Modified:
branches/DARWIN/coregrind/m_signals.c
Modified: branches/DARWIN/coregrind/m_signals.c
===================================================================
--- branches/DARWIN/coregrind/m_signals.c 2009-04-28 07:34:51 UTC (rev 9660)
+++ branches/DARWIN/coregrind/m_signals.c 2009-04-28 07:53:14 UTC (rev 9661)
@@ -1280,6 +1280,11 @@
#endif
}
+// This is an arbitrary si_code that we only use internally. It corresponds
+// to the value SI_KERNEL on Linux, but that's not really of any significance
+// as far as I can determine.
+#define VKI_SEGV_MADE_UP_GPF 0x80
+
/*
Perform the default action of a signal. If the signal is fatal, it
marks all threads as needing to exit, but it doesn't actually kill
@@ -1375,7 +1380,7 @@
switch(info->si_code) {
case VKI_SEGV_MAPERR: event = "Access not within mapped region"; break;
case VKI_SEGV_ACCERR: event = "Bad permissions for mapped region"; break;
- case 128:
+ case VKI_SEGV_MADE_UP_GPF:
/* General Protection Fault: The CPU/kernel
isn't telling us anything useful, but this
is commonly the result of exceeding a
@@ -1608,19 +1613,19 @@
// permissions are bad.
void VG_(synth_fault_perms)(ThreadId tid, Addr addr)
{
- synth_fault_common(tid, addr, 2);
+ synth_fault_common(tid, addr, VKI_SEGV_ACCERR);
}
// Synthesize a fault where the address there's nothing mapped at the address.
void VG_(synth_fault_mapping)(ThreadId tid, Addr addr)
{
- synth_fault_common(tid, addr, 1);
+ synth_fault_common(tid, addr, VKI_SEGV_MAPERR);
}
// Synthesize a misc memory fault.
void VG_(synth_fault)(ThreadId tid)
{
- synth_fault_common(tid, 0, 0x80);
+ synth_fault_common(tid, 0, VKI_SEGV_MADE_UP_GPF);
}
// Synthesise a SIGILL.
|
|
From: <sv...@va...> - 2009-04-28 07:35:02
|
Author: sewardj
Date: 2009-04-28 08:34:51 +0100 (Tue, 28 Apr 2009)
New Revision: 9660
Log:
On Darwin, reenable synthesis of SIGSEGV following VEX_TRC_JMP_MAPFAIL
(mapping failure on x86 via use of segment registers, or some such).
Modified:
branches/DARWIN/coregrind/m_scheduler/scheduler.c
Modified: branches/DARWIN/coregrind/m_scheduler/scheduler.c
===================================================================
--- branches/DARWIN/coregrind/m_scheduler/scheduler.c 2009-04-28 07:31:38 UTC (rev 9659)
+++ branches/DARWIN/coregrind/m_scheduler/scheduler.c 2009-04-28 07:34:51 UTC (rev 9660)
@@ -1107,14 +1107,7 @@
case VEX_TRC_JMP_MAPFAIL:
/* Failure of arch-specific address translation (x86/amd64
segment override use) */
- /* jrs 2005 03 11: is this correct? */
-#if defined(VGO_darwin)
- // DDD: #warning GrP fixme synth signals
- VG_(core_panic)("mapfail - no synth signals on darwin");
- I_die_here;
-#else
VG_(synth_fault)(tid);
-#endif
break;
case VEX_TRC_JMP_EMWARN: {
|
|
From: <sv...@va...> - 2009-04-28 07:31:57
|
Author: sewardj
Date: 2009-04-28 08:31:38 +0100 (Tue, 28 Apr 2009)
New Revision: 9659
Log:
Point the second and third args of the signal frame we are building,
to fake siginfo and ucontext structures, rather than leaving them
NULL, so at least the handler doesn't segfault if it uses those args.
All fields read through those pointers will be zero, though.
Modified:
branches/DARWIN/coregrind/m_sigframe/sigframe-x86-darwin.c
Modified: branches/DARWIN/coregrind/m_sigframe/sigframe-x86-darwin.c
===================================================================
--- branches/DARWIN/coregrind/m_sigframe/sigframe-x86-darwin.c 2009-04-28 05:35:53 UTC (rev 9658)
+++ branches/DARWIN/coregrind/m_sigframe/sigframe-x86-darwin.c 2009-04-28 07:31:38 UTC (rev 9659)
@@ -70,6 +70,8 @@
VexGuestX86State gst;
VexGuestX86State gshadow1;
VexGuestX86State gshadow2;
+ UChar fake_siginfo[ sizeof(vki_siginfo_t) ];
+ UChar fake_ucontext[ sizeof(struct vki_ucontext) ];
UInt magicPI;
UInt sigNo_private;
vki_sigset_t mask; // saved sigmask; restore when hdlr returns
@@ -134,6 +136,8 @@
VG_(memset)(&frame->gst, 0, sizeof(VexGuestX86State));
VG_(memset)(&frame->gshadow1, 0, sizeof(VexGuestX86State));
VG_(memset)(&frame->gshadow2, 0, sizeof(VexGuestX86State));
+ VG_(memset)(&frame->fake_siginfo, 0, sizeof(frame->fake_siginfo));
+ VG_(memset)(&frame->fake_ucontext, 0, sizeof(frame->fake_ucontext));
/* save stuff in frame */
frame->gst = tst->arch.vex;
@@ -157,10 +161,14 @@
(Addr)frame, 4*sizeof(UInt) );
frame->returnAddr = (UInt)&VG_(x86_darwin_SUBST_FOR_sigreturn);
frame->a1_signo = sigNo;
- frame->a2_siginfo = 0; /* oh well */
- frame->a3_ucontext = 0; /* oh well */
+ frame->a2_siginfo = (UInt)&frame->fake_siginfo; /* oh well */
+ frame->a3_ucontext = (UInt)&frame->fake_ucontext; /* oh well */
VG_TRACK( post_mem_write, Vg_CoreSignal, tid,
(Addr)frame, 4*sizeof(UInt) );
+ VG_TRACK( post_mem_write, Vg_CoreSignal, tid,
+ (Addr)&frame->fake_siginfo, sizeof(frame->fake_siginfo));
+ VG_TRACK( post_mem_write, Vg_CoreSignal, tid,
+ (Addr)&frame->fake_ucontext, sizeof(frame->fake_ucontext));
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugMsg,
|
|
From: Bart V. A. <bar...@gm...> - 2009-04-28 07:20:28
|
On Tue, Apr 28, 2009 at 9:03 AM, Nicholas Nethercote <n.n...@gm...> wrote: > none/tests/fdleak_ipv4 doesn't work on Darwin. I can't work out why, > but I don't know much about network programming. If anyone who does > (Filipe?) it would be very helpful. Some remarks (found via source reading): * The statement "setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(int));" should be checked. While Linux accepts both one-byte and four-byte arguments for SO_REUSEADDR, some platforms only accept one-byte arguments when setting a boolean socket option. * The statement "addr.sin_port = 12321;" should be "addr.sin_port = htons(12321);", otherwise port number 12321 will be used on big endian systems and port number 8496 on little-endian systems. Bart. |
|
From: Nicholas N. <n.n...@gm...> - 2009-04-28 07:03:34
|
Hi, none/tests/fdleak_ipv4 doesn't work on Darwin. I can't work out why, but I don't know much about network programming. If anyone who does (Filipe?) it would be very helpful. The program forks and creates a client process and a server process. If the server process runs first and reaches accept() before the client tries to connect(), it works fine. I tested this by inserting a sleep() in the client. But without that sleep(), on my machine usually the client reaches connect() first. It fails with "connection refused", which is reasonable, because the server hasn't started listening/accepting connections. But then on the retry, after the sleep(1), the connect() fails with an invalid argument. And this repeats 10 times around the client's connect() loop until the client gives up. It's the invalid argument errors that I don't understand. I looked at the xnu kernel sources, AFAICT the only way to get EINVAL from connect() is to make the 3rd arg (address_len) too small but that's definitely not the case. Besides, if we don't get EINVAL on the first try, why should we get it on subsequent tries with identical arguments? Finally, the server process never shuts down, it just hangs waiting for accept(), which complicates subsequent runs. Any ideas? I attach a version which prints messages before and after each network operation, which makes it easier to debug. Nick |
|
From: <sv...@va...> - 2009-04-28 05:36:06
|
Author: njn
Date: 2009-04-28 06:35:53 +0100 (Tue, 28 Apr 2009)
New Revision: 9658
Log:
Merged r9657 (fdleak fixes) from the DARWIN branch.
Modified:
trunk/coregrind/m_libcfile.c
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/none/tests/fdleak.h
trunk/none/tests/fdleak_cmsg.c
trunk/none/tests/fdleak_cmsg.stderr.exp
trunk/none/tests/fdleak_creat.c
trunk/none/tests/fdleak_creat.stderr.exp
trunk/none/tests/fdleak_dup.c
trunk/none/tests/fdleak_dup.stderr.exp
trunk/none/tests/fdleak_dup2.c
trunk/none/tests/fdleak_dup2.stderr.exp
trunk/none/tests/fdleak_fcntl.c
trunk/none/tests/fdleak_fcntl.stderr.exp
trunk/none/tests/fdleak_ipv4.c
trunk/none/tests/fdleak_ipv4.stderr.exp
trunk/none/tests/fdleak_open.c
trunk/none/tests/fdleak_open.stderr.exp
trunk/none/tests/fdleak_pipe.c
trunk/none/tests/fdleak_pipe.stderr.exp
trunk/none/tests/fdleak_socketpair.c
trunk/none/tests/fdleak_socketpair.stderr.exp
trunk/none/tests/filter_fdleak
Modified: trunk/coregrind/m_libcfile.c
===================================================================
--- trunk/coregrind/m_libcfile.c 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/coregrind/m_libcfile.c 2009-04-28 05:35:53 UTC (rev 9658)
@@ -74,15 +74,20 @@
or if it doesn't exist, we return False. */
Bool VG_(resolve_filename) ( Int fd, HChar* buf, Int n_buf )
{
+# if defined(VGO_linux)
HChar tmp[64];
-
VG_(sprintf)(tmp, "/proc/self/fd/%d", fd);
VG_(memset)(buf, 0, n_buf);
-
if (VG_(readlink)(tmp, buf, n_buf) > 0 && buf[0] == '/')
return True;
else
return False;
+# elif defined(VGO_aix5)
+ I_die_here; /* maybe just return False? */
+ return False;
+# else
+# error "need fd-to-filename for this OS"
+# endif
}
SysRes VG_(open) ( const Char* pathname, Int flags, Int mode )
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2009-04-28 05:35:53 UTC (rev 9658)
@@ -704,13 +704,12 @@
VG_(message)(Vg_UserMsg, "");
}
-/* If /proc/self/fd doesn't exist for some weird reason (like you've
- got a kernel that doesn't have /proc support compiled in), then we
- need to find out what file descriptors we inherited from our parent
- process the hard way - by checking each fd in turn. */
-
+/* If /proc/self/fd doesn't exist (e.g. you've got a Linux kernel that doesn't
+ have /proc support compiled in, or a non-Linux kernel), then we need to
+ find out what file descriptors we inherited from our parent process the
+ hard way - by checking each fd in turn. */
static
-void do_hacky_preopened(void)
+void init_preopened_fds_without_proc_self_fd(void)
{
struct vki_rlimit lim;
UInt count;
@@ -719,15 +718,15 @@
if (VG_(getrlimit) (VKI_RLIMIT_NOFILE, &lim) == -1) {
/* Hmm. getrlimit() failed. Now we're screwed, so just choose
an arbitrarily high number. 1024 happens to be the limit in
- the 2.4 kernels. */
+ the 2.4 Linux kernels. */
count = 1024;
} else {
count = lim.rlim_cur;
}
for (i = 0; i < count; i++)
- if(VG_(fcntl)(i, VKI_F_GETFL, 0) != -1)
- ML_(record_fd_open_nameless)(-1, i);
+ if (VG_(fcntl)(i, VKI_F_GETFL, 0) != -1)
+ ML_(record_fd_open_named)(-1, i);
}
/* Initialize the list of open file descriptors with the file descriptors
@@ -735,13 +734,15 @@
void VG_(init_preopened_fds)(void)
{
+// Nb: AIX5 is handled in syswrap-aix5.c.
+#if defined(VGO_linux)
Int ret;
struct vki_dirent d;
SysRes f;
f = VG_(open)("/proc/self/fd", VKI_O_RDONLY, 0);
if (f.isError) {
- do_hacky_preopened();
+ init_preopened_fds_without_proc_self_fd();
return;
}
@@ -767,6 +768,10 @@
out:
VG_(close)(f.res);
+
+#else
+# error Unknown OS
+#endif
}
static
@@ -1989,6 +1994,7 @@
PRE(sys_ni_syscall)
{
+ // Nb: AIX5 is handled in syswrap-aix5.c.
PRINT("non-existent syscall! (ni_syscall)");
PRE_REG_READ0(long, "ni_syscall");
SET_STATUS_Failure( VKI_ENOSYS );
Modified: trunk/none/tests/fdleak.h
===================================================================
--- trunk/none/tests/fdleak.h 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak.h 2009-04-28 05:35:53 UTC (rev 9658)
@@ -1,6 +1,19 @@
#ifndef _FDLEAK_H_
#define _FDLEAK_H_
+#include <stdlib.h>
+#include <stdio.h>
+
+#define DO(op) \
+ ({ \
+ long res = op; \
+ if (res < 0) { \
+ perror(#op); \
+ exit(1); \
+ }; \
+ res; \
+ })
+
/*
* The macro below closes file descriptors inherited from the process
* that forked the current process. Close these file descriptors right
Modified: trunk/none/tests/fdleak_cmsg.c
===================================================================
--- trunk/none/tests/fdleak_cmsg.c 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_cmsg.c 2009-04-28 05:35:53 UTC (rev 9658)
@@ -33,45 +33,23 @@
char fileb[24];
char sock[24];
-void
-server (void)
+void server (void)
{
int s, fd1, fd2;
struct sockaddr_un addr;
- fd1 = open(filea, O_RDWR | O_CREAT | O_TRUNC, 0750);
- if(fd1 == -1) {
- perror("open");
- exit(1);
- }
+ fd1 = DO( open(filea, O_RDWR | O_CREAT | O_TRUNC, 0750) );
+ fd2 = DO( open(fileb, O_RDWR | O_CREAT | O_TRUNC, 0750) );
+ s = DO( socket(PF_UNIX, SOCK_STREAM, 0) );
- fd2 = open(fileb, O_RDWR | O_CREAT | O_TRUNC, 0750);
- if(fd2 == -1) {
- perror("open");
- exit(1);
- }
-
- s = socket(PF_UNIX, SOCK_STREAM, 0);
- if(s == -1) {
- perror("socket");
- exit(1);
- }
-
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
sprintf(addr.sun_path, "%s", sock);
- unlink(addr.sun_path);
- if(bind(s, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
- perror("bind");
- exit(1);
- }
+ unlink(sock);
+ DO( bind(s, (struct sockaddr *)&addr, sizeof(addr)) );
+ DO( listen(s, 5) );
- if(listen(s, 5) == -1) {
- perror("listen");
- exit(1);
- }
-
{
int x;
int baddrsize = 0;
@@ -82,11 +60,7 @@
struct iovec iov[1];
memset(&baddr, 0, sizeof(baddr));
- x = accept(s, (struct sockaddr *)&baddr, &baddrsize);
- if(x == -1) {
- perror("accept");
- exit(1);
- }
+ x = DO( accept(s, (struct sockaddr *)&baddr, &baddrsize) );
msg.msg_control = buf;
msg.msg_controllen = sizeof(buf);
@@ -103,15 +77,11 @@
msg.msg_iov = iov;
msg.msg_iovlen = 1;
- if(sendmsg(x, &msg, 0) == -1) {
- perror("sendmsg");
- exit(1);
- }
+ DO( sendmsg(x, &msg, 0) );
}
}
-void
-client (void)
+void client (void)
{
int s, fd1 = -1, fd2 = -1, size, count = 0, ret;
struct sockaddr_un addr;
@@ -129,7 +99,7 @@
iov[0].iov_len = sizeof(buf);
s = socket(PF_UNIX, SOCK_STREAM, 0);
- if(s == -1) {
+ if (s == -1) {
perror("socket");
exit(1);
}
@@ -140,16 +110,16 @@
do {
count++;
ret = connect(s, (struct sockaddr *)&addr, sizeof(addr));
- if(ret == -1) sleep(1);
+ if (ret == -1) sleep(1);
} while (count < 10 && ret == -1);
- if(ret == -1) {
+ if (ret == -1) {
perror("connect");
exit(1);
}
again:
- if((size = recvmsg(s, &msg, 0)) == -1) {
+ if ((size = recvmsg(s, &msg, 0)) == -1) {
if (errno == EINTR)
goto again; /* SIGCHLD from server exiting could interrupt */
perror("recvmsg");
@@ -158,8 +128,8 @@
cmsg = CMSG_FIRSTHDR(&msg);
- while(cmsg) {
- if(cmsg->cmsg_level == SOL_SOCKET &&
+ while (cmsg) {
+ if (cmsg->cmsg_level == SOL_SOCKET &&
cmsg->cmsg_type == SCM_RIGHTS &&
cmsg->cmsg_len == CMSG_LEN(sizeof(int) * 2)) {
fd1 = ((int *)CMSG_DATA(cmsg))[0];
@@ -169,21 +139,15 @@
cmsg = CMSG_NXTHDR(&msg, cmsg);
}
- if(fd1 != -1) write(fd1, "Yeah 1\n", 8);
- if(fd2 != -1) write(fd2, "Yeah 2\n", 8);
+ if (fd1 != -1) write(fd1, "Yeah 1\n", 8);
+ if (fd2 != -1) write(fd2, "Yeah 2\n", 8);
}
-int
-main (int argc, char **argv)
+int main (int argc, char **argv)
{
int pid, status;
-
-
-
-
-
CLOSE_INHERITED_FDS;
pid = getpid();
@@ -191,7 +155,7 @@
sprintf(fileb, "/tmp/data2.%d", pid);
sprintf(sock, "/tmp/sock.%d", pid);
- if((pid = fork()) == 0) {
+ if ((pid = fork()) == 0) {
server();
return 0;
}
@@ -200,8 +164,8 @@
wait(&status);
- unlink(filea);
- unlink(fileb);
- unlink(sock);
+ DO( unlink(filea) );
+ DO( unlink(fileb) );
+ DO( unlink(sock) );
return 0;
}
Modified: trunk/none/tests/fdleak_cmsg.stderr.exp
===================================================================
--- trunk/none/tests/fdleak_cmsg.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_cmsg.stderr.exp 2009-04-28 05:35:53 UTC (rev 9658)
@@ -1,46 +1,46 @@
FILE DESCRIPTORS: 7 open at exit.
-Open AF_UNIX socket .: /tmp/sock
+Open AF_UNIX socket ...: /tmp/sock
...
-Open AF_UNIX socket .: /tmp/sock
+Open AF_UNIX socket ...: /tmp/sock
...
-Open file descriptor .: /tmp/data2
+Open file descriptor ...: /tmp/data2
...
-Open file descriptor .: /tmp/data1
+Open file descriptor ...: /tmp/data1
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
FILE DESCRIPTORS: 6 open at exit.
-Open file descriptor .: /tmp/data2
+Open file descriptor ...: /tmp/data2
...
-Open file descriptor .: /tmp/data1
+Open file descriptor ...: /tmp/data1
...
-Open AF_UNIX socket .: <unknown>
+Open AF_UNIX socket ...: <unknown>
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: trunk/none/tests/fdleak_creat.c
===================================================================
--- trunk/none/tests/fdleak_creat.c 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_creat.c 2009-04-28 05:35:53 UTC (rev 9658)
@@ -2,20 +2,15 @@
#include <stdio.h>
#include <fcntl.h>
#include "fdleak.h"
-int
-main (int argc, char **argv)
+
+int main (int argc, char **argv)
{
char filename[24];
-
-
-
-
-
CLOSE_INHERITED_FDS;
sprintf(filename, "/tmp/file.%d", getpid());
- creat(filename, 0);
- unlink(filename);
+ DO( creat(filename, 0) );
+ DO( unlink(filename) );
return 0;
}
Modified: trunk/none/tests/fdleak_creat.stderr.exp
===================================================================
--- trunk/none/tests/fdleak_creat.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_creat.stderr.exp 2009-04-28 05:35:53 UTC (rev 9658)
@@ -1,16 +1,16 @@
FILE DESCRIPTORS: 4 open at exit.
-Open file descriptor .: /tmp/file
+Open file descriptor ...: /tmp/file
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: trunk/none/tests/fdleak_dup.c
===================================================================
--- trunk/none/tests/fdleak_dup.c 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_dup.c 2009-04-28 05:35:53 UTC (rev 9658)
@@ -1,19 +1,15 @@
#include <unistd.h>
#include <fcntl.h>
#include "fdleak.h"
-int
-main (int argc, char **argv)
+
+int main (int argc, char **argv)
{
int s;
-
-
-
-
-
CLOSE_INHERITED_FDS;
- s = open("/dev/null", O_RDONLY);
- dup(s);
+ s = DO( open("/dev/null", O_RDONLY) );
+ DO( dup(s) );
+
return 0;
}
Modified: trunk/none/tests/fdleak_dup.stderr.exp
===================================================================
--- trunk/none/tests/fdleak_dup.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_dup.stderr.exp 2009-04-28 05:35:53 UTC (rev 9658)
@@ -1,19 +1,19 @@
FILE DESCRIPTORS: 5 open at exit.
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: trunk/none/tests/fdleak_dup2.c
===================================================================
--- trunk/none/tests/fdleak_dup2.c 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_dup2.c 2009-04-28 05:35:53 UTC (rev 9658)
@@ -1,23 +1,19 @@
#include <unistd.h>
#include <fcntl.h>
#include "fdleak.h"
-int
-main (int argc, char **argv)
+
+int main (int argc, char **argv)
{
int s1;
int s2;
-
-
-
-
-
CLOSE_INHERITED_FDS;
- s1 = open("/dev/null", O_RDONLY);
- s2 = open("/dev/null", O_RDONLY);
+ s1 = DO( open("/dev/null", O_RDONLY) );
+ s2 = DO( open("/dev/null", O_RDONLY) );
- dup2(s1, 20);
- dup2(s1, s2);
+ DO( dup2(s1, 20) ); // dup s1 as fd 20
+ DO( dup2(s1, s2) ); // dup s1 as fd s2, which closes existing s2 fd
+
return 0;
}
Modified: trunk/none/tests/fdleak_dup2.stderr.exp
===================================================================
--- trunk/none/tests/fdleak_dup2.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_dup2.stderr.exp 2009-04-28 05:35:53 UTC (rev 9658)
@@ -1,22 +1,22 @@
FILE DESCRIPTORS: 6 open at exit.
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: trunk/none/tests/fdleak_fcntl.c
===================================================================
--- trunk/none/tests/fdleak_fcntl.c 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_fcntl.c 2009-04-28 05:35:53 UTC (rev 9658)
@@ -2,19 +2,15 @@
#include <stdio.h>
#include <fcntl.h>
#include "fdleak.h"
-int
-main (int argc, char **argv)
+
+int main (int argc, char **argv)
{
int s1;
-
-
-
-
-
CLOSE_INHERITED_FDS;
- s1 = open("/dev/null", O_RDONLY);
- if(fcntl(s1, F_DUPFD, s1) == -1) perror("fcntl");
+ s1 = DO( open("/dev/null", O_RDONLY) );
+ DO( fcntl(s1, F_DUPFD, s1) );
+
return 0;
}
Modified: trunk/none/tests/fdleak_fcntl.stderr.exp
===================================================================
--- trunk/none/tests/fdleak_fcntl.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_fcntl.stderr.exp 2009-04-28 05:35:53 UTC (rev 9658)
@@ -1,19 +1,19 @@
FILE DESCRIPTORS: 5 open at exit.
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: trunk/none/tests/fdleak_ipv4.c
===================================================================
--- trunk/none/tests/fdleak_ipv4.c 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_ipv4.c 2009-04-28 05:35:53 UTC (rev 9658)
@@ -9,59 +9,40 @@
#include <stdlib.h>
#include <string.h>
#include "fdleak.h"
-void
-server ()
+
+void server ()
{
int s, x;
struct sockaddr_in baddr;
struct sockaddr_in addr;
- int baddrsize = sizeof(baddr);
+ socklen_t baddrsize = sizeof(baddr);
int one = 1;
- s = socket(PF_INET, SOCK_STREAM, 0);
- if(s == -1) {
- perror("socket");
- exit(1);
- }
+ s = DO( socket(PF_INET, SOCK_STREAM, 0) );
- setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(int));
+ DO( setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(int)) );
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
addr.sin_port = 12321;
- if(bind(s, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
- perror("bind");
- exit(1);
- }
+ DO( bind(s, (struct sockaddr *)&addr, sizeof(addr)) );
- if(listen(s, 5) == -1) {
- perror("listen");
- exit(1);
- }
+ DO( listen(s, 5) );
memset(&baddr, 0, sizeof(baddr));
- x = accept(s, (struct sockaddr *)&baddr, &baddrsize);
- if(x == -1) {
- perror("accept");
- exit(1);
- }
+ x = DO( accept(s, (struct sockaddr *)&baddr, &baddrsize) );
- write(x, "hello", 6);
+ DO( write(x, "hello", 6) );
}
-void
-client ()
+void client ()
{
int s, count = 0, ret;
struct sockaddr_in addr;
char buf[1024];
- s = socket(PF_INET, SOCK_STREAM, 0);
- if(s == -1) {
- perror("socket");
- exit(1);
- }
+ s = DO( socket(PF_INET, SOCK_STREAM, 0) );
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
@@ -70,33 +51,27 @@
do {
count++;
ret = connect(s, (struct sockaddr *)&addr, sizeof(addr));
- if(ret == -1) sleep(1);
+ if (ret == -1) sleep(1);
} while (count < 10 && ret == -1);
- if(ret == -1) {
+ if (ret == -1) {
perror("connect");
exit(1);
}
- read(s, buf, sizeof(buf));
+ DO( read(s, buf, sizeof(buf)) );
printf("%s\n", buf);
}
-int
-main (int argc, char **argv)
+int main (int argc, char **argv)
{
int pid, status;
-
-
-
-
-
CLOSE_INHERITED_FDS;
- if((pid = fork()) == 0) {
+ if ((pid = fork()) == 0) {
server();
return 0;
}
Modified: trunk/none/tests/fdleak_ipv4.stderr.exp
===================================================================
--- trunk/none/tests/fdleak_ipv4.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_ipv4.stderr.exp 2009-04-28 05:35:53 UTC (rev 9658)
@@ -7,13 +7,13 @@
Open AF_INET socket 3: 127.0.0.1:... <-> unbound
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
@@ -22,13 +22,13 @@
Open AF_INET socket 3: 127.0.0.1:... <-> 127.0.0.1:...
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: trunk/none/tests/fdleak_open.c
===================================================================
--- trunk/none/tests/fdleak_open.c 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_open.c 2009-04-28 05:35:53 UTC (rev 9658)
@@ -2,14 +2,11 @@
#include <unistd.h>
#include "fdleak.h"
-int
-main (int argc, char **argv)
+int main (int argc, char **argv)
{
-
-
-
CLOSE_INHERITED_FDS;
- open("/dev/null", O_RDONLY);
+ DO( open("/dev/null", O_RDONLY) );
+
return 0;
}
Modified: trunk/none/tests/fdleak_open.stderr.exp
===================================================================
--- trunk/none/tests/fdleak_open.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_open.stderr.exp 2009-04-28 05:35:53 UTC (rev 9658)
@@ -1,16 +1,16 @@
FILE DESCRIPTORS: 4 open at exit.
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: trunk/none/tests/fdleak_pipe.c
===================================================================
--- trunk/none/tests/fdleak_pipe.c 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_pipe.c 2009-04-28 05:35:53 UTC (rev 9658)
@@ -1,17 +1,13 @@
#include <unistd.h>
#include "fdleak.h"
-int
-main (int argc, char **argv)
+
+int main (int argc, char **argv)
{
int fds[2];
-
-
-
-
-
CLOSE_INHERITED_FDS;
- pipe(fds);
+ DO( pipe(fds) );
+
return 0;
}
Modified: trunk/none/tests/fdleak_pipe.stderr.exp
===================================================================
--- trunk/none/tests/fdleak_pipe.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_pipe.stderr.exp 2009-04-28 05:35:53 UTC (rev 9658)
@@ -1,19 +1,19 @@
FILE DESCRIPTORS: 5 open at exit.
-Open file descriptor .:
+Open file descriptor ...:
...
-Open file descriptor .:
+Open file descriptor ...:
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: trunk/none/tests/fdleak_socketpair.c
===================================================================
--- trunk/none/tests/fdleak_socketpair.c 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_socketpair.c 2009-04-28 05:35:53 UTC (rev 9658)
@@ -1,17 +1,15 @@
#include <sys/socket.h>
#include <unistd.h>
#include "fdleak.h"
+#include <sys/errno.h>
-int
-main (int argc, char **argv)
+int main (int argc, char **argv)
{
int fds[2];
-
-
-
CLOSE_INHERITED_FDS;
- socketpair(AF_UNIX, SOCK_STREAM, PF_UNIX, fds);
+ DO( socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, fds) );
+
return 0;
}
Modified: trunk/none/tests/fdleak_socketpair.stderr.exp
===================================================================
--- trunk/none/tests/fdleak_socketpair.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/fdleak_socketpair.stderr.exp 2009-04-28 05:35:53 UTC (rev 9658)
@@ -1,19 +1,19 @@
FILE DESCRIPTORS: 5 open at exit.
-Open AF_UNIX socket .: <unknown>
+Open AF_UNIX socket ...: <unknown>
...
-Open AF_UNIX socket .: <unknown>
+Open AF_UNIX socket ...: <unknown>
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: trunk/none/tests/filter_fdleak
===================================================================
--- trunk/none/tests/filter_fdleak 2009-04-28 05:23:57 UTC (rev 9657)
+++ trunk/none/tests/filter_fdleak 2009-04-28 05:35:53 UTC (rev 9658)
@@ -2,14 +2,16 @@
dir=`dirname $0`
-./filter_stderr |
+./filter_stderr |
-sed s/"^Open AF_UNIX socket [0-9]*: <unknown>/Open AF_UNIX socket .: <unknown>/" |
-sed s/"^Open \(AF_UNIX socket\|file descriptor\) [0-9]*: \/dev\/null/Open \\1 .: \/dev\/null/" |
-sed s/"^Open \(AF_UNIX socket\|file descriptor\) [0-9]*: \/tmp\/\(sock\|data1\|data2\|file\)\.[0-9]*/Open \\1 .: \/tmp\/\\2/" |
-sed s/"^Open file descriptor [0-9]*: .*/Open file descriptor .: ./" |
-sed s/"^Open file descriptor [0-9]*:$/Open file descriptor .:/" |
-sed s/"127.0.0.1:[0-9]*/127.0.0.1:.../g" |
+perl -p -e 's/^Open AF_UNIX socket [0-9]*: <unknown>/Open AF_UNIX socket ...: <unknown>/' |
+perl -p -e 's/^Open (AF_UNIX socket|file descriptor) [0-9]*: \/dev\/null/Open $1 ...: \/dev\/null/' |
+# Nb: on Darwin, /tmp is a symlink to /private/tmp, so sometimes it's
+# necessary to filter out the "/private" part.
+perl -p -e 's/^Open (AF_UNIX socket|file descriptor) [0-9]*: (\/private)?\/tmp\/(sock|data1|data2|file)\.[0-9]*/Open $1 ...: \/tmp\/$3/' |
+perl -p -e 's/^Open file descriptor [0-9]*: .*/Open file descriptor ...: .../' |
+perl -p -e 's/^Open file descriptor [0-9]*:$/Open file descriptor ...:/' |
+perl -p -e 's/127.0.0.1:[0-9]*/127.0.0.1:.../g' |
# Stack traces showing where fds were created have lots of variations:
# different numbers of entries, line numbers or not depending on whether
|
|
From: <sv...@va...> - 2009-04-28 05:24:11
|
Author: njn
Date: 2009-04-28 06:23:57 +0100 (Tue, 28 Apr 2009)
New Revision: 9657
Log:
Numerous fixes related to --track-fds=yes.
- Activated fd initialisation on Darwin.
- Turned on the post-syscall wrapper for dup2, it was missing.
- Made fdleak_* tests more robust by checking for failure of basic
operations. Also tweaked their layout.
- Made fdleak_socketpair work on Darwin by changing the protocol.
- Fixed filter_fdleak by using perl instead of sed
- Tweaked fdleak_*.stderr.exp for readability
All fdleak tests except fdleak_ipv4 now pass.
Modified:
branches/DARWIN/coregrind/m_libcfile.c
branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c
branches/DARWIN/none/tests/fdleak.h
branches/DARWIN/none/tests/fdleak_cmsg.c
branches/DARWIN/none/tests/fdleak_cmsg.stderr.exp
branches/DARWIN/none/tests/fdleak_creat.c
branches/DARWIN/none/tests/fdleak_creat.stderr.exp
branches/DARWIN/none/tests/fdleak_dup.c
branches/DARWIN/none/tests/fdleak_dup.stderr.exp
branches/DARWIN/none/tests/fdleak_dup2.c
branches/DARWIN/none/tests/fdleak_dup2.stderr.exp
branches/DARWIN/none/tests/fdleak_fcntl.c
branches/DARWIN/none/tests/fdleak_fcntl.stderr.exp
branches/DARWIN/none/tests/fdleak_ipv4.c
branches/DARWIN/none/tests/fdleak_ipv4.stderr.exp
branches/DARWIN/none/tests/fdleak_open.c
branches/DARWIN/none/tests/fdleak_open.stderr.exp
branches/DARWIN/none/tests/fdleak_pipe.c
branches/DARWIN/none/tests/fdleak_pipe.stderr.exp
branches/DARWIN/none/tests/fdleak_socketpair.c
branches/DARWIN/none/tests/fdleak_socketpair.stderr.exp
branches/DARWIN/none/tests/filter_fdleak
Modified: branches/DARWIN/coregrind/m_libcfile.c
===================================================================
--- branches/DARWIN/coregrind/m_libcfile.c 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/coregrind/m_libcfile.c 2009-04-28 05:23:57 UTC (rev 9657)
@@ -88,7 +88,6 @@
else
return False;
# elif defined(VGO_darwin)
- // GrP Leopard only, I think
HChar tmp[VKI_MAXPATHLEN+1];
if (0 == VG_(fcntl)(fd, VKI_F_GETPATH, (UWord)tmp)) {
if (n_buf > 0) {
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-04-28 05:23:57 UTC (rev 9657)
@@ -264,6 +264,8 @@
mach_msg(&msg, MACH_SEND_MSG|MACH_MSG_OPTION_NONE,
sizeof(msg), 0, 0, MACH_MSG_TIMEOUT_NONE, 0);
+ // DDD: This is reached sometimes on none/tests/manythreads, maybe
+ // because of the race above.
VG_(core_panic)("Thread exit failed?\n");
}
@@ -7044,7 +7046,7 @@
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(87)), // old gethostname
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(88)), // old sethostname
MACXY(__NR_getdtablesize, sys_getdtablesize),
- GENX_(__NR_dup2, sys_dup2),
+ GENXY(__NR_dup2, sys_dup2),
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(91)), // old getdopt
MACXY(__NR_fcntl, sys_fcntl),
GENX_(__NR_select, sys_select),
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c 2009-04-28 05:23:57 UTC (rev 9657)
@@ -738,14 +738,12 @@
VG_(message)(Vg_UserMsg, "");
}
-#if !defined(VGO_darwin)
-/* If /proc/self/fd doesn't exist for some weird reason (like you've
- got a kernel that doesn't have /proc support compiled in), then we
- need to find out what file descriptors we inherited from our parent
- process the hard way - by checking each fd in turn. */
-
+/* If /proc/self/fd doesn't exist (e.g. you've got a Linux kernel that doesn't
+ have /proc support compiled in, or a non-Linux kernel), then we need to
+ find out what file descriptors we inherited from our parent process the
+ hard way - by checking each fd in turn. */
static
-void do_hacky_preopened(void)
+void init_preopened_fds_without_proc_self_fd(void)
{
struct vki_rlimit lim;
UInt count;
@@ -754,33 +752,31 @@
if (VG_(getrlimit) (VKI_RLIMIT_NOFILE, &lim) == -1) {
/* Hmm. getrlimit() failed. Now we're screwed, so just choose
an arbitrarily high number. 1024 happens to be the limit in
- the 2.4 kernels. */
+ the 2.4 Linux kernels. */
count = 1024;
} else {
count = lim.rlim_cur;
}
for (i = 0; i < count; i++)
- if(VG_(fcntl)(i, VKI_F_GETFL, 0) != -1)
- ML_(record_fd_open_nameless)(-1, i);
+ if (VG_(fcntl)(i, VKI_F_GETFL, 0) != -1)
+ ML_(record_fd_open_named)(-1, i);
}
-#endif
/* Initialize the list of open file descriptors with the file descriptors
we inherited from out parent process. */
void VG_(init_preopened_fds)(void)
{
-#if defined(VGO_darwin)
- // DDD: #warning GrP fixme preopened fds
-#else
+// Nb: AIX5 is handled in syswrap-aix5.c.
+#if defined(VGO_linux)
Int ret;
struct vki_dirent d;
SysRes f;
f = VG_(open)("/proc/self/fd", VKI_O_RDONLY, 0);
if (sr_isError(f)) {
- do_hacky_preopened();
+ init_preopened_fds_without_proc_self_fd();
return;
}
@@ -806,6 +802,12 @@
out:
VG_(close)(sr_Res(f));
+
+#elif defined(VGO_darwin)
+ init_preopened_fds_without_proc_self_fd();
+
+#else
+# error Unknown OS
#endif
}
@@ -2111,7 +2113,8 @@
PRE(sys_ni_syscall)
{
PRINT("unimplemented (by the kernel) syscall %ld! (ni_syscall)\n",
-#if defined(VGO_linux) || defined(VGO_aix5)
+// Nb: AIX5 is handled in syswrap-aix5.c.
+#if defined(VGO_linux)
SYSNO
#elif defined(VGO_darwin)
VG_DARWIN_SYSNO_PRINT(SYSNO)
Modified: branches/DARWIN/none/tests/fdleak.h
===================================================================
--- branches/DARWIN/none/tests/fdleak.h 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak.h 2009-04-28 05:23:57 UTC (rev 9657)
@@ -1,6 +1,19 @@
#ifndef _FDLEAK_H_
#define _FDLEAK_H_
+#include <stdlib.h>
+#include <stdio.h>
+
+#define DO(op) \
+ ({ \
+ long res = op; \
+ if (res < 0) { \
+ perror(#op); \
+ exit(1); \
+ }; \
+ res; \
+ })
+
/*
* The macro below closes file descriptors inherited from the process
* that forked the current process. Close these file descriptors right
Modified: branches/DARWIN/none/tests/fdleak_cmsg.c
===================================================================
--- branches/DARWIN/none/tests/fdleak_cmsg.c 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_cmsg.c 2009-04-28 05:23:57 UTC (rev 9657)
@@ -33,45 +33,23 @@
char fileb[24];
char sock[24];
-void
-server (void)
+void server (void)
{
int s, fd1, fd2;
struct sockaddr_un addr;
- fd1 = open(filea, O_RDWR | O_CREAT | O_TRUNC, 0750);
- if(fd1 == -1) {
- perror("open");
- exit(1);
- }
+ fd1 = DO( open(filea, O_RDWR | O_CREAT | O_TRUNC, 0750) );
+ fd2 = DO( open(fileb, O_RDWR | O_CREAT | O_TRUNC, 0750) );
+ s = DO( socket(PF_UNIX, SOCK_STREAM, 0) );
- fd2 = open(fileb, O_RDWR | O_CREAT | O_TRUNC, 0750);
- if(fd2 == -1) {
- perror("open");
- exit(1);
- }
-
- s = socket(PF_UNIX, SOCK_STREAM, 0);
- if(s == -1) {
- perror("socket");
- exit(1);
- }
-
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
sprintf(addr.sun_path, "%s", sock);
- unlink(addr.sun_path);
- if(bind(s, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
- perror("bind");
- exit(1);
- }
+ unlink(sock);
+ DO( bind(s, (struct sockaddr *)&addr, sizeof(addr)) );
+ DO( listen(s, 5) );
- if(listen(s, 5) == -1) {
- perror("listen");
- exit(1);
- }
-
{
int x;
int baddrsize = 0;
@@ -82,11 +60,7 @@
struct iovec iov[1];
memset(&baddr, 0, sizeof(baddr));
- x = accept(s, (struct sockaddr *)&baddr, &baddrsize);
- if(x == -1) {
- perror("accept");
- exit(1);
- }
+ x = DO( accept(s, (struct sockaddr *)&baddr, &baddrsize) );
msg.msg_control = buf;
msg.msg_controllen = sizeof(buf);
@@ -103,15 +77,11 @@
msg.msg_iov = iov;
msg.msg_iovlen = 1;
- if(sendmsg(x, &msg, 0) == -1) {
- perror("sendmsg");
- exit(1);
- }
+ DO( sendmsg(x, &msg, 0) );
}
}
-void
-client (void)
+void client (void)
{
int s, fd1 = -1, fd2 = -1, size, count = 0, ret;
struct sockaddr_un addr;
@@ -129,7 +99,7 @@
iov[0].iov_len = sizeof(buf);
s = socket(PF_UNIX, SOCK_STREAM, 0);
- if(s == -1) {
+ if (s == -1) {
perror("socket");
exit(1);
}
@@ -140,16 +110,16 @@
do {
count++;
ret = connect(s, (struct sockaddr *)&addr, sizeof(addr));
- if(ret == -1) sleep(1);
+ if (ret == -1) sleep(1);
} while (count < 10 && ret == -1);
- if(ret == -1) {
+ if (ret == -1) {
perror("connect");
exit(1);
}
again:
- if((size = recvmsg(s, &msg, 0)) == -1) {
+ if ((size = recvmsg(s, &msg, 0)) == -1) {
if (errno == EINTR)
goto again; /* SIGCHLD from server exiting could interrupt */
perror("recvmsg");
@@ -158,8 +128,8 @@
cmsg = CMSG_FIRSTHDR(&msg);
- while(cmsg) {
- if(cmsg->cmsg_level == SOL_SOCKET &&
+ while (cmsg) {
+ if (cmsg->cmsg_level == SOL_SOCKET &&
cmsg->cmsg_type == SCM_RIGHTS &&
cmsg->cmsg_len == CMSG_LEN(sizeof(int) * 2)) {
fd1 = ((int *)CMSG_DATA(cmsg))[0];
@@ -169,21 +139,15 @@
cmsg = CMSG_NXTHDR(&msg, cmsg);
}
- if(fd1 != -1) write(fd1, "Yeah 1\n", 8);
- if(fd2 != -1) write(fd2, "Yeah 2\n", 8);
+ if (fd1 != -1) write(fd1, "Yeah 1\n", 8);
+ if (fd2 != -1) write(fd2, "Yeah 2\n", 8);
}
-int
-main (int argc, char **argv)
+int main (int argc, char **argv)
{
int pid, status;
-
-
-
-
-
CLOSE_INHERITED_FDS;
pid = getpid();
@@ -191,7 +155,7 @@
sprintf(fileb, "/tmp/data2.%d", pid);
sprintf(sock, "/tmp/sock.%d", pid);
- if((pid = fork()) == 0) {
+ if ((pid = fork()) == 0) {
server();
return 0;
}
@@ -200,8 +164,8 @@
wait(&status);
- unlink(filea);
- unlink(fileb);
- unlink(sock);
+ DO( unlink(filea) );
+ DO( unlink(fileb) );
+ DO( unlink(sock) );
return 0;
}
Modified: branches/DARWIN/none/tests/fdleak_cmsg.stderr.exp
===================================================================
--- branches/DARWIN/none/tests/fdleak_cmsg.stderr.exp 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_cmsg.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
@@ -1,46 +1,46 @@
FILE DESCRIPTORS: 7 open at exit.
-Open AF_UNIX socket .: /tmp/sock
+Open AF_UNIX socket ...: /tmp/sock
...
-Open AF_UNIX socket .: /tmp/sock
+Open AF_UNIX socket ...: /tmp/sock
...
-Open file descriptor .: /tmp/data2
+Open file descriptor ...: /tmp/data2
...
-Open file descriptor .: /tmp/data1
+Open file descriptor ...: /tmp/data1
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
FILE DESCRIPTORS: 6 open at exit.
-Open file descriptor .: /tmp/data2
+Open file descriptor ...: /tmp/data2
...
-Open file descriptor .: /tmp/data1
+Open file descriptor ...: /tmp/data1
...
-Open AF_UNIX socket .: <unknown>
+Open AF_UNIX socket ...: <unknown>
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: branches/DARWIN/none/tests/fdleak_creat.c
===================================================================
--- branches/DARWIN/none/tests/fdleak_creat.c 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_creat.c 2009-04-28 05:23:57 UTC (rev 9657)
@@ -2,20 +2,15 @@
#include <stdio.h>
#include <fcntl.h>
#include "fdleak.h"
-int
-main (int argc, char **argv)
+
+int main (int argc, char **argv)
{
char filename[24];
-
-
-
-
-
CLOSE_INHERITED_FDS;
sprintf(filename, "/tmp/file.%d", getpid());
- creat(filename, 0);
- unlink(filename);
+ DO( creat(filename, 0) );
+ DO( unlink(filename) );
return 0;
}
Modified: branches/DARWIN/none/tests/fdleak_creat.stderr.exp
===================================================================
--- branches/DARWIN/none/tests/fdleak_creat.stderr.exp 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_creat.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
@@ -1,16 +1,16 @@
FILE DESCRIPTORS: 4 open at exit.
-Open file descriptor .: /tmp/file
+Open file descriptor ...: /tmp/file
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: branches/DARWIN/none/tests/fdleak_dup.c
===================================================================
--- branches/DARWIN/none/tests/fdleak_dup.c 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_dup.c 2009-04-28 05:23:57 UTC (rev 9657)
@@ -1,19 +1,15 @@
#include <unistd.h>
#include <fcntl.h>
#include "fdleak.h"
-int
-main (int argc, char **argv)
+
+int main (int argc, char **argv)
{
int s;
-
-
-
-
-
CLOSE_INHERITED_FDS;
- s = open("/dev/null", O_RDONLY);
- dup(s);
+ s = DO( open("/dev/null", O_RDONLY) );
+ DO( dup(s) );
+
return 0;
}
Modified: branches/DARWIN/none/tests/fdleak_dup.stderr.exp
===================================================================
--- branches/DARWIN/none/tests/fdleak_dup.stderr.exp 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_dup.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
@@ -1,19 +1,19 @@
FILE DESCRIPTORS: 5 open at exit.
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: branches/DARWIN/none/tests/fdleak_dup2.c
===================================================================
--- branches/DARWIN/none/tests/fdleak_dup2.c 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_dup2.c 2009-04-28 05:23:57 UTC (rev 9657)
@@ -1,23 +1,19 @@
#include <unistd.h>
#include <fcntl.h>
#include "fdleak.h"
-int
-main (int argc, char **argv)
+
+int main (int argc, char **argv)
{
int s1;
int s2;
-
-
-
-
-
CLOSE_INHERITED_FDS;
- s1 = open("/dev/null", O_RDONLY);
- s2 = open("/dev/null", O_RDONLY);
+ s1 = DO( open("/dev/null", O_RDONLY) );
+ s2 = DO( open("/dev/null", O_RDONLY) );
- dup2(s1, 20);
- dup2(s1, s2);
+ DO( dup2(s1, 20) ); // dup s1 as fd 20
+ DO( dup2(s1, s2) ); // dup s1 as fd s2, which closes existing s2 fd
+
return 0;
}
Modified: branches/DARWIN/none/tests/fdleak_dup2.stderr.exp
===================================================================
--- branches/DARWIN/none/tests/fdleak_dup2.stderr.exp 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_dup2.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
@@ -1,22 +1,22 @@
FILE DESCRIPTORS: 6 open at exit.
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: branches/DARWIN/none/tests/fdleak_fcntl.c
===================================================================
--- branches/DARWIN/none/tests/fdleak_fcntl.c 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_fcntl.c 2009-04-28 05:23:57 UTC (rev 9657)
@@ -2,19 +2,15 @@
#include <stdio.h>
#include <fcntl.h>
#include "fdleak.h"
-int
-main (int argc, char **argv)
+
+int main (int argc, char **argv)
{
int s1;
-
-
-
-
-
CLOSE_INHERITED_FDS;
- s1 = open("/dev/null", O_RDONLY);
- if(fcntl(s1, F_DUPFD, s1) == -1) perror("fcntl");
+ s1 = DO( open("/dev/null", O_RDONLY) );
+ DO( fcntl(s1, F_DUPFD, s1) );
+
return 0;
}
Modified: branches/DARWIN/none/tests/fdleak_fcntl.stderr.exp
===================================================================
--- branches/DARWIN/none/tests/fdleak_fcntl.stderr.exp 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_fcntl.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
@@ -1,19 +1,19 @@
FILE DESCRIPTORS: 5 open at exit.
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: branches/DARWIN/none/tests/fdleak_ipv4.c
===================================================================
--- branches/DARWIN/none/tests/fdleak_ipv4.c 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_ipv4.c 2009-04-28 05:23:57 UTC (rev 9657)
@@ -9,59 +9,40 @@
#include <stdlib.h>
#include <string.h>
#include "fdleak.h"
-void
-server ()
+
+void server ()
{
int s, x;
struct sockaddr_in baddr;
struct sockaddr_in addr;
- int baddrsize = sizeof(baddr);
+ socklen_t baddrsize = sizeof(baddr);
int one = 1;
- s = socket(PF_INET, SOCK_STREAM, 0);
- if(s == -1) {
- perror("socket");
- exit(1);
- }
+ s = DO( socket(PF_INET, SOCK_STREAM, 0) );
- setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(int));
+ DO( setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(int)) );
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
addr.sin_port = 12321;
- if(bind(s, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
- perror("bind");
- exit(1);
- }
+ DO( bind(s, (struct sockaddr *)&addr, sizeof(addr)) );
- if(listen(s, 5) == -1) {
- perror("listen");
- exit(1);
- }
+ DO( listen(s, 5) );
memset(&baddr, 0, sizeof(baddr));
- x = accept(s, (struct sockaddr *)&baddr, &baddrsize);
- if(x == -1) {
- perror("accept");
- exit(1);
- }
+ x = DO( accept(s, (struct sockaddr *)&baddr, &baddrsize) );
- write(x, "hello", 6);
+ DO( write(x, "hello", 6) );
}
-void
-client ()
+void client ()
{
int s, count = 0, ret;
struct sockaddr_in addr;
char buf[1024];
- s = socket(PF_INET, SOCK_STREAM, 0);
- if(s == -1) {
- perror("socket");
- exit(1);
- }
+ s = DO( socket(PF_INET, SOCK_STREAM, 0) );
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
@@ -70,33 +51,27 @@
do {
count++;
ret = connect(s, (struct sockaddr *)&addr, sizeof(addr));
- if(ret == -1) sleep(1);
+ if (ret == -1) sleep(1);
} while (count < 10 && ret == -1);
- if(ret == -1) {
+ if (ret == -1) {
perror("connect");
exit(1);
}
- read(s, buf, sizeof(buf));
+ DO( read(s, buf, sizeof(buf)) );
printf("%s\n", buf);
}
-int
-main (int argc, char **argv)
+int main (int argc, char **argv)
{
int pid, status;
-
-
-
-
-
CLOSE_INHERITED_FDS;
- if((pid = fork()) == 0) {
+ if ((pid = fork()) == 0) {
server();
return 0;
}
Modified: branches/DARWIN/none/tests/fdleak_ipv4.stderr.exp
===================================================================
--- branches/DARWIN/none/tests/fdleak_ipv4.stderr.exp 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_ipv4.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
@@ -7,13 +7,13 @@
Open AF_INET socket 3: 127.0.0.1:... <-> unbound
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
@@ -22,13 +22,13 @@
Open AF_INET socket 3: 127.0.0.1:... <-> 127.0.0.1:...
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: branches/DARWIN/none/tests/fdleak_open.c
===================================================================
--- branches/DARWIN/none/tests/fdleak_open.c 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_open.c 2009-04-28 05:23:57 UTC (rev 9657)
@@ -2,14 +2,11 @@
#include <unistd.h>
#include "fdleak.h"
-int
-main (int argc, char **argv)
+int main (int argc, char **argv)
{
-
-
-
CLOSE_INHERITED_FDS;
- open("/dev/null", O_RDONLY);
+ DO( open("/dev/null", O_RDONLY) );
+
return 0;
}
Modified: branches/DARWIN/none/tests/fdleak_open.stderr.exp
===================================================================
--- branches/DARWIN/none/tests/fdleak_open.stderr.exp 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_open.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
@@ -1,16 +1,16 @@
FILE DESCRIPTORS: 4 open at exit.
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: branches/DARWIN/none/tests/fdleak_pipe.c
===================================================================
--- branches/DARWIN/none/tests/fdleak_pipe.c 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_pipe.c 2009-04-28 05:23:57 UTC (rev 9657)
@@ -1,17 +1,13 @@
#include <unistd.h>
#include "fdleak.h"
-int
-main (int argc, char **argv)
+
+int main (int argc, char **argv)
{
int fds[2];
-
-
-
-
-
CLOSE_INHERITED_FDS;
- pipe(fds);
+ DO( pipe(fds) );
+
return 0;
}
Modified: branches/DARWIN/none/tests/fdleak_pipe.stderr.exp
===================================================================
--- branches/DARWIN/none/tests/fdleak_pipe.stderr.exp 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_pipe.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
@@ -1,19 +1,19 @@
FILE DESCRIPTORS: 5 open at exit.
-Open file descriptor .:
+Open file descriptor ...:
...
-Open file descriptor .:
+Open file descriptor ...:
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: branches/DARWIN/none/tests/fdleak_socketpair.c
===================================================================
--- branches/DARWIN/none/tests/fdleak_socketpair.c 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_socketpair.c 2009-04-28 05:23:57 UTC (rev 9657)
@@ -1,17 +1,15 @@
#include <sys/socket.h>
#include <unistd.h>
#include "fdleak.h"
+#include <sys/errno.h>
-int
-main (int argc, char **argv)
+int main (int argc, char **argv)
{
int fds[2];
-
-
-
CLOSE_INHERITED_FDS;
- socketpair(AF_UNIX, SOCK_STREAM, PF_UNIX, fds);
+ DO( socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, fds) );
+
return 0;
}
Modified: branches/DARWIN/none/tests/fdleak_socketpair.stderr.exp
===================================================================
--- branches/DARWIN/none/tests/fdleak_socketpair.stderr.exp 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/fdleak_socketpair.stderr.exp 2009-04-28 05:23:57 UTC (rev 9657)
@@ -1,19 +1,19 @@
FILE DESCRIPTORS: 5 open at exit.
-Open AF_UNIX socket .: <unknown>
+Open AF_UNIX socket ...: <unknown>
...
-Open AF_UNIX socket .: <unknown>
+Open AF_UNIX socket ...: <unknown>
...
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: .
+Open file descriptor ...: ...
<inherited from parent>
-Open file descriptor .: /dev/null
+Open file descriptor ...: /dev/null
<inherited from parent>
Modified: branches/DARWIN/none/tests/filter_fdleak
===================================================================
--- branches/DARWIN/none/tests/filter_fdleak 2009-04-28 01:55:01 UTC (rev 9656)
+++ branches/DARWIN/none/tests/filter_fdleak 2009-04-28 05:23:57 UTC (rev 9657)
@@ -2,14 +2,16 @@
dir=`dirname $0`
-./filter_stderr |
+./filter_stderr |
-sed s/"^Open AF_UNIX socket [0-9]*: <unknown>/Open AF_UNIX socket .: <unknown>/" |
-sed s/"^Open \(AF_UNIX socket\|file descriptor\) [0-9]*: \/dev\/null/Open \\1 .: \/dev\/null/" |
-sed s/"^Open \(AF_UNIX socket\|file descriptor\) [0-9]*: \/tmp\/\(sock\|data1\|data2\|file\)\.[0-9]*/Open \\1 .: \/tmp\/\\2/" |
-sed s/"^Open file descriptor [0-9]*: .*/Open file descriptor .: ./" |
-sed s/"^Open file descriptor [0-9]*:$/Open file descriptor .:/" |
-sed s/"127.0.0.1:[0-9]*/127.0.0.1:.../g" |
+perl -p -e 's/^Open AF_UNIX socket [0-9]*: <unknown>/Open AF_UNIX socket ...: <unknown>/' |
+perl -p -e 's/^Open (AF_UNIX socket|file descriptor) [0-9]*: \/dev\/null/Open $1 ...: \/dev\/null/' |
+# Nb: on Darwin, /tmp is a symlink to /private/tmp, so sometimes it's
+# necessary to filter out the "/private" part.
+perl -p -e 's/^Open (AF_UNIX socket|file descriptor) [0-9]*: (\/private)?\/tmp\/(sock|data1|data2|file)\.[0-9]*/Open $1 ...: \/tmp\/$3/' |
+perl -p -e 's/^Open file descriptor [0-9]*: .*/Open file descriptor ...: .../' |
+perl -p -e 's/^Open file descriptor [0-9]*:$/Open file descriptor ...:/' |
+perl -p -e 's/127.0.0.1:[0-9]*/127.0.0.1:.../g' |
# Stack traces showing where fds were created have lots of variations:
# different numbers of entries, line numbers or not depending on whether
|
|
From: Tom H. <th...@cy...> - 2009-04-28 02:43:11
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2009-04-28 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 ... done Regression test results follow == 478 tests, 0 stderr failures, 0 stdout failures, 0 post failures == |
|
From: Tom H. <th...@cy...> - 2009-04-28 02:28:05
|
Nightly build on mg ( x86_64, Fedora 9 ) started at 2009-04-28 03:10: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 == 484 tests, 0 stderr failures, 1 stdout failure, 0 post failures == none/tests/linux/mremap2 (stdout) |
|
From: <sv...@va...> - 2009-04-28 01:55:13
|
Author: njn
Date: 2009-04-28 02:55:01 +0100 (Tue, 28 Apr 2009)
New Revision: 9656
Log:
Merged r9653..r9655 (fixed terminal signal handling in Darwin) from DARWIN
branch.
Added:
trunk/memcheck/tests/filter_addressable
Removed:
trunk/memcheck/tests/addressable.stderr.exp2
Modified:
trunk/coregrind/m_signals.c
trunk/memcheck/tests/Makefile.am
trunk/memcheck/tests/addressable.c
trunk/memcheck/tests/addressable.stderr.exp
trunk/memcheck/tests/addressable.vgtest
Modified: trunk/coregrind/m_signals.c
===================================================================
--- trunk/coregrind/m_signals.c 2009-04-28 01:30:45 UTC (rev 9655)
+++ trunk/coregrind/m_signals.c 2009-04-28 01:55:01 UTC (rev 9656)
@@ -1137,6 +1137,24 @@
VG_(sigprocmask)(VKI_SIG_SETMASK, &origmask, NULL);
}
+// The si_code describes where the signal came from. Some come from the
+// kernel, eg.: seg faults, illegal opcodes. Some come from the user, eg.:
+// from kill() (SI_USER), or timer_settime() (SI_TIMER), or an async I/O
+// request (SI_ASYNCIO). There's lots of implementation-defined leeway in
+// POSIX, but the user vs. kernal distinction is what we want here.
+static Bool is_signal_from_kernel(int si_code)
+{
+#if defined(VGO_linux) || defined(VGO_aix5)
+ // On Linux, SI_USER is zero, negative values are from the user, positive
+ // values are from the kernel. There are SI_FROMUSER and SI_FROMKERNEL
+ // macros but we don't use them here because other platforms don't have
+ // them.
+ return ( si_code > VKI_SI_USER ? True : False );
+#else
+# error Unknown OS
+#endif
+}
+
/*
Perform the default action of a signal. If the signal is fatal, it
marks all threads as needing to exit, but it doesn't actually kill
@@ -1208,15 +1226,17 @@
core = False;
}
- if ( (VG_(clo_verbosity) > 1 || (could_core && info->si_code > VKI_SI_USER))
- && !VG_(clo_xml) ) {
+ if ( (VG_(clo_verbosity) > 1 ||
+ (could_core && is_signal_from_kernel(info->si_code))
+ ) &&
+ !VG_(clo_xml) ) {
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg,
"Process terminating with default action of signal %d (%s)%s",
sigNo, signame(sigNo), core ? ": dumping core" : "");
/* Be helpful - decode some more details about this fault */
- if (info->si_code > VKI_SI_USER) {
+ if (is_signal_from_kernel(info->si_code)) {
const Char *event = NULL;
Bool haveaddr = True;
@@ -1299,7 +1319,7 @@
VG_(pp_ExeContext)( ec );
}
if (sigNo == VKI_SIGSEGV
- && info && info->si_code > VKI_SI_USER
+ && info && is_signal_from_kernel(info->si_code)
&& info->si_code == VKI_SEGV_MAPERR) {
VG_(message)(Vg_UserMsg, " If you believe this happened as a "
"result of a stack overflow in your");
@@ -1744,7 +1764,24 @@
info->si_code = (Short)info->si_code;
#endif
- if (info->si_code <= VKI_SI_USER) {
+ /* // debug code:
+ if (0) {
+ VG_(printf)("info->si_signo %d\n", info->si_signo);
+ VG_(printf)("info->si_errno %d\n", info->si_errno);
+ VG_(printf)("info->si_code %d\n", info->si_code);
+ VG_(printf)("info->si_pid %d\n", info->si_pid);
+ VG_(printf)("info->si_uid %d\n", info->si_uid);
+ VG_(printf)("info->si_status %d\n", info->si_status);
+ VG_(printf)("info->si_addr %p\n", info->si_addr);
+ }
+ */
+
+ /* Figure out if the signal is being sent from outside the process.
+ (Why do we care?) If the signal is from the user rather than the
+ kernel,, then treat it more like an async signal than a sync signal --
+ that is, merely queue it for later delivery. */
+
+ if (!is_signal_from_kernel(info->si_code)) {
/* If some user-process sent us one of these signals (ie,
they're not the result of a faulting instruction), then treat
it as an async signal. This is tricky because we could get
@@ -1812,7 +1849,7 @@
queue_signal(0, info); /* shared pending */
return;
- }
+ } /* if (!is_signal_from_kernel(info->si_code)) */
if (VG_(clo_trace_signals)) {
VG_(message)(Vg_DebugMsg, "signal %d arrived ... si_code=%d, "
Modified: trunk/memcheck/tests/Makefile.am
===================================================================
--- trunk/memcheck/tests/Makefile.am 2009-04-28 01:30:45 UTC (rev 9655)
+++ trunk/memcheck/tests/Makefile.am 2009-04-28 01:55:01 UTC (rev 9656)
@@ -23,9 +23,11 @@
DIST_SUBDIRS = x86 amd64 linux x86-linux .
-noinst_SCRIPTS = filter_allocs \
- filter_stderr filter_xml \
- filter_varinfo3
+noinst_SCRIPTS = \
+ filter_addressable \
+ filter_allocs \
+ filter_stderr filter_xml \
+ filter_varinfo3
EXTRA_DIST = $(noinst_SCRIPTS) \
addressable.stderr.exp addressable.stdout.exp addressable.vgtest \
Modified: trunk/memcheck/tests/addressable.c
===================================================================
--- trunk/memcheck/tests/addressable.c 2009-04-28 01:30:45 UTC (rev 9655)
+++ trunk/memcheck/tests/addressable.c 2009-04-28 01:55:01 UTC (rev 9656)
@@ -93,12 +93,12 @@
static struct test {
void (*test)(void);
- int sig;
+ int faults;
} tests[] = {
{ test1, 0 },
- { test2, SIGSEGV },
+ { test2, 1 },
{ test3, 0 },
- { test4, SIGSEGV },
+ { test4, 1 },
{ test5, 0 },
};
static const int n_tests = sizeof(tests)/sizeof(*tests);
@@ -140,18 +140,19 @@
if (WIFSIGNALED(status)) {
assert(WTERMSIG(status) != 0);
- if (WTERMSIG(status) == tests[i].sig)
+ if (1 == tests[i].faults &&
+ (WTERMSIG(status) == SIGSEGV ||
+ WTERMSIG(status) == SIGBUS))
printf("PASS\n");
else
printf("died with unexpected signal %d\n",
WTERMSIG(status));
} else if (WIFEXITED(status)) {
if (WEXITSTATUS(status) == 0) {
- if (tests[i].sig == 0)
+ if (tests[i].faults == 0)
printf("PASS\n");
else
- printf("exited without expected signal %d\n",
- tests[i].sig);
+ printf("exited without expected SIGSEGV or SIGBUS signal\n");
} else
printf("exited with unexpected status %d\n",
WEXITSTATUS(status));
Modified: trunk/memcheck/tests/addressable.stderr.exp
===================================================================
--- trunk/memcheck/tests/addressable.stderr.exp 2009-04-28 01:30:45 UTC (rev 9655)
+++ trunk/memcheck/tests/addressable.stderr.exp 2009-04-28 01:55:01 UTC (rev 9656)
@@ -15,8 +15,8 @@
by 0x........: main (addressable.c:125)
Address 0x........ is not stack'd, malloc'd or (recently) free'd
-Process terminating with default action of signal 11 (SIGSEGV)
- Access not within mapped region at address 0x........
+Process terminating with default action of signal N (SIGSEGV or SIGBUS)
+ Bad memory (SIGSEGV or SIGBUS) at address 0x........
at 0x........: test2 (addressable.c:51)
by 0x........: main (addressable.c:125)
If you believe this happened as a result of a stack overflow in your
@@ -36,8 +36,8 @@
For a detailed leak analysis, rerun with: --leak-check=yes
For counts of detected errors, rerun with: -v
-Process terminating with default action of signal 11 (SIGSEGV)
- Bad permissions for mapped region at address 0x........
+Process terminating with default action of signal N (SIGSEGV or SIGBUS)
+ Bad memory (SIGSEGV or SIGBUS) at address 0x........
at 0x........: test4 (addressable.c:74)
by 0x........: main (addressable.c:125)
Deleted: trunk/memcheck/tests/addressable.stderr.exp2
===================================================================
--- trunk/memcheck/tests/addressable.stderr.exp2 2009-04-28 01:30:45 UTC (rev 9655)
+++ trunk/memcheck/tests/addressable.stderr.exp2 2009-04-28 01:55:01 UTC (rev 9656)
@@ -1,70 +0,0 @@
-
-
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
-malloc/free: in use at exit: ... bytes in ... blocks.
-malloc/free: ... allocs, ... frees, ... bytes allocated.
-For a detailed leak analysis, rerun with: --leak-check=yes
-For counts of detected errors, rerun with: -v
-Unaddressable byte(s) found during client check request
- at 0x........: test2 (addressable.c:48)
- by 0x........: main (addressable.c:125)
- Address 0x........ is not stack'd, malloc'd or (recently) free'd
-
-Invalid write of size 1
- at 0x........: test2 (addressable.c:51)
- by 0x........: main (addressable.c:125)
- Address 0x........ is not stack'd, malloc'd or (recently) free'd
-
-Process terminating with default action of signal 11 (SIGSEGV)
- Access not within mapped region at address 0x........
- at 0x........: test2 (addressable.c:51)
- by 0x........: main (addressable.c:125)
-
-ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
-malloc/free: in use at exit: ... bytes in ... blocks.
-malloc/free: ... allocs, ... frees, ... bytes allocated.
-For a detailed leak analysis, rerun with: --leak-check=yes
-For counts of detected errors, rerun with: -v
-
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
-malloc/free: in use at exit: ... bytes in ... blocks.
-malloc/free: ... allocs, ... frees, ... bytes allocated.
-For a detailed leak analysis, rerun with: --leak-check=yes
-For counts of detected errors, rerun with: -v
-
-Process terminating with default action of signal 11 (SIGSEGV)
- Bad permissions for mapped region at address 0x........
- at 0x........: test4 (addressable.c:74)
- by 0x........: main (addressable.c:125)
-
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
-malloc/free: in use at exit: ... bytes in ... blocks.
-malloc/free: ... allocs, ... frees, ... bytes allocated.
-For a detailed leak analysis, rerun with: --leak-check=yes
-For counts of detected errors, rerun with: -v
-Uninitialised byte(s) found during client check request
- at 0x........: test5 (addressable.c:85)
- by 0x........: main (addressable.c:125)
- Address 0x........ is 10 bytes inside a block of size 20480 client-defined
- at 0x........: test5 (addressable.c:82)
- by 0x........: main (addressable.c:125)
-
-Uninitialised byte(s) found during client check request
- at 0x........: test5 (addressable.c:91)
- by 0x........: main (addressable.c:125)
- Address 0x........ is 20 bytes inside a block of size 20480 client-defined
- at 0x........: test5 (addressable.c:82)
- by 0x........: main (addressable.c:125)
-
-ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
-malloc/free: in use at exit: ... bytes in ... blocks.
-malloc/free: ... allocs, ... frees, ... bytes allocated.
-For a detailed leak analysis, rerun with: --leak-check=yes
-For counts of detected errors, rerun with: -v
-Use --track-origins=yes to see where uninitialised values come from
-
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
-malloc/free: in use at exit: ... bytes in ... blocks.
-malloc/free: ... allocs, ... frees, ... bytes allocated.
-For a detailed leak analysis, rerun with: --leak-check=yes
-For counts of detected errors, rerun with: -v
Modified: trunk/memcheck/tests/addressable.vgtest
===================================================================
--- trunk/memcheck/tests/addressable.vgtest 2009-04-28 01:30:45 UTC (rev 9655)
+++ trunk/memcheck/tests/addressable.vgtest 2009-04-28 01:55:01 UTC (rev 9656)
@@ -1,2 +1,2 @@
prog: addressable
-stderr_filter: filter_allocs
+stderr_filter: filter_addressable
Copied: trunk/memcheck/tests/filter_addressable (from rev 9654, branches/DARWIN/memcheck/tests/filter_addressable)
===================================================================
--- trunk/memcheck/tests/filter_addressable (rev 0)
+++ trunk/memcheck/tests/filter_addressable 2009-04-28 01:55:01 UTC (rev 9656)
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+./filter_allocs |
+perl -p -e 's/(default action of signal) [0-9]+ \(SIG(SEGV|BUS)\)/$1 N \(SIGSEGV or SIGBUS\)/' |
+perl -p -e 's/(Bad permissions for mapped region|Access not within mapped region|Non-existent physical address) at address 0x/Bad memory (SIGSEGV or SIGBUS) at address 0x/'
+
+
|
|
From: <sv...@va...> - 2009-04-28 01:47:34
|
Author: njn Date: 2009-04-28 02:30:45 +0100 (Tue, 28 Apr 2009) New Revision: 9655 Log: Allow another fault permutation in 'addressable', and remove an out-of-date .exp file for it. Removed: branches/DARWIN/memcheck/tests/addressable.stderr.exp2 Modified: branches/DARWIN/memcheck/tests/filter_addressable Deleted: branches/DARWIN/memcheck/tests/addressable.stderr.exp2 =================================================================== --- branches/DARWIN/memcheck/tests/addressable.stderr.exp2 2009-04-28 01:22:02 UTC (rev 9654) +++ branches/DARWIN/memcheck/tests/addressable.stderr.exp2 2009-04-28 01:30:45 UTC (rev 9655) @@ -1,70 +0,0 @@ - - -ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) -malloc/free: in use at exit: ... bytes in ... blocks. -malloc/free: ... allocs, ... frees, ... bytes allocated. -For a detailed leak analysis, rerun with: --leak-check=yes -For counts of detected errors, rerun with: -v -Unaddressable byte(s) found during client check request - at 0x........: test2 (addressable.c:48) - by 0x........: main (addressable.c:125) - Address 0x........ is not stack'd, malloc'd or (recently) free'd - -Invalid write of size 1 - at 0x........: test2 (addressable.c:51) - by 0x........: main (addressable.c:125) - Address 0x........ is not stack'd, malloc'd or (recently) free'd - -Process terminating with default action of signal 11 (SIGSEGV) - Access not within mapped region at address 0x........ - at 0x........: test2 (addressable.c:51) - by 0x........: main (addressable.c:125) - -ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0) -malloc/free: in use at exit: ... bytes in ... blocks. -malloc/free: ... allocs, ... frees, ... bytes allocated. -For a detailed leak analysis, rerun with: --leak-check=yes -For counts of detected errors, rerun with: -v - -ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) -malloc/free: in use at exit: ... bytes in ... blocks. -malloc/free: ... allocs, ... frees, ... bytes allocated. -For a detailed leak analysis, rerun with: --leak-check=yes -For counts of detected errors, rerun with: -v - -Process terminating with default action of signal 11 (SIGSEGV) - Bad permissions for mapped region at address 0x........ - at 0x........: test4 (addressable.c:74) - by 0x........: main (addressable.c:125) - -ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) -malloc/free: in use at exit: ... bytes in ... blocks. -malloc/free: ... allocs, ... frees, ... bytes allocated. -For a detailed leak analysis, rerun with: --leak-check=yes -For counts of detected errors, rerun with: -v -Uninitialised byte(s) found during client check request - at 0x........: test5 (addressable.c:85) - by 0x........: main (addressable.c:125) - Address 0x........ is 10 bytes inside a block of size 20480 client-defined - at 0x........: test5 (addressable.c:82) - by 0x........: main (addressable.c:125) - -Uninitialised byte(s) found during client check request - at 0x........: test5 (addressable.c:91) - by 0x........: main (addressable.c:125) - Address 0x........ is 20 bytes inside a block of size 20480 client-defined - at 0x........: test5 (addressable.c:82) - by 0x........: main (addressable.c:125) - -ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0) -malloc/free: in use at exit: ... bytes in ... blocks. -malloc/free: ... allocs, ... frees, ... bytes allocated. -For a detailed leak analysis, rerun with: --leak-check=yes -For counts of detected errors, rerun with: -v -Use --track-origins=yes to see where uninitialised values come from - -ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) -malloc/free: in use at exit: ... bytes in ... blocks. -malloc/free: ... allocs, ... frees, ... bytes allocated. -For a detailed leak analysis, rerun with: --leak-check=yes -For counts of detected errors, rerun with: -v Modified: branches/DARWIN/memcheck/tests/filter_addressable =================================================================== --- branches/DARWIN/memcheck/tests/filter_addressable 2009-04-28 01:22:02 UTC (rev 9654) +++ branches/DARWIN/memcheck/tests/filter_addressable 2009-04-28 01:30:45 UTC (rev 9655) @@ -2,6 +2,6 @@ ./filter_allocs | perl -p -e 's/(default action of signal) [0-9]+ \(SIG(SEGV|BUS)\)/$1 N \(SIGSEGV or SIGBUS\)/' | -perl -p -e 's/(Access not within mapped region|Non-existent physical address) at address 0x/Bad memory (SIGSEGV or SIGBUS) at address 0x/' +perl -p -e 's/(Bad permissions for mapped region|Access not within mapped region|Non-existent physical address) at address 0x/Bad memory (SIGSEGV or SIGBUS) at address 0x/' |