You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
1
(4) |
2
(17) |
3
(9) |
4
(14) |
5
(10) |
6
(11) |
7
(8) |
|
8
(9) |
9
(11) |
10
(29) |
11
(27) |
12
(29) |
13
(36) |
14
(8) |
|
15
(18) |
16
(30) |
17
(25) |
18
(6) |
19
(16) |
20
(13) |
21
(10) |
|
22
(16) |
23
(7) |
24
(8) |
25
(13) |
26
(14) |
27
(14) |
28
(5) |
|
29
(6) |
30
(21) |
31
(14) |
|
|
|
|
|
From: Pınar T. <pin...@gm...> - 2009-03-03 12:29:09
|
Hi,
I am trying to implement the dynamic race detection algorithm
"Goldilocks" into Helgrind but I am having some difficulties with the
source code. The below c code is from the Valgrind Manual,
#include <pthread.h>
int var = 0;
void* child_fn ( void* arg ) {
var++; /* Unprotected relative to parent */ /* this is line 6 */
return NULL;
}
int main ( void ) {
pthread_t child;
pthread_create(&child, NULL, child_fn, NULL);
var++; /* Unprotected relative to child */ /* this is line 13 */
pthread_join(child, NULL);
return 0;
}
My question is; how can I understand when hg_handle_client_request is
called and entered one of the LOCK cases, that it is not for the
Helgrind's own locking procedures but it is for one of the locks in
the checked c code. Because for the above example c code, although
there is no locking for the variable 'var' it calls a lot of
hg_handle_client_request with one of the LOCK cases in the switch
statement.
Thank you!
pinar
|
|
From: <sv...@va...> - 2009-03-03 06:29:34
|
Author: njn
Date: 2009-03-03 06:29:26 +0000 (Tue, 03 Mar 2009)
New Revision: 9313
Log:
- Add memcheck/tests/darwin/scalar* tests, similar to the
memcheck/tests/x86-linux/scalar* tests. The main one is barely more than a
stub at the moment.
- Also fix up syscall arg checking on darwin; it wasn't working because
args are passed on the stack rather than in registers.
- Use "status" for darwin's exit(). memcheck/tests/xml1 now passes.
Added:
branches/DARWIN/memcheck/tests/darwin/
branches/DARWIN/memcheck/tests/darwin/Makefile.am
branches/DARWIN/memcheck/tests/darwin/filter_stderr
branches/DARWIN/memcheck/tests/darwin/scalar.c
branches/DARWIN/memcheck/tests/darwin/scalar.h
branches/DARWIN/memcheck/tests/darwin/scalar.stderr.exp
branches/DARWIN/memcheck/tests/darwin/scalar.vgtest
branches/DARWIN/memcheck/tests/darwin/scalar_fork.c
branches/DARWIN/memcheck/tests/darwin/scalar_fork.stderr.exp
branches/DARWIN/memcheck/tests/darwin/scalar_fork.vgtest
branches/DARWIN/memcheck/tests/darwin/scalar_vfork.c
branches/DARWIN/memcheck/tests/darwin/scalar_vfork.stderr.exp
branches/DARWIN/memcheck/tests/darwin/scalar_vfork.vgtest
Modified:
branches/DARWIN/configure.in
branches/DARWIN/coregrind/m_syswrap/priv_types_n_macros.h
branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
branches/DARWIN/coregrind/m_syswrap/syswrap-main.c
branches/DARWIN/include/pub_tool_tooliface.h
branches/DARWIN/memcheck/mc_main.c
branches/DARWIN/memcheck/tests/Makefile.am
Modified: branches/DARWIN/configure.in
===================================================================
--- branches/DARWIN/configure.in 2009-03-03 05:47:46 UTC (rev 9312)
+++ branches/DARWIN/configure.in 2009-03-03 06:29:26 UTC (rev 9313)
@@ -1815,6 +1815,7 @@
memcheck/tests/x86/Makefile
memcheck/tests/linux/Makefile
memcheck/tests/x86-linux/Makefile
+ memcheck/tests/darwin/Makefile
memcheck/docs/Makefile
cachegrind/Makefile
cachegrind/tests/Makefile
Modified: branches/DARWIN/coregrind/m_syswrap/priv_types_n_macros.h
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/priv_types_n_macros.h 2009-03-03 05:47:46 UTC (rev 9312)
+++ branches/DARWIN/coregrind/m_syswrap/priv_types_n_macros.h 2009-03-03 06:29:26 UTC (rev 9313)
@@ -474,7 +474,7 @@
Addr here = layout->s_arg##n + SYSCALL_SP; \
vg_assert(sizeof(t) <= sizeof(UWord)); \
VG_(tdict).track_pre_mem_read( \
- Vg_CoreSysCall, tid, s"("#a")", \
+ Vg_CoreSysCallArgInMem, tid, s"("#a")", \
here, sizeof(t) \
); \
} while (0)
@@ -490,7 +490,7 @@
Addr next = layout->o_arg##n + sizeof(UWord) + SYSCALL_SP; \
vg_assert(sizeof(t) <= sizeof(UWord)); \
VG_(tdict).track_pre_mem_read( \
- Vg_CoreSysCall, tid, s"("#a")", \
+ Vg_CoreSysCallArgInMem, tid, s"("#a")", \
next-sizeof(t), sizeof(t) \
); \
} while (0)
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-03-03 05:47:46 UTC (rev 9312)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-03-03 06:29:26 UTC (rev 9313)
@@ -1417,7 +1417,7 @@
ThreadState* tst;
PRINT("darwin exit( %ld )", ARG1);
- PRE_REG_READ1(void, "exit", int, exit_code);
+ PRE_REG_READ1(void, "exit", int, status);
tst = VG_(get_ThreadState)(tid);
@@ -6406,7 +6406,7 @@
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(63)), // used internally, reserved
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(64)), // old getpagesize
GENX_(__NR_msync, sys_msync),
-// _____(__NR_vfork),
+ GENX_(__NR_vfork, sys_fork), // (We treat vfork as fork.)
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(67)), // old vread
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(68)), // old vwrite
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(69)), // old sbrk
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-main.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-main.c 2009-03-03 05:47:46 UTC (rev 9312)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-main.c 2009-03-03 06:29:26 UTC (rev 9313)
@@ -490,6 +490,9 @@
// GrP fixme hack handle syscall()
// GrP fixme what about __syscall() ?
// stack[0] is return address
+ // DDD: the tool can't see that the params have been shifted! Can
+ // lead to incorrect checking, I think, because the PRRAn/PSARn
+ // macros will mention the pre-shifted args.
canonical->sysno = stack[1];
vg_assert(canonical->sysno != 0);
canonical->arg1 = stack[2];
@@ -558,6 +561,9 @@
// GrP fixme hack handle syscall()
// GrP fixme what about __syscall() ?
// stack[0] is return address
+ // DDD: the tool can't see that the params have been shifted! Can
+ // lead to incorrect checking, I think, because the PRRAn/PSARn
+ // macros will mention the pre-shifted args.
canonical->sysno = VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(gst->guest_RDI);
vg_assert(canonical->sysno != __NR_syscall);
canonical->arg1 = gst->guest_RSI;
Modified: branches/DARWIN/include/pub_tool_tooliface.h
===================================================================
--- branches/DARWIN/include/pub_tool_tooliface.h 2009-03-03 05:47:46 UTC (rev 9312)
+++ branches/DARWIN/include/pub_tool_tooliface.h 2009-03-03 06:29:26 UTC (rev 9313)
@@ -456,8 +456,14 @@
what kind of error message should be emitted. */
typedef
enum { Vg_CoreStartup=1, Vg_CoreSignal, Vg_CoreSysCall,
- Vg_CoreTranslate, Vg_CoreClientReq }
- CorePart;
+ // This is for platforms where syscall args are passed on the
+ // stack; although pre_mem_read is the callback that will be
+ // called, such an arg should be treated (with respect to
+ // presenting information to the user) as if it was passed in a
+ // register, ie. like pre_reg_read.
+ Vg_CoreSysCallArgInMem,
+ Vg_CoreTranslate, Vg_CoreClientReq
+ } CorePart;
/* Events happening in core to track. To be notified, pass a callback
function to the appropriate function. To ignore an event, don't do
Modified: branches/DARWIN/memcheck/mc_main.c
===================================================================
--- branches/DARWIN/memcheck/mc_main.c 2009-03-03 05:47:46 UTC (rev 9312)
+++ branches/DARWIN/memcheck/mc_main.c 2009-03-03 06:29:26 UTC (rev 9313)
@@ -3667,6 +3667,10 @@
isAddrErr ? 0 : otag );
break;
+ case Vg_CoreSysCallArgInMem:
+ MC_(record_regparam_error) ( tid, s, otag );
+ break;
+
/* If we're being asked to jump to a silly address, record an error
message before potentially crashing the entire system. */
case Vg_CoreTranslate:
Modified: branches/DARWIN/memcheck/tests/Makefile.am
===================================================================
--- branches/DARWIN/memcheck/tests/Makefile.am 2009-03-03 05:47:46 UTC (rev 9312)
+++ branches/DARWIN/memcheck/tests/Makefile.am 2009-03-03 06:29:26 UTC (rev 9313)
@@ -15,13 +15,16 @@
if VGCONF_OS_IS_LINUX
SUBDIRS += linux
endif
+if VGCONF_OS_IS_DARWIN
+SUBDIRS += darwin
+endif
# Platform-specific tests
if VGCONF_PLATFORMS_INCLUDE_X86_LINUX
SUBDIRS += x86-linux
endif
-DIST_SUBDIRS = x86 amd64 linux x86-linux .
+DIST_SUBDIRS = x86 amd64 linux darwin x86-linux .
noinst_SCRIPTS = filter_allocs \
filter_stderr filter_xml \
Added: branches/DARWIN/memcheck/tests/darwin/Makefile.am
===================================================================
--- branches/DARWIN/memcheck/tests/darwin/Makefile.am (rev 0)
+++ branches/DARWIN/memcheck/tests/darwin/Makefile.am 2009-03-03 06:29:26 UTC (rev 9313)
@@ -0,0 +1,20 @@
+
+include $(top_srcdir)/Makefile.tool-tests.am
+
+noinst_SCRIPTS = filter_stderr
+
+noinst_HEADERS = scalar.h
+
+EXTRA_DIST = $(noinst_SCRIPTS) \
+ scalar.stderr.exp scalar.vgtest \
+ scalar_fork.stderr.exp scalar_fork.vgtest \
+ scalar_vfork.stderr.exp scalar_vfork.vgtest
+
+check_PROGRAMS = \
+ scalar scalar_fork scalar_vfork
+
+
+AM_CFLAGS += @FLAG_M32@ $(FLAG_MMMX) $(FLAG_MSSE)
+AM_CXXFLAGS += @FLAG_M32@ $(FLAG_MMMX) $(FLAG_MSSE)
+AM_CCASFLAGS = @FLAG_M32@
+
Added: branches/DARWIN/memcheck/tests/darwin/filter_stderr
===================================================================
--- branches/DARWIN/memcheck/tests/darwin/filter_stderr (rev 0)
+++ branches/DARWIN/memcheck/tests/darwin/filter_stderr 2009-03-03 06:29:26 UTC (rev 9313)
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+../filter_stderr
Property changes on: branches/DARWIN/memcheck/tests/darwin/filter_stderr
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/DARWIN/memcheck/tests/darwin/scalar.c
===================================================================
--- branches/DARWIN/memcheck/tests/darwin/scalar.c (rev 0)
+++ branches/DARWIN/memcheck/tests/darwin/scalar.c 2009-03-03 06:29:26 UTC (rev 9313)
@@ -0,0 +1,1265 @@
+#include "../../memcheck.h"
+#include "scalar.h"
+#include <unistd.h>
+#include <sched.h>
+#include <signal.h>
+
+
+// Here we are trying to trigger every syscall error (scalar errors and
+// memory errors) for every syscall. We do this by passing a lot of bogus
+// arguments, mostly 0 and 1 (often it's 1 because NULL ptr args often aren't
+// checked for memory errors, or in order to have a non-zero length used
+// with some buffer). So most of the syscalls don't actually succeed and do
+// anything.
+//
+// Occasionally we have to be careful not to cause Valgrind to seg fault in
+// its pre-syscall wrappers; it does so because it can't know in general
+// when memory is unaddressable, and so tries to dereference it when doing
+// PRE_MEM_READ/PRE_MEM_WRITE calls. (Note that Memcheck will
+// always issue an error message immediately before these seg faults occur).
+
+int main(void)
+{
+ // uninitialised, but we know px[0] is 0x0
+ long* px = malloc(sizeof(long));
+ long x0 = px[0];
+ long res;
+
+ VALGRIND_MAKE_MEM_NOACCESS(0, 0x1000);
+
+ // __NR_syscall 0
+ // XXX
+
+ // __NR_exit 1
+ GO(__NR_exit, "below");
+ // (see below)
+
+ // __NR_fork 2
+ GO(__NR_fork, "other");
+ // (sse scalar_fork.c)
+
+ // __NR_read 3
+ // Nb: here we are also getting an error from the syscall arg itself.
+ GO(__NR_read, "1+3s 1m");
+ SY(__NR_read+(int)x0, x0, x0, x0+1); FAILx(EFAULT);
+
+ // __NR_write 4
+ GO(__NR_write, "3s 1m");
+ SY(__NR_write, x0, x0, x0+1); FAIL;
+ //res = write(x0, x0, x0+1); FAIL;
+
+#if 0
+ // XXX: all these are copied from x86-darwin/scalar.c.
+
+ // __NR_open 5
+ GO(__NR_open, "(2-args) 2s 1m");
+ SY(__NR_open, x0, x0); FAIL;
+
+ // Only 1s 0m errors -- the other 2s 1m have been checked in the previous
+ // open test, and if we test them they may be commoned up but they also
+ // may not.
+ GO(__NR_open, "(3-args) 1s 0m");
+ SY(__NR_open, "scalar.c", O_CREAT|O_EXCL, x0); FAIL;
+
+ // __NR_close 6
+ GO(__NR_close, "1s 0m");
+ SY(__NR_close, x0-1); FAIL;
+
+ // __NR_waitpid 7
+ GO(__NR_waitpid, "3s 1m");
+ SY(__NR_waitpid, x0, x0+1, x0); FAIL;
+
+ // __NR_creat 8
+ GO(__NR_creat, "2s 1m");
+ SY(__NR_creat, x0, x0); FAIL;
+
+ // __NR_link 9
+ GO(__NR_link, "2s 2m");
+ SY(__NR_link, x0, x0); FAIL;
+
+ // __NR_unlink 10
+ GO(__NR_unlink, "1s 1m");
+ SY(__NR_unlink, x0); FAIL;
+
+ // __NR_execve 11
+ // Nb: could have 3 memory errors if we pass x0+1 as the 2nd and 3rd
+ // args, except for bug #93174.
+ GO(__NR_execve, "3s 1m");
+ SY(__NR_execve, x0, x0, x0); FAIL;
+
+ // __NR_chdir 12
+ GO(__NR_chdir, "1s 1m");
+ SY(__NR_chdir, x0); FAIL;
+
+ // __NR_time 13
+ GO(__NR_time, "1s 1m");
+ SY(__NR_time, x0+1); FAIL;
+
+ // __NR_mknod 14
+ GO(__NR_mknod, "3s 1m");
+ SY(__NR_mknod, x0, x0, x0); FAIL;
+
+ // __NR_chmod 15
+ GO(__NR_chmod, "2s 1m");
+ SY(__NR_chmod, x0, x0); FAIL;
+
+ // __NR_lchown 16
+ GO(__NR_lchown, "n/a");
+ //SY(__NR_lchown); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_break 17
+ GO(__NR_break, "ni");
+ SY(__NR_break); FAIL;
+
+ // __NR_oldstat 18
+ GO(__NR_oldstat, "n/a");
+ // (obsolete, not handled by Valgrind)
+
+ // __NR_lseek 19
+ GO(__NR_lseek, "3s 0m");
+ SY(__NR_lseek, x0-1, x0, x0); FAILx(EBADF);
+
+ // __NR_getpid 20
+ GO(__NR_getpid, "0s 0m");
+ SY(__NR_getpid); SUCC;
+
+ // __NR_mount 21
+ GO(__NR_mount, "5s 3m");
+ SY(__NR_mount, x0, x0, x0, x0, x0); FAIL;
+
+ // __NR_umount 22
+ GO(__NR_umount, "1s 1m");
+ SY(__NR_umount, x0); FAIL;
+
+ // __NR_setuid 23
+ GO(__NR_setuid, "1s 0m");
+ SY(__NR_setuid, x0); FAIL;
+
+ // __NR_getuid 24
+ GO(__NR_getuid, "0s 0m");
+ SY(__NR_getuid); SUCC;
+
+ // __NR_stime 25
+ GO(__NR_stime, "n/a");
+ //SY(__NR_stime); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_ptrace 26
+ // XXX: memory pointed to be arg3 goes unchecked... otherwise would be 2m
+ GO(__NR_ptrace, "4s 1m");
+ SY(__NR_ptrace, x0+PTRACE_GETREGS, x0, x0, x0); FAIL;
+
+ // __NR_alarm 27
+ GO(__NR_alarm, "1s 0m");
+ SY(__NR_alarm, x0); SUCC;
+
+ // __NR_oldfstat 28
+ GO(__NR_oldfstat, "n/a");
+ // (obsolete, not handled by Valgrind)
+
+ // __NR_pause 29
+ GO(__NR_pause, "ignore");
+ // (hard to test, and no args so not much to be gained -- don't bother)
+
+ // __NR_utime 30
+ GO(__NR_utime, "2s 2m");
+ SY(__NR_utime, x0, x0+1); FAIL;
+
+ // __NR_stty 31
+ GO(__NR_stty, "ni");
+ SY(__NR_stty); FAIL;
+
+ // __NR_gtty 32
+ GO(__NR_gtty, "ni");
+ SY(__NR_gtty); FAIL;
+
+ // __NR_access 33
+ GO(__NR_access, "2s 1m");
+ SY(__NR_access, x0, x0); FAIL;
+
+ // __NR_nice 34
+ GO(__NR_nice, "1s 0m");
+ SY(__NR_nice, x0); SUCC;
+
+ // __NR_ftime 35
+ GO(__NR_ftime, "ni");
+ SY(__NR_ftime); FAIL;
+
+ // __NR_sync 36
+ GO(__NR_sync, "0s 0m");
+ SY(__NR_sync); SUCC;
+
+ // __NR_kill 37
+ GO(__NR_kill, "2s 0m");
+ SY(__NR_kill, x0, x0); SUCC;
+
+ // __NR_rename 38
+ GO(__NR_rename, "2s 2m");
+ SY(__NR_rename, x0, x0); FAIL;
+
+ // __NR_mkdir 39
+ GO(__NR_mkdir, "2s 1m");
+ SY(__NR_mkdir, x0, x0); FAIL;
+
+ // __NR_rmdir 40
+ GO(__NR_rmdir, "1s 1m");
+ SY(__NR_rmdir, x0); FAIL;
+
+ // __NR_dup 41
+ GO(__NR_dup, "1s 0m");
+ SY(__NR_dup, x0-1); FAIL;
+
+ // __NR_pipe 42
+ GO(__NR_pipe, "1s 1m");
+ SY(__NR_pipe, x0); FAIL;
+
+ // __NR_times 43
+ GO(__NR_times, "1s 1m");
+ SY(__NR_times, x0+1); FAIL;
+
+ // __NR_prof 44
+ GO(__NR_prof, "ni");
+ SY(__NR_prof); FAIL;
+
+ // __NR_brk 45
+ GO(__NR_brk, "1s 0m");
+ SY(__NR_brk, x0); SUCC;
+
+ // __NR_setgid 46
+ GO(__NR_setgid, "1s 0m");
+ SY(__NR_setgid, x0); FAIL;
+
+ // __NR_getgid 47
+ GO(__NR_getgid, "0s 0m");
+ SY(__NR_getgid); SUCC;
+
+ // __NR_signal 48
+ GO(__NR_signal, "n/a");
+ //SY(__NR_signal); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_geteuid 49
+ GO(__NR_geteuid, "0s 0m");
+ SY(__NR_geteuid); SUCC;
+
+ // __NR_getegid 50
+ GO(__NR_getegid, "0s 0m");
+ SY(__NR_getegid); SUCC;
+
+ // __NR_acct 51
+ GO(__NR_acct, "1s 1m");
+ SY(__NR_acct, x0); FAIL;
+
+ // __NR_umount2 52
+ GO(__NR_umount2, "2s 1m");
+ SY(__NR_umount2, x0, x0); FAIL;
+
+ // __NR_lock 53
+ GO(__NR_lock, "ni");
+ SY(__NR_lock); FAIL;
+
+ // __NR_ioctl 54
+ #include <asm/ioctls.h>
+ GO(__NR_ioctl, "3s 1m");
+ SY(__NR_ioctl, x0, x0+TCSETS, x0); FAIL;
+
+ // __NR_fcntl 55
+ // As with sys_open(), the 'fd' error is suppressed for the later ones.
+ // For F_GETFD the 3rd arg is ignored
+ GO(__NR_fcntl, "(GETFD) 2s 0m");
+ SY(__NR_fcntl, x0-1, x0+F_GETFD, x0); FAILx(EBADF);
+
+ // For F_DUPFD the 3rd arg is 'arg'. We don't check the 1st two args
+ // because any errors may or may not be commoned up with the ones from
+ // the previous fcntl call.
+ GO(__NR_fcntl, "(DUPFD) 1s 0m");
+ SY(__NR_fcntl, -1, F_DUPFD, x0); FAILx(EBADF);
+
+ // For F_GETLK the 3rd arg is 'lock'. On x86, this fails w/EBADF. But
+ // on amd64 in 32-bit mode it fails w/EFAULT. We don't check the 1st two
+ // args for the reason given above.
+ GO(__NR_fcntl, "(GETLK) 1s 0m");
+ SY(__NR_fcntl, -1, F_GETLK, x0); FAIL; //FAILx(EBADF);
+
+ // __NR_mpx 56
+ GO(__NR_mpx, "ni");
+ SY(__NR_mpx); FAIL;
+
+ // __NR_setpgid 57
+ GO(__NR_setpgid, "2s 0m");
+ SY(__NR_setpgid, x0, x0-1); FAIL;
+
+ // __NR_ulimit 58
+ GO(__NR_ulimit, "ni");
+ SY(__NR_ulimit); FAIL;
+
+ // __NR_oldolduname 59
+ GO(__NR_oldolduname, "n/a");
+ // (obsolete, not handled by Valgrind)
+
+ // __NR_umask 60
+ GO(__NR_umask, "1s 0m");
+ SY(__NR_umask, x0+022); SUCC;
+
+ // __NR_chroot 61
+ GO(__NR_chroot, "1s 1m");
+ SY(__NR_chroot, x0); FAIL;
+
+ // __NR_ustat 62
+ GO(__NR_ustat, "n/a");
+ // (deprecated, not handled by Valgrind)
+
+ // __NR_dup2 63
+ GO(__NR_dup2, "2s 0m");
+ SY(__NR_dup2, x0-1, x0); FAIL;
+
+ // __NR_getppid 64
+ GO(__NR_getppid, "0s 0m");
+ SY(__NR_getppid); SUCC;
+
+ // __NR_getpgrp 65
+ GO(__NR_getpgrp, "0s 0m");
+ SY(__NR_getpgrp); SUCC;
+
+ // __NR_setsid 66
+ GO(__NR_setsid, "0s 0m");
+ SY(__NR_setsid); SUCC_OR_FAIL;
+
+ // __NR_sigaction 67
+ GO(__NR_sigaction, "3s 4m");
+ SY(__NR_sigaction, x0, x0+&px[1], x0+&px[1]); FAIL;
+
+ // __NR_sgetmask 68 sys_sgetmask()
+ GO(__NR_sgetmask, "n/a");
+ //SY(__NR_sgetmask); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_ssetmask 69
+ GO(__NR_ssetmask, "n/a");
+ //SY(__NR_ssetmask); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_setreuid 70
+ GO(__NR_setreuid, "2s 0m");
+ SY(__NR_setreuid, x0, x0); FAIL;
+
+ // __NR_setregid 71
+ GO(__NR_setregid, "2s 0m");
+ SY(__NR_setregid, x0, x0); FAIL;
+
+ // __NR_sigsuspend 72
+ // XXX: how do you use this function?
+ GO(__NR_sigsuspend, "ignore");
+ // (I don't know how to test this...)
+
+ // __NR_sigpending 73
+ GO(__NR_sigpending, "1s 1m");
+ SY(__NR_sigpending, x0); FAIL;
+
+ // __NR_sethostname 74
+ GO(__NR_sethostname, "n/a");
+ //SY(__NR_sethostname); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_setrlimit 75
+ GO(__NR_setrlimit, "2s 1m");
+ SY(__NR_setrlimit, x0, x0); FAIL;
+
+ // __NR_getrlimit 76
+ GO(__NR_getrlimit, "2s 1m");
+ SY(__NR_getrlimit, x0, x0); FAIL;
+
+ // __NR_getrusage 77
+ GO(__NR_getrusage, "2s 1m");
+ SY(__NR_getrusage, x0, x0); FAIL;
+
+ // __NR_gettimeofday 78
+ GO(__NR_gettimeofday, "2s 2m");
+ SY(__NR_gettimeofday, x0, x0+1); FAIL;
+
+ // __NR_settimeofday 79
+ GO(__NR_settimeofday, "2s 2m");
+ SY(__NR_settimeofday, x0, x0+1); FAIL;
+
+ // __NR_getgroups 80
+ GO(__NR_getgroups, "2s 1m");
+ SY(__NR_getgroups, x0+1, x0+1); FAIL;
+
+ // __NR_setgroups 81
+ GO(__NR_setgroups, "2s 1m");
+ SY(__NR_setgroups, x0+1, x0+1); FAIL;
+
+ // __NR_select 82
+ {
+ long args[5] = { x0+8, x0+0xffffffee, x0+1, x0+1, x0+1 };
+ GO(__NR_select, "1s 5m");
+ SY(__NR_select, args+x0); FAIL;
+ }
+
+ // __NR_symlink 83
+ GO(__NR_symlink, "2s 2m");
+ SY(__NR_symlink, x0, x0); FAIL;
+
+ // __NR_oldlstat 84
+ GO(__NR_oldlstat, "n/a");
+ // (obsolete, not handled by Valgrind)
+
+ // __NR_readlink 85
+ GO(__NR_readlink, "3s 2m");
+ SY(__NR_readlink, x0+1, x0+1, x0+1); FAIL;
+
+ // __NR_uselib 86
+ GO(__NR_uselib, "n/a");
+ //SY(__NR_uselib); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_swapon 87
+ GO(__NR_swapon, "n/a");
+ //SY(__NR_swapon); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_reboot 88
+ GO(__NR_reboot, "n/a");
+ //SY(__NR_reboot); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_readdir 89
+ GO(__NR_readdir, "n/a");
+ // (superseded, not handled by Valgrind)
+
+ // __NR_mmap 90
+ {
+ long args[6] = { x0, x0, x0, x0, x0-1, x0 };
+ GO(__NR_mmap, "1s 1m");
+ SY(__NR_mmap, args+x0); FAIL;
+ }
+
+ // __NR_munmap 91
+ GO(__NR_munmap, "2s 0m");
+ SY(__NR_munmap, x0, x0); FAIL;
+
+ // __NR_truncate 92
+ GO(__NR_truncate, "2s 1m");
+ SY(__NR_truncate, x0, x0); FAIL;
+
+ // __NR_ftruncate 93
+ GO(__NR_ftruncate, "2s 0m");
+ SY(__NR_ftruncate, x0, x0); FAIL;
+
+ // __NR_fchmod 94
+ GO(__NR_fchmod, "2s 0m");
+ SY(__NR_fchmod, x0-1, x0); FAIL;
+
+ // __NR_fchown 95
+ GO(__NR_fchown, "3s 0m");
+ SY(__NR_fchown, x0, x0, x0); FAIL;
+
+ // __NR_getpriority 96
+ GO(__NR_getpriority, "2s 0m");
+ SY(__NR_getpriority, x0-1, x0); FAIL;
+
+ // __NR_setpriority 97
+ GO(__NR_setpriority, "3s 0m");
+ SY(__NR_setpriority, x0-1, x0, x0); FAIL;
+
+ // __NR_profil 98
+ GO(__NR_profil, "ni");
+ SY(__NR_profil); FAIL;
+
+ // __NR_statfs 99
+ GO(__NR_statfs, "2s 2m");
+ SY(__NR_statfs, x0, x0); FAIL;
+
+ // __NR_fstatfs 100
+ GO(__NR_fstatfs, "2s 1m");
+ SY(__NR_fstatfs, x0, x0); FAIL;
+
+ // __NR_ioperm 101
+ GO(__NR_ioperm, "3s 0m");
+ SY(__NR_ioperm, x0, x0, x0); FAIL;
+
+ // __NR_socketcall 102
+ GO(__NR_socketcall, "XXX");
+ // (XXX: need to do all sub-cases properly)
+
+ // __NR_syslog 103
+ GO(__NR_syslog, "3s 1m");
+ SY(__NR_syslog, x0+2, x0, x0+1); FAIL;
+
+ // __NR_setitimer 104
+ GO(__NR_setitimer, "3s 2m");
+ SY(__NR_setitimer, x0, x0+1, x0+1); FAIL;
+
+ // __NR_getitimer 105
+ GO(__NR_getitimer, "2s 1m");
+ SY(__NR_getitimer, x0, x0, x0); FAIL;
+
+ // __NR_stat 106
+ GO(__NR_stat, "2s 2m");
+ SY(__NR_stat, x0, x0); FAIL;
+
+ // __NR_lstat 107
+ GO(__NR_lstat, "2s 2m");
+ SY(__NR_lstat, x0, x0); FAIL;
+
+ // __NR_fstat 108
+ GO(__NR_fstat, "2s 1m");
+ SY(__NR_fstat, x0, x0); FAIL;
+
+ // __NR_olduname 109
+ GO(__NR_olduname, "n/a");
+ // (obsolete, not handled by Valgrind)
+
+ // __NR_iopl 110
+ GO(__NR_iopl, "1s 0m");
+ SY(__NR_iopl, x0+100); FAIL;
+
+ // __NR_vhangup 111
+ GO(__NR_vhangup, "0s 0m");
+ SY(__NR_vhangup); SUCC_OR_FAIL; // Will succeed for superuser
+
+ // __NR_idle 112
+ GO(__NR_idle, "ni");
+ SY(__NR_idle); FAIL;
+
+ // __NR_vm86old 113
+ GO(__NR_vm86old, "n/a");
+ // (will probably never be handled by Valgrind)
+
+ // __NR_wait4 114
+ GO(__NR_wait4, "4s 2m");
+ SY(__NR_wait4, x0, x0+1, x0, x0+1); FAIL;
+
+ // __NR_swapoff 115
+ GO(__NR_swapoff, "n/a");
+ //SY(__NR_swapoff); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_sysinfo 116
+ GO(__NR_sysinfo, "1s 1m");
+ SY(__NR_sysinfo, x0); FAIL;
+
+ // __NR_ipc 117
+ // XXX: This is simplistic -- need to do all the sub-cases properly.
+ // XXX: Also, should be 6 scalar errors, except glibc's syscall() doesn't
+ // use the 6th one!
+ GO(__NR_ipc, "5s 0m");
+ SY(__NR_ipc, x0+4, x0, x0, x0, x0, x0); FAIL;
+
+ // __NR_fsync 118
+ GO(__NR_fsync, "1s 0m");
+ SY(__NR_fsync, x0-1); FAIL;
+
+ // __NR_sigreturn 119
+ GO(__NR_sigreturn, "n/a");
+ //SY(__NR_sigreturn); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_clone 120
+#ifndef CLONE_PARENT_SETTID
+#define CLONE_PARENT_SETTID 0x00100000
+#endif
+ // XXX: should really be "4s 2m"? Not sure... (see PRE(sys_clone))
+ GO(__NR_clone, "4s 0m");
+ SY(__NR_clone, x0|CLONE_PARENT_SETTID|SIGCHLD, x0, x0, x0); FAIL;
+ if (0 == res) {
+ SY(__NR_exit, 0); FAIL;
+ }
+
+ // __NR_setdomainname 121
+ GO(__NR_setdomainname, "n/a");
+ //SY(__NR_setdomainname); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_uname 122
+ GO(__NR_uname, "1s 1m");
+ SY(__NR_uname, x0); FAIL;
+
+ // __NR_modify_ldt 123
+ GO(__NR_modify_ldt, "3s 1m");
+ SY(__NR_modify_ldt, x0+1, x0, x0+1); FAILx(EINVAL);
+
+ // __NR_adjtimex 124
+ // XXX: need to do properly, but deref'ing NULL causing Valgrind to crash...
+ GO(__NR_adjtimex, "XXX");
+// SY(__NR_adjtimex, x0); FAIL;
+
+ // __NR_mprotect 125
+ GO(__NR_mprotect, "3s 0m");
+ SY(__NR_mprotect, x0+1, x0, x0); FAILx(EINVAL);
+
+ // __NR_sigprocmask 126
+ GO(__NR_sigprocmask, "3s 2m");
+ SY(__NR_sigprocmask, x0, x0+&px[1], x0+&px[1]); SUCC;
+
+ // __NR_create_module 127
+ GO(__NR_create_module, "ni");
+ SY(__NR_create_module); FAIL;
+
+ // __NR_init_module 128
+ GO(__NR_init_module, "3s 2m");
+ SY(__NR_init_module, x0, x0+1, x0); FAIL;
+
+ // __NR_delete_module 129
+ GO(__NR_delete_module, "n/a");
+ //SY(__NR_delete_module); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_get_kernel_syms 130
+ GO(__NR_get_kernel_syms, "ni");
+ SY(__NR_get_kernel_syms); FAIL;
+
+ // __NR_quotactl 131
+ GO(__NR_quotactl, "4s 1m");
+ SY(__NR_quotactl, x0, x0, x0, x0); FAIL;
+
+ // __NR_getpgid 132
+ GO(__NR_getpgid, "1s 0m");
+ SY(__NR_getpgid, x0-1); FAIL;
+
+ // __NR_fchdir 133
+ GO(__NR_fchdir, "1s 0m");
+ SY(__NR_fchdir, x0-1); FAIL;
+
+ // __NR_bdflush 134
+ GO(__NR_bdflush, "n/a");
+ //SY(__NR_bdflush); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_sysfs 135
+ GO(__NR_sysfs, "n/a");
+ //SY(__NR_sysfs); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_personality 136
+ GO(__NR_personality, "1s 0m");
+ SY(__NR_personality, x0+0xffffffff); SUCC;
+
+ // __NR_afs_syscall 137
+ GO(__NR_afs_syscall, "ni");
+ SY(__NR_afs_syscall); FAIL;
+
+ // __NR_setfsuid 138
+ GO(__NR_setfsuid, "1s 0m");
+ SY(__NR_setfsuid, x0); SUCC; // This syscall has a stupid return value
+
+ // __NR_setfsgid 139
+ GO(__NR_setfsgid, "1s 0m");
+ SY(__NR_setfsgid, x0); SUCC; // This syscall has a stupid return value
+
+ // __NR__llseek 140
+ GO(__NR__llseek, "5s 1m");
+ SY(__NR__llseek, x0, x0, x0, x0, x0); FAIL;
+
+ // __NR_getdents 141
+ GO(__NR_getdents, "3s 1m");
+ SY(__NR_getdents, x0, x0, x0+1); FAIL;
+
+ // __NR__newselect 142
+ GO(__NR__newselect, "5s 4m");
+ SY(__NR__newselect, x0+8, x0+0xffffffff, x0+1, x0+1, x0+1); FAIL;
+
+ // __NR_flock 143
+ GO(__NR_flock, "2s 0m");
+ SY(__NR_flock, x0, x0); FAIL;
+
+ // __NR_msync 144
+ GO(__NR_msync, "3s 1m");
+ SY(__NR_msync, x0, x0+1, x0); FAIL;
+
+ // __NR_readv 145
+ GO(__NR_readv, "3s 1m");
+ SY(__NR_readv, x0, x0, x0+1); FAIL;
+
+ // __NR_writev 146
+ GO(__NR_writev, "3s 1m");
+ SY(__NR_writev, x0, x0, x0+1); FAIL;
+
+ // __NR_getsid 147
+ GO(__NR_getsid, "1s 0m");
+ SY(__NR_getsid, x0-1); FAIL;
+
+ // __NR_fdatasync 148
+ GO(__NR_fdatasync, "1s 0m");
+ SY(__NR_fdatasync, x0-1); FAIL;
+
+ // __NR__sysctl 149
+ GO(__NR__sysctl, "1s 1m");
+ SY(__NR__sysctl, x0); FAIL;
+
+ // __NR_mlock 150
+ GO(__NR_mlock, "2s 0m");
+ SY(__NR_mlock, x0, x0+1); FAIL;
+
+ // __NR_munlock 151
+ GO(__NR_munlock, "2s 0m");
+ SY(__NR_munlock, x0, x0+1); FAIL;
+
+ // __NR_mlockall 152
+ GO(__NR_mlockall, "1s 0m");
+ SY(__NR_mlockall, x0-1); FAIL;
+
+ // __NR_munlockall 153
+ GO(__NR_munlockall, "0s 0m");
+ SY(__NR_munlockall); SUCC_OR_FAILx(EPERM);
+
+ // __NR_sched_setparam 154
+ GO(__NR_sched_setparam, "2s 1m");
+ SY(__NR_sched_setparam, x0, x0); FAIL;
+
+ // __NR_sched_getparam 155
+ GO(__NR_sched_getparam, "2s 1m");
+ SY(__NR_sched_getparam, x0, x0); FAIL;
+
+ // __NR_sched_setscheduler 156
+ GO(__NR_sched_setscheduler, "3s 1m");
+ SY(__NR_sched_setscheduler, x0-1, x0, x0+1); FAIL;
+
+ // __NR_sched_getscheduler 157
+ GO(__NR_sched_getscheduler, "1s 0m");
+ SY(__NR_sched_getscheduler, x0-1); FAIL;
+
+ // __NR_sched_yield 158
+ GO(__NR_sched_yield, "0s 0m");
+ SY(__NR_sched_yield); SUCC;
+
+ // __NR_sched_get_priority_max 159
+ GO(__NR_sched_get_priority_max, "1s 0m");
+ SY(__NR_sched_get_priority_max, x0-1); FAIL;
+
+ // __NR_sched_get_priority_min 160
+ GO(__NR_sched_get_priority_min, "1s 0m");
+ SY(__NR_sched_get_priority_min, x0-1); FAIL;
+
+ // __NR_sched_rr_get_interval 161
+ GO(__NR_sched_rr_get_interval, "n/a");
+ //SY(__NR_sched_rr_get_interval); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_nanosleep 162
+ GO(__NR_nanosleep, "2s 2m");
+ SY(__NR_nanosleep, x0, x0+1); FAIL;
+
+ // __NR_mremap 163
+ GO(__NR_mremap, "5s 0m");
+ SY(__NR_mremap, x0+1, x0, x0, x0+MREMAP_FIXED, x0); FAILx(EINVAL);
+
+ // __NR_setresuid 164
+ GO(__NR_setresuid, "3s 0m");
+ SY(__NR_setresuid, x0, x0, x0); FAIL;
+
+ // __NR_getresuid 165
+ GO(__NR_getresuid, "3s 3m");
+ SY(__NR_getresuid, x0, x0, x0); FAIL;
+
+ // __NR_vm86 166
+ GO(__NR_vm86, "n/a");
+ // (will probably never be handled by Valgrind)
+
+ // __NR_query_module 167
+ GO(__NR_query_module, "ni");
+ SY(__NR_query_module); FAIL;
+
+ // __NR_poll 168
+ GO(__NR_poll, "3s 1m");
+ SY(__NR_poll, x0, x0+1, x0); FAIL;
+
+ // __NR_nfsservctl 169
+ GO(__NR_nfsservctl, "n/a");
+ //SY(__NR_nfsservctl); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_setresgid 170
+ GO(__NR_setresgid, "3s 0m");
+ SY(__NR_setresgid, x0, x0, x0); FAIL;
+
+ // __NR_getresgid 171
+ GO(__NR_getresgid, "3s 3m");
+ SY(__NR_getresgid, x0, x0, x0); FAIL;
+
+ // __NR_prctl 172
+ GO(__NR_prctl, "5s 0m");
+ SY(__NR_prctl, x0, x0, x0, x0, x0); FAIL;
+
+ // __NR_rt_sigreturn 173
+ GO(__NR_rt_sigreturn, "n/a");
+ //SY(__NR_rt_sigreturn); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_rt_sigaction 174
+ GO(__NR_rt_sigaction, "4s 4m");
+ SY(__NR_rt_sigaction, x0, x0+&px[2], x0+&px[2], x0); FAIL;
+
+ // __NR_rt_sigprocmask 175
+ GO(__NR_rt_sigprocmask, "4s 2m");
+ SY(__NR_rt_sigprocmask, x0, x0+1, x0+1, x0); FAIL;
+
+ // __NR_rt_sigpending 176
+ GO(__NR_rt_sigpending, "2s 1m");
+ SY(__NR_rt_sigpending, x0, x0+1); FAIL;
+
+ // __NR_rt_sigtimedwait 177
+ GO(__NR_rt_sigtimedwait, "4s 3m");
+ SY(__NR_rt_sigtimedwait, x0+1, x0+1, x0+1, x0); FAIL;
+
+ // __NR_rt_sigqueueinfo 178
+ GO(__NR_rt_sigqueueinfo, "3s 1m");
+ SY(__NR_rt_sigqueueinfo, x0, x0+1, x0); FAIL;
+
+ // __NR_rt_sigsuspend 179
+ GO(__NR_rt_sigsuspend, "ignore");
+ // (I don't know how to test this...)
+
+ // __NR_pread64 180
+ GO(__NR_pread64, "5s 1m");
+ SY(__NR_pread64, x0, x0, x0+1, x0, x0); FAIL;
+
+ // __NR_pwrite64 181
+ GO(__NR_pwrite64, "5s 1m");
+ SY(__NR_pwrite64, x0, x0, x0+1, x0, x0); FAIL;
+
+ // __NR_chown 182
+ GO(__NR_chown, "3s 1m");
+ SY(__NR_chown, x0, x0, x0); FAIL;
+
+ // __NR_getcwd 183
+ GO(__NR_getcwd, "2s 1m");
+ SY(__NR_getcwd, x0, x0+1); FAIL;
+
+ // __NR_capget 184
+ GO(__NR_capget, "2s 2m");
+ SY(__NR_capget, x0, x0); FAIL;
+
+ // __NR_capset 185
+ GO(__NR_capset, "2s 2m");
+ SY(__NR_capset, x0, x0); FAIL;
+
+ // __NR_sigaltstack 186
+ {
+ struct our_sigaltstack {
+ void *ss_sp;
+ int ss_flags;
+ size_t ss_size;
+ } ss;
+ ss.ss_sp = NULL;
+ ss.ss_flags = 0;
+ ss.ss_size = 0;
+ VALGRIND_MAKE_MEM_NOACCESS(& ss, sizeof(struct our_sigaltstack));
+ GO(__NR_sigaltstack, "2s 2m");
+ SY(__NR_sigaltstack, x0+&ss, x0+&ss); SUCC;
+ }
+
+ // __NR_sendfile 187
+ GO(__NR_sendfile, "4s 1m");
+ SY(__NR_sendfile, x0, x0, x0+1, x0); FAIL;
+
+ // __NR_getpmsg 188
+ // Could do 5s 4m with more effort, but I can't be bothered for this
+ // crappy non-standard syscall.
+ GO(__NR_getpmsg, "5s 0m");
+ SY(__NR_getpmsg, x0, x0, x0, x0); FAIL;
+
+ // __NR_putpmsg 189
+ // Could do 5s 2m with more effort, but I can't be bothered for this
+ // crappy non-standard syscall.
+ GO(__NR_putpmsg, "5s 0m");
+ SY(__NR_putpmsg, x0, x0, x0, x0, x0); FAIL;
+
+ // __NR_vfork 190
+ GO(__NR_vfork, "other");
+ // (sse scalar_vfork.c)
+
+ // __NR_ugetrlimit 191
+ GO(__NR_ugetrlimit, "2s 1m");
+ SY(__NR_ugetrlimit, x0, x0); FAIL;
+
+ // __NR_mmap2 192
+ GO(__NR_mmap2, "6s 0m");
+ SY(__NR_mmap2, x0, x0, x0, x0, x0-1, x0); FAIL;
+
+ // __NR_truncate64 193
+ GO(__NR_truncate64, "3s 1m");
+ SY(__NR_truncate64, x0, x0, x0); FAIL;
+
+ // __NR_ftruncate64 194
+ GO(__NR_ftruncate64, "3s 0m");
+ SY(__NR_ftruncate64, x0, x0, x0); FAIL;
+
+ // __NR_stat64 195
+ GO(__NR_stat64, "2s 2m");
+ SY(__NR_stat64, x0, x0); FAIL;
+
+ // __NR_lstat64 196
+ GO(__NR_lstat64, "2s 2m");
+ SY(__NR_lstat64, x0, x0); FAIL;
+
+ // __NR_fstat64 197
+ GO(__NR_fstat64, "2s 1m");
+ SY(__NR_fstat64, x0, x0); FAIL;
+
+ // __NR_lchown32 198
+ GO(__NR_lchown32, "3s 1m");
+ SY(__NR_lchown32, x0, x0, x0); FAIL;
+
+ // __NR_getuid32 199
+ GO(__NR_getuid32, "0s 0m");
+ SY(__NR_getuid32); SUCC;
+
+ // __NR_getgid32 200
+ GO(__NR_getgid32, "0s 0m");
+ SY(__NR_getgid32); SUCC;
+
+ // __NR_geteuid32 201
+ GO(__NR_geteuid32, "0s 0m");
+ SY(__NR_geteuid32); SUCC;
+
+ // __NR_getegid32 202
+ GO(__NR_getegid32, "0s 0m");
+ SY(__NR_getegid32); SUCC;
+
+ // __NR_setreuid32 203
+ GO(__NR_setreuid32, "2s 0m");
+ SY(__NR_setreuid32, x0, x0); FAIL;
+
+ // __NR_setregid32 204
+ GO(__NR_setregid32, "2s 0m");
+ SY(__NR_setregid32, x0, x0); FAIL;
+
+ // __NR_getgroups32 205
+ GO(__NR_getgroups32, "2s 1m");
+ SY(__NR_getgroups32, x0+1, x0+1); FAIL;
+
+ // __NR_setgroups32 206
+ GO(__NR_setgroups32, "2s 1m");
+ SY(__NR_setgroups32, x0+1, x0+1); FAIL;
+
+ // __NR_fchown32 207
+ GO(__NR_fchown32, "3s 0m");
+ SY(__NR_fchown32, x0, x0, x0); FAIL;
+
+ // __NR_setresuid32 208
+ GO(__NR_setresuid32, "3s 0m");
+ SY(__NR_setresuid32, x0, x0, x0); FAIL;
+
+ // __NR_getresuid32 209
+ GO(__NR_getresuid32, "3s 3m");
+ SY(__NR_getresuid32, x0, x0, x0); FAIL;
+
+ // __NR_setresgid32 210
+ GO(__NR_setresgid32, "3s 0m");
+ SY(__NR_setresgid32, x0, x0, x0); FAIL;
+
+ // __NR_getresgid32 211
+ GO(__NR_getresgid32, "3s 3m");
+ SY(__NR_getresgid32, x0, x0, x0); FAIL;
+
+ // __NR_chown32 212
+ GO(__NR_chown32, "3s 1m");
+ SY(__NR_chown32, x0, x0, x0); FAIL;
+
+ // __NR_setuid32 213
+ GO(__NR_setuid32, "1s 0m");
+ SY(__NR_setuid32, x0); FAIL;
+
+ // __NR_setgid32 214
+ GO(__NR_setgid32, "1s 0m");
+ SY(__NR_setgid32, x0); FAIL;
+
+ // __NR_setfsuid32 215
+ GO(__NR_setfsuid32, "1s 0m");
+ SY(__NR_setfsuid32, x0); SUCC; // This syscall has a stupid return value
+
+ // __NR_setfsgid32 216
+ GO(__NR_setfsgid32, "1s 0m");
+ SY(__NR_setfsgid32, x0); SUCC; // This syscall has a stupid return value
+
+ // __NR_pivot_root 217
+ GO(__NR_pivot_root, "n/a");
+ //SY(__NR_pivot_root); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_mincore 218
+ GO(__NR_mincore, "3s 1m");
+ SY(__NR_mincore, x0, x0+40960, x0); FAIL;
+
+ // __NR_madvise 219
+ GO(__NR_madvise, "3s 0m");
+ SY(__NR_madvise, x0, x0+1, x0); FAILx(ENOMEM);
+
+ // __NR_getdents64 220
+ GO(__NR_getdents64, "3s 1m");
+ SY(__NR_getdents64, x0, x0, x0+1); FAIL;
+
+ // __NR_fcntl64 221
+ // As with sys_open(), we don't trigger errors for the 1st two args for
+ // the later ones.
+ // For F_GETFD the 3rd arg is ignored.
+ GO(__NR_fcntl64, "(GETFD) 2s 0m");
+ SY(__NR_fcntl64, x0-1, x0+F_GETFD, x0); FAILx(EBADF);
+
+ // For F_DUPFD the 3rd arg is 'arg'
+ GO(__NR_fcntl64, "(DUPFD) 1s 0m");
+ SY(__NR_fcntl64, -1, F_DUPFD, x0); FAILx(EBADF);
+
+ // For F_GETLK the 3rd arg is 'lock'.
+ // On x86, this fails w/EBADF. But on amd64 in 32-bit mode it fails
+ // w/EFAULT.
+ GO(__NR_fcntl64, "(GETLK) 1s 0m");
+ SY(__NR_fcntl64, -1, +F_GETLK, x0); FAIL; //FAILx(EBADF);
+
+ // 222
+ GO(222, "ni");
+ SY(222); FAIL;
+
+ // 223
+ GO(223, "ni");
+ SY(223); FAIL;
+
+ // __NR_gettid 224
+ GO(__NR_gettid, "n/a");
+ //SY(__NR_gettid); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_readahead 225
+ GO(__NR_readahead, "n/a");
+ //SY(__NR_readahead); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_setxattr 226
+ GO(__NR_setxattr, "5s 3m");
+ SY(__NR_setxattr, x0, x0, x0, x0+1, x0); FAIL;
+
+ // __NR_lsetxattr 227
+ GO(__NR_lsetxattr, "5s 3m");
+ SY(__NR_lsetxattr, x0, x0, x0, x0+1, x0); FAIL;
+
+ // __NR_fsetxattr 228
+ GO(__NR_fsetxattr, "5s 2m");
+ SY(__NR_fsetxattr, x0, x0, x0, x0+1, x0); FAIL;
+
+ // __NR_getxattr 229
+ GO(__NR_getxattr, "4s 3m");
+ SY(__NR_getxattr, x0, x0, x0, x0+1); FAIL;
+
+ // __NR_lgetxattr 230
+ GO(__NR_lgetxattr, "4s 3m");
+ SY(__NR_lgetxattr, x0, x0, x0, x0+1); FAIL;
+
+ // __NR_fgetxattr 231
+ GO(__NR_fgetxattr, "4s 2m");
+ SY(__NR_fgetxattr, x0, x0, x0, x0+1); FAIL;
+
+ // __NR_listxattr 232
+ GO(__NR_listxattr, "3s 2m");
+ SY(__NR_listxattr, x0, x0, x0+1); FAIL;
+
+ // __NR_llistxattr 233
+ GO(__NR_llistxattr, "3s 2m");
+ SY(__NR_llistxattr, x0, x0, x0+1); FAIL;
+
+ // __NR_flistxattr 234
+ GO(__NR_flistxattr, "3s 1m");
+ SY(__NR_flistxattr, x0-1, x0, x0+1); FAIL; /* kernel returns EBADF, but both seem correct */
+
+ // __NR_removexattr 235
+ GO(__NR_removexattr, "2s 2m");
+ SY(__NR_removexattr, x0, x0); FAIL;
+
+ // __NR_lremovexattr 236
+ GO(__NR_lremovexattr, "2s 2m");
+ SY(__NR_lremovexattr, x0, x0); FAIL;
+
+ // __NR_fremovexattr 237
+ GO(__NR_fremovexattr, "2s 1m");
+ SY(__NR_fremovexattr, x0, x0); FAIL;
+
+ // __NR_tkill 238
+ GO(__NR_tkill, "n/a");
+ //SY(__NR_tkill); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_sendfile64 239
+ GO(__NR_sendfile64, "4s 1m");
+ SY(__NR_sendfile64, x0, x0, x0+1, x0); FAIL;
+
+ // __NR_futex 240
+ #ifndef FUTEX_WAIT
+ #define FUTEX_WAIT 0
+ #endif
+ // XXX: again, glibc not doing 6th arg means we have only 5s errors
+ GO(__NR_futex, "5s 2m");
+ SY(__NR_futex, x0+FUTEX_WAIT, x0, x0, x0+1, x0, x0); FAIL;
+
+ // __NR_sched_setaffinity 241
+ GO(__NR_sched_setaffinity, "3s 1m");
+ SY(__NR_sched_setaffinity, x0, x0+1, x0); FAIL;
+
+ // __NR_sched_getaffinity 242
+ GO(__NR_sched_getaffinity, "3s 1m");
+ SY(__NR_sched_getaffinity, x0, x0+1, x0); FAIL;
+
+ // __NR_set_thread_area 243
+ GO(__NR_set_thread_area, "1s 1m");
+ SY(__NR_set_thread_area, x0); FAILx(EFAULT);
+
+ // __NR_get_thread_area 244
+ GO(__NR_get_thread_area, "1s 1m");
+ SY(__NR_get_thread_area, x0); FAILx(EFAULT);
+
+ // __NR_io_setup 245
+ GO(__NR_io_setup, "2s 1m");
+ SY(__NR_io_setup, x0, x0); FAIL;
+
+ // __NR_io_destroy 246
+ {
+ // jump through hoops to prevent the PRE(io_destroy) wrapper crashing.
+ struct fake_aio_ring {
+ unsigned id; /* kernel internal index number */
+ unsigned nr; /* number of io_events */
+ // There are more fields in the real aio_ring, but the 'nr' field is
+ // the only one used by the PRE() wrapper.
+ } ring = { 0, 0 };
+ struct fake_aio_ring* ringptr = ˚
+ GO(__NR_io_destroy, "1s 0m");
+ SY(__NR_io_destroy, x0+&ringptr); FAIL;
+ }
+
+ // __NR_io_getevents 247
+ GO(__NR_io_getevents, "5s 2m");
+ SY(__NR_io_getevents, x0, x0, x0+1, x0, x0+1); FAIL;
+
+ // __NR_io_submit 248
+ GO(__NR_io_submit, "3s 1m");
+ SY(__NR_io_submit, x0, x0+1, x0); FAIL;
+
+ // __NR_io_cancel 249
+ GO(__NR_io_cancel, "3s 2m");
+ SY(__NR_io_cancel, x0, x0, x0); FAIL;
+
+ // __NR_fadvise64 250
+ GO(__NR_fadvise64, "n/a");
+ //SY(__NR_fadvise64); // (Not yet handled by Valgrind) FAIL;
+
+ // 251
+ GO(251, "ni");
+ SY(251); FAIL;
+
+ // __NR_exit_group 252
+ GO(__NR_exit_group, "other");
+ // (see scalar_exit_group.c)
+
+ // __NR_lookup_dcookie 253
+ GO(__NR_lookup_dcookie, "4s 1m");
+ SY(__NR_lookup_dcookie, x0, x0, x0, x0+1); FAIL;
+
+ // __NR_epoll_create 254
+ GO(__NR_epoll_create, "1s 0m");
+ SY(__NR_epoll_create, x0); SUCC_OR_FAIL;
+
+ // __NR_epoll_ctl 255
+ GO(__NR_epoll_ctl, "4s 1m");
+ SY(__NR_epoll_ctl, x0, x0, x0, x0); FAIL;
+
+ // __NR_epoll_wait 256
+ GO(__NR_epoll_wait, "4s 1m");
+ SY(__NR_epoll_wait, x0, x0, x0+1, x0); FAIL;
+
+ // __NR_remap_file_pages 257
+ GO(__NR_remap_file_pages, "n/a");
+ //SY(__NR_remap_file_pages); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_set_tid_address 258
+ GO(__NR_set_tid_address, "1s 0m");
+ SY(__NR_set_tid_address, x0); SUCC_OR_FAILx(ENOSYS);
+
+ // __NR_timer_create 259
+ GO(__NR_timer_create, "3s 2m");
+ SY(__NR_timer_create, x0, x0+1, x0); FAIL;
+
+ // __NR_timer_settime (__NR_timer_create+1)
+ GO(__NR_timer_settime, "4s 2m");
+ SY(__NR_timer_settime, x0, x0, x0, x0+1); FAIL;
+
+ // __NR_timer_gettime (__NR_timer_create+2)
+ GO(__NR_timer_gettime, "2s 1m");
+ SY(__NR_timer_gettime, x0, x0); FAIL;
+
+ // __NR_timer_getoverrun (__NR_timer_create+3)
+ GO(__NR_timer_getoverrun, "1s 0m");
+ SY(__NR_timer_getoverrun, x0); FAIL;
+
+ // __NR_timer_delete (__NR_timer_create+4)
+ GO(__NR_timer_delete, "1s 0m");
+ SY(__NR_timer_delete, x0); FAIL;
+
+ // __NR_clock_settime (__NR_timer_create+5)
+ GO(__NR_clock_settime, "2s 1m");
+ SY(__NR_clock_settime, x0, x0); FAIL; FAIL;
+
+ // __NR_clock_gettime (__NR_timer_create+6)
+ GO(__NR_clock_gettime, "2s 1m");
+ SY(__NR_clock_gettime, x0, x0); FAIL;
+
+ // __NR_clock_getres (__NR_timer_create+7)
+ GO(__NR_clock_getres, "2s 1m");
+ SY(__NR_clock_getres, x0+1, x0+1); FAIL; FAIL;
+
+ // __NR_clock_nanosleep (__NR_timer_create+8)
+ GO(__NR_clock_nanosleep, "n/a");
+ //SY(__NR_clock_nanosleep); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_statfs64 268
+ GO(__NR_statfs64, "3s 2m");
+ SY(__NR_statfs64, x0, x0+1, x0); FAIL;
+
+ // __NR_fstatfs64 269
+ GO(__NR_fstatfs64, "3s 1m");
+ SY(__NR_fstatfs64, x0, x0+1, x0); FAIL;
+
+ // __NR_tgkill 270
+ GO(__NR_tgkill, "n/a");
+ //SY(__NR_tgkill); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_utimes 271
+ GO(__NR_utimes, "2s 2m");
+ SY(__NR_utimes, x0, x0+1); FAIL;
+
+ // __NR_fadvise64_64 272
+ GO(__NR_fadvise64_64, "n/a");
+ //SY(__NR_fadvise64_64); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_vserver 273
+ GO(__NR_vserver, "ni");
+ SY(__NR_vserver); FAIL;
+
+ // __NR_mbind 274
+ GO(__NR_mbind, "n/a");
+ //SY(__NR_mbind); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_get_mempolicy 275
+ GO(__NR_get_mempolicy, "n/a");
+ //SY(__NR_get_mempolicy); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_set_mempolicy 276
+ GO(__NR_set_mempolicy, "n/a");
+ //SY(__NR_set_mempolicy); // (Not yet handled by Valgrind) FAIL;
+
+ // __NR_mq_open 277
+ GO(__NR_mq_open, "4s 3m");
+ SY(__NR_mq_open, x0, x0+O_CREAT, x0, x0+1); FAIL;
+
+ // __NR_mq_unlink (__NR_mq_open+1)
+ GO(__NR_mq_unlink, "1s 1m");
+ SY(__NR_mq_unlink, x0); FAIL;
+
+ // __NR_mq_timedsend (__NR_mq_open+2)
+ GO(__NR_mq_timedsend, "5s 2m");
+ SY(__NR_mq_timedsend, x0, x0, x0+1, x0, x0+1); FAIL;
+
+ // __NR_mq_timedreceive (__NR_mq_open+3)
+ GO(__NR_mq_timedreceive, "5s 3m");
+ SY(__NR_mq_timedreceive, x0, x0, x0+1, x0+1, x0+1); FAIL;
+
+ // __NR_mq_notify (__NR_mq_open+4)
+ GO(__NR_mq_notify, "2s 1m");
+ SY(__NR_mq_notify, x0, x0+1); FAIL;
+
+ // __NR_mq_getsetattr (__NR_mq_open+5)
+ GO(__NR_mq_getsetattr, "3s 2m");
+ SY(__NR_mq_getsetattr, x0, x0+1, x0+1); FAIL;
+
+ // __NR_sys_kexec_load 283
+ GO(__NR_sys_kexec_load, "ni");
+ SY(__NR_sys_kexec_load); FAIL;
+#endif
+
+ // no such syscall...
+ GO(9999, "1e");
+ SY(9999); FAIL;
+
+ // __NR_exit 1
+ GO(__NR_exit, "1s 0m");
+ SY(__NR_exit, x0); FAIL;
+
+ assert(0);
+}
+
Added: branches/DARWIN/memcheck/tests/darwin/scalar.h
===================================================================
--- branches/DARWIN/memcheck/tests/darwin/scalar.h (rev 0)
+++ branches/DARWIN/memcheck/tests/darwin/scalar.h 2009-03-03 06:29:26 UTC (rev 9313)
@@ -0,0 +1,57 @@
+#include "vki/vki-scnums-darwin.h"
+#include "pub_tool_vkiscnums.h"
+
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+// Since we use vki_unistd.h, we can't include <unistd.h>. So we have to
+// declare this ourselves.
+extern int syscall (int __sysno, ...);
+
+// Thorough syscall scalar arg checking. Also serves as thorough checking
+// for (very) basic syscall use. Generally not trying to do anything
+// meaningful with the syscalls.
+
+#define GO(__NR_xxx, s) \
+ fprintf(stderr, "-----------------------------------------------------\n" \
+ "%3d:%20s %s\n" \
+ "-----------------------------------------------------\n", \
+ VG_DARWIN_SYSNO_PRINT(__NR_xxx), #__NR_xxx, s);
+
+#define SY(__NR_xxx, args...) res = syscall(__NR_xxx, ##args);
+
+#define FAIL assert(-1 == res);
+#define SUCC assert(-1 != res);
+#define SUCC_OR_FAIL /* no test */
+
+#define FAILx(E) \
+ do { \
+ int myerrno = errno; \
+ if (-1 == res) { \
+ if (E == myerrno) { \
+ /* as expected */ \
+ } else { \
+ fprintf(stderr, "Expected error %s (%d), got %d\n", #E, E, myerrno); \
+ exit(1); \
+ } \
+ } else { \
+ fprintf(stderr, "Expected error %s (%d), got success\n", #E, E); \
+ exit(1); \
+ } \
+ } while (0);
+
+#define SUCC_OR_FAILx(E) \
+ do { \
+ int myerrno = errno; \
+ if (-1 == res) { \
+ if (E == myerrno) { \
+ /* as expected */ \
+ } else { \
+ fprintf(stderr, "Expected error %s (%d), got %d\n", #E, E, myerrno); \
+ exit(1); \
+ } \
+ } \
+ } while (0);
Added: branches/DARWIN/memcheck/tests/darwin/scalar.stderr.exp
===================================================================
--- branches/DARWIN/memcheck/tests/darwin/scalar.stderr.exp (rev 0)
+++ branches/DARWIN/memcheck/tests/darwin/scalar.stderr.exp 2009-03-03 06:29:26 UTC (rev 9313)
@@ -0,0 +1,55 @@
+-----------------------------------------------------
+ 1: __NR_exit below
+-----------------------------------------------------
+-----------------------------------------------------
+ 2: __NR_fork other
+-----------------------------------------------------
+-----------------------------------------------------
+ 3: __NR_read 1+3s 1m
+-----------------------------------------------------
+Syscall param (syscallno) contains uninitialised byte(s)
+ ...
+
+Syscall param read(fd) contains uninitialised byte(s)
+ ...
+
+Syscall param read(buf) contains uninitialised byte(s)
+ ...
+
+Syscall param read(count) contains uninitialised byte(s)
+ ...
+
+Syscall param read(buf) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+-----------------------------------------------------
+ 4: __NR_write 3s 1m
+-----------------------------------------------------
+
+Syscall param write(fd) contains uninitialised byte(s)
+ ...
+
+Syscall param write(buf) contains uninitialised byte(s)
+ ...
+
+Syscall param write(count) contains uninitialised byte(s)
+ ...
+
+Syscall param write(buf) points to unaddressable byte(s)
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+-----------------------------------------------------
+9999: 9999 1e
+-----------------------------------------------------
+WARNING: unhandled syscall: 1660954383
+ a.k.a.: 9999
+You may be able to write your own handler.
+Read the file README_MISSING_SYSCALL_OR_IOCTL.
+Nevertheless we consider this a bug. Please report
+it at http://valgrind.org/support/bug_reports.html.
+-----------------------------------------------------
+ 1: __NR_exit 1s 0m
+-----------------------------------------------------
+
+Syscall param exit(status) contains uninitialised byte(s)
+ ...
Added: branches/DARWIN/memcheck/tests/darwin/scalar.vgtest
===================================================================
--- branches/DARWIN/memcheck/tests/darwin/scalar.vgtest (rev 0)
+++ branches/DARWIN/memcheck/tests/darwin/scalar.vgtest 2009-03-03 06:29:26 UTC (rev 9313)
@@ -0,0 +1,3 @@
+prog: scalar
+vgopts: -q --error-limit=no
+args: < scalar.c
Added: branches/DARWIN/memcheck/tests/darwin/scalar_fork.c
===================================================================
--- branches/DARWIN/memcheck/tests/darwin/scalar_fork.c (rev 0)
+++ branches/DARWIN/memcheck/tests/darwin/scalar_fork.c 2009-03-03 06:29:26 UTC (rev 9313)
@@ -0,0 +1,15 @@
+#include "scalar.h"
+
+int main(void)
+{
+ int res;
+
+ // All __NR_xxx numbers are taken from x86
+
+ // __NR_fork 2 --> arch/sys_fork()
+ GO(__NR_fork, "0e");
+ SY(__NR_fork);
+
+ return(0);
+}
+
Added: branches/DARWIN/memcheck/tests/darwin/scalar_fork.stderr.exp
===================================================================
--- branches/DARWIN/memcheck/tests/darwin/scalar_fork.stderr.exp (rev 0)
+++ branches/DARWIN/memcheck/tests/darwin/scalar_fork.stderr.exp 2009-03-03 06:29:26 UTC (rev 9313)
@@ -0,0 +1,3 @@
+-----------------------------------------------------
+ 2: __NR_fork 0e
+-----------------------------------------------------
Added: branches/DARWIN/memcheck/tests/darwin/scalar_fork.vgtest
===================================================================
--- branches/DARWIN/memcheck/tests/darwin/scalar_fork.vgtest (rev 0)
+++ branches/DARWIN/memcheck/tests/darwin/scalar_fork.vgtest 2009-03-03 06:29:26 UTC (rev 9313)
@@ -0,0 +1,2 @@
+prog: scalar_fork
+vgopts: -q
Added: branches/DARWIN/memcheck/tests/darwin/scalar_vfork.c
===================================================================
--- branches/DARWIN/memcheck/tests/darwin/scalar_vfork.c (rev 0)
+++ branches/DARWIN/memcheck/tests/darwin/scalar_vfork.c 2009-03-03 06:29:26 UTC (rev 9313)
@@ -0,0 +1,13 @@
+#include "scalar.h"
+
+int main(void)
+{
+ int res;
+
+ // __NR_vfork 66 --> __NR_fork [we can't use sys_vfork()]
+ GO(__NR_vfork, "0e");
+ SY(__NR_vfork);
+
+ return(0);
+}
+
Added: branches/DARWIN/memcheck/tests/darwin/scalar_vfork.stderr.exp
===================================================================
--- branches/DARWIN/memcheck/tests/darwin/scalar_vfork.stderr.exp (rev 0)
+++ branches/DARWIN/memcheck/tests/darwin/scalar_vfork.stderr.exp 2009-03-03 06:29:26 UTC (rev 9313)
@@ -0,0 +1,3 @@
+-----------------------------------------------------
+ 66: __NR_vfork 0e
+-----------------------------------------------------
Added: branches/DARWIN/memcheck/tests/darwin/scalar_vfork.vgtest
===================================================================
--- branches/DARWIN/memcheck/tests/darwin/scalar_vfork.vgtest (rev 0)
+++ branches/DARWIN/memcheck/tests/darwin/scalar_vfork.vgtest 2009-03-03 06:29:26 UTC (rev 9313)
@@ -0,0 +1,2 @@
+prog: scalar_vfork
+vgopts: -q
|
|
From: <sv...@va...> - 2009-03-03 05:47:53
|
Author: njn
Date: 2009-03-03 05:47:46 +0000 (Tue, 03 Mar 2009)
New Revision: 9312
Log:
Merge r9311 (use "status" for exit/exit_group) from the trunk.
Modified:
branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c
branches/DARWIN/coregrind/m_syswrap/syswrap-linux.c
branches/DARWIN/memcheck/tests/origin4-many.stderr.exp
branches/DARWIN/memcheck/tests/x86-linux/scalar.stderr.exp
branches/DARWIN/memcheck/tests/x86-linux/scalar_exit_group.stderr.exp
branches/DARWIN/memcheck/tests/xml1.stderr.exp
branches/DARWIN/memcheck/tests/xml1.stderr.exp2
branches/DARWIN/memcheck/tests/xml1.stderr.exp64
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c 2009-03-03 05:39:23 UTC (rev 9311)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c 2009-03-03 05:47:46 UTC (rev 9312)
@@ -2092,17 +2092,12 @@
#define LOHI64(lo,hi) ( ((ULong)(lo)) | (((ULong)(hi)) << 32) )
#endif
-//zz //PRE(sys_exit_group, Special)
-//zz //{
-//zz // VG_(core_panic)("syscall exit_group() not caught by the scheduler?!");
-//zz //}
-
PRE(sys_exit)
{
ThreadState* tst;
/* simple; just make this thread exit */
PRINT("exit( %ld )", ARG1);
- PRE_REG_READ1(void, "exit", int, exitcode);
+ PRE_REG_READ1(void, "exit", int, status);
tst = VG_(get_ThreadState)(tid);
/* Set the thread's status to be exiting, then claim that the
syscall succeeded. */
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-linux.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-linux.c 2009-03-03 05:39:23 UTC (rev 9311)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-linux.c 2009-03-03 05:47:46 UTC (rev 9312)
@@ -553,7 +553,7 @@
ThreadState* tst;
PRINT("exit_group( %ld )", ARG1);
- PRE_REG_READ1(void, "exit_group", int, exit_code);
+ PRE_REG_READ1(void, "exit_group", int, status);
tst = VG_(get_ThreadState)(tid);
Modified: branches/DARWIN/memcheck/tests/origin4-many.stderr.exp
===================================================================
--- branches/DARWIN/memcheck/tests/origin4-many.stderr.exp 2009-03-03 05:39:23 UTC (rev 9311)
+++ branches/DARWIN/memcheck/tests/origin4-many.stderr.exp 2009-03-03 05:47:46 UTC (rev 9312)
@@ -46,7 +46,7 @@
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (origin4-many.c:39)
-Syscall param exit_group(exit_code) contains uninitialised byte(s)
+Syscall param exit_group(status) contains uninitialised byte(s)
...
Uninitialised value was created by a heap allocation
at 0x........: malloc (vg_replace_malloc.c:...)
Modified: branches/DARWIN/memcheck/tests/x86-linux/scalar.stderr.exp
===================================================================
--- branches/DARWIN/memcheck/tests/x86-linux/scalar.stderr.exp 2009-03-03 05:39:23 UTC (rev 9311)
+++ branches/DARWIN/memcheck/tests/x86-linux/scalar.stderr.exp 2009-03-03 05:47:46 UTC (rev 9312)
@@ -3248,5 +3248,5 @@
1: __NR_exit 1s 0m
-----------------------------------------------------
-Syscall param exit(exitcode) contains uninitialised byte(s)
+Syscall param exit(status) contains uninitialised byte(s)
...
Modified: branches/DARWIN/memcheck/tests/x86-linux/scalar_exit_group.stderr.exp
===================================================================
--- branches/DARWIN/memcheck/tests/x86-linux/scalar_exit_group.stderr.exp 2009-03-03 05:39:23 UTC (rev 9311)
+++ branches/DARWIN/memcheck/tests/x86-linux/scalar_exit_group.stderr.exp 2009-03-03 05:47:46 UTC (rev 9312)
@@ -1,5 +1,5 @@
-----------------------------------------------------
252: __NR_exit_group 1s 0m
-----------------------------------------------------
-Syscall param exit_group(exit_code) contains uninitialised byte(s)
+Syscall param exit_group(status) contains uninitialised byte(s)
...
Modified: branches/DARWIN/memcheck/tests/xml1.stderr.exp
===================================================================
--- branches/DARWIN/memcheck/tests/xml1.stderr.exp 2009-03-03 05:39:23 UTC (rev 9311)
+++ branches/DARWIN/memcheck/tests/xml1.stderr.exp 2009-03-03 05:47:46 UTC (rev 9312)
@@ -341,7 +341,7 @@
<unique>0x........</unique>
<tid>...</tid>
<kind>SyscallParam</kind>
- <what>Syscall param exit_group(exit_code) contains uninitialised byte(s)</what>
+ <what>Syscall param exit_group(status) contains uninitialised byte(s)</what>
</error>
<errorcounts>
Modified: branches/DARWIN/memcheck/tests/xml1.stderr.exp2
===================================================================
--- branches/DARWIN/memcheck/tests/xml1.stderr.exp2 2009-03-03 05:39:23 UTC (rev 9311)
+++ branches/DARWIN/memcheck/tests/xml1.stderr.exp2 2009-03-03 05:47:46 UTC (rev 9312)
@@ -341,7 +341,7 @@
<unique>0x........</unique>
<tid>...</tid>
<kind>SyscallParam</kind>
- <what>Syscall param exit(exitcode) contains uninitialised byte(s)</what>
+ <what>Syscall param exit(status) contains uninitialised byte(s)</what>
</error>
<errorcounts>
Modified: branches/DARWIN/memcheck/tests/xml1.stderr.exp64
===================================================================
--- branches/DARWIN/memcheck/tests/xml1.stderr.exp64 2009-03-03 05:39:23 UTC (rev 9311)
+++ branches/DARWIN/memcheck/tests/xml1.stderr.exp64 2009-03-03 05:47:46 UTC (rev 9312)
@@ -341,7 +341,7 @@
<unique>0x........</unique>
<tid>...</tid>
<kind>SyscallParam</kind>
- <what>Syscall param exit_group(exit_code) contains uninitialised byte(s)</what>
+ <what>Syscall param exit_group(status) contains uninitialised byte(s)</what>
</error>
<errorcounts>
|
|
From: <sv...@va...> - 2009-03-03 05:39:30
|
Author: njn
Date: 2009-03-03 05:39:23 +0000 (Tue, 03 Mar 2009)
New Revision: 9311
Log:
Use "status" as the argname for 'exit' and 'exit_group'.
Modified:
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/memcheck/tests/origin4-many.stderr.exp
trunk/memcheck/tests/x86-linux/scalar.stderr.exp
trunk/memcheck/tests/x86-linux/scalar_exit_group.stderr.exp
trunk/memcheck/tests/xml1.stderr.exp
trunk/memcheck/tests/xml1.stderr.exp2
trunk/memcheck/tests/xml1.stderr.exp64
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2009-03-03 05:19:13 UTC (rev 9310)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2009-03-03 05:39:23 UTC (rev 9311)
@@ -1973,17 +1973,12 @@
// Combine two 32-bit values into a 64-bit value
#define LOHI64(lo,hi) ( ((ULong)(lo)) | (((ULong)(hi)) << 32) )
-//zz //PRE(sys_exit_group, Special)
-//zz //{
-//zz // VG_(core_panic)("syscall exit_group() not caught by the scheduler?!");
-//zz //}
-
PRE(sys_exit)
{
ThreadState* tst;
/* simple; just make this thread exit */
PRINT("exit( %ld )", ARG1);
- PRE_REG_READ1(void, "exit", int, exitcode);
+ PRE_REG_READ1(void, "exit", int, status);
tst = VG_(get_ThreadState)(tid);
/* Set the thread's status to be exiting, then claim that the
syscall succeeded. */
Modified: trunk/coregrind/m_syswrap/syswrap-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux.c 2009-03-03 05:19:13 UTC (rev 9310)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c 2009-03-03 05:39:23 UTC (rev 9311)
@@ -553,7 +553,7 @@
ThreadState* tst;
PRINT("exit_group( %ld )", ARG1);
- PRE_REG_READ1(void, "exit_group", int, exit_code);
+ PRE_REG_READ1(void, "exit_group", int, status);
tst = VG_(get_ThreadState)(tid);
Modified: trunk/memcheck/tests/origin4-many.stderr.exp
===================================================================
--- trunk/memcheck/tests/origin4-many.stderr.exp 2009-03-03 05:19:13 UTC (rev 9310)
+++ trunk/memcheck/tests/origin4-many.stderr.exp 2009-03-03 05:39:23 UTC (rev 9311)
@@ -46,7 +46,7 @@
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (origin4-many.c:39)
-Syscall param exit_group(exit_code) contains uninitialised byte(s)
+Syscall param exit_group(status) contains uninitialised byte(s)
...
Uninitialised value was created by a heap allocation
at 0x........: malloc (vg_replace_malloc.c:...)
Modified: trunk/memcheck/tests/x86-linux/scalar.stderr.exp
===================================================================
--- trunk/memcheck/tests/x86-linux/scalar.stderr.exp 2009-03-03 05:19:13 UTC (rev 9310)
+++ trunk/memcheck/tests/x86-linux/scalar.stderr.exp 2009-03-03 05:39:23 UTC (rev 9311)
@@ -3244,5 +3244,5 @@
1: __NR_exit 1s 0m
-----------------------------------------------------
-Syscall param exit(exitcode) contains uninitialised byte(s)
+Syscall param exit(status) contains uninitialised byte(s)
...
Modified: trunk/memcheck/tests/x86-linux/scalar_exit_group.stderr.exp
===================================================================
--- trunk/memcheck/tests/x86-linux/scalar_exit_group.stderr.exp 2009-03-03 05:19:13 UTC (rev 9310)
+++ trunk/memcheck/tests/x86-linux/scalar_exit_group.stderr.exp 2009-03-03 05:39:23 UTC (rev 9311)
@@ -1,5 +1,5 @@
-----------------------------------------------------
252: __NR_exit_group 1s 0m
-----------------------------------------------------
-Syscall param exit_group(exit_code) contains uninitialised byte(s)
+Syscall param exit_group(status) contains uninitialised byte(s)
...
Modified: trunk/memcheck/tests/xml1.stderr.exp
===================================================================
--- trunk/memcheck/tests/xml1.stderr.exp 2009-03-03 05:19:13 UTC (rev 9310)
+++ trunk/memcheck/tests/xml1.stderr.exp 2009-03-03 05:39:23 UTC (rev 9311)
@@ -341,7 +341,7 @@
<unique>0x........</unique>
<tid>...</tid>
<kind>SyscallParam</kind>
- <what>Syscall param exit_group(exit_code) contains uninitialised byte(s)</what>
+ <what>Syscall param exit_group(status) contains uninitialised byte(s)</what>
</error>
<errorcounts>
Modified: trunk/memcheck/tests/xml1.stderr.exp2
===================================================================
--- trunk/memcheck/tests/xml1.stderr.exp2 2009-03-03 05:19:13 UTC (rev 9310)
+++ trunk/memcheck/tests/xml1.stderr.exp2 2009-03-03 05:39:23 UTC (rev 9311)
@@ -341,7 +341,7 @@
<unique>0x........</unique>
<tid>...</tid>
<kind>SyscallParam</kind>
- <what>Syscall param exit(exitcode) contains uninitialised byte(s)</what>
+ <what>Syscall param exit(status) contains uninitialised byte(s)</what>
</error>
<errorcounts>
Modified: trunk/memcheck/tests/xml1.stderr.exp64
===================================================================
--- trunk/memcheck/tests/xml1.stderr.exp64 2009-03-03 05:19:13 UTC (rev 9310)
+++ trunk/memcheck/tests/xml1.stderr.exp64 2009-03-03 05:39:23 UTC (rev 9311)
@@ -341,7 +341,7 @@
<unique>0x........</unique>
<tid>...</tid>
<kind>SyscallParam</kind>
- <what>Syscall param exit_group(exit_code) contains uninitialised byte(s)</what>
+ <what>Syscall param exit_group(status) contains uninitialised byte(s)</what>
</error>
<errorcounts>
|
|
From: <sv...@va...> - 2009-03-03 05:19:21
|
Author: njn
Date: 2009-03-03 05:19:13 +0000 (Tue, 03 Mar 2009)
New Revision: 9310
Log:
Make 64-bit builds work, including the regtests.
Modified:
branches/DARWIN/memcheck/tests/amd64/Makefile.am
branches/DARWIN/none/tests/Makefile.am
branches/DARWIN/none/tests/amd64/Makefile.am
branches/DARWIN/none/tests/amd64/nibz_bennee_mmap.c
branches/DARWIN/none/tests/amd64/redundantRexW.c
branches/DARWIN/none/tests/amd64/smc1.c
branches/DARWIN/none/tests/amd64/ssse3_misaligned.c
branches/DARWIN/none/tests/amd64/ssse3_misaligned.vgtest
branches/DARWIN/none/tests/x86/Makefile.am
branches/DARWIN/none/tests/x86/ssse3_misaligned.c
branches/DARWIN/none/tests/x86/ssse3_misaligned.vgtest
Modified: branches/DARWIN/memcheck/tests/amd64/Makefile.am
===================================================================
--- branches/DARWIN/memcheck/tests/amd64/Makefile.am 2009-03-03 02:51:41 UTC (rev 9309)
+++ branches/DARWIN/memcheck/tests/amd64/Makefile.am 2009-03-03 05:19:13 UTC (rev 9310)
@@ -22,10 +22,18 @@
xor-undef-amd64.stderr.exp xor-undef-amd64.stdout.exp \
xor-undef-amd64.vgtest
-check_PROGRAMS = bt_everything bug132146 defcfaexpr fxsave-amd64 \
- int3-amd64 \
- more_x87_fp sse_memory xor-undef-amd64
+check_PROGRAMS = bt_everything bug132146 fxsave-amd64 \
+ xor-undef-amd64
+# DDD: not sure if these ones should work on Darwin or not... if not, should
+# be moved into amd64-linux/.
+if ! VGCONF_OS_IS_DARWIN
+ check_PROGRAMS += \
+ defcfaexpr \
+ int3-amd64 \
+ more_x87_fp \
+ sse_memory
+endif
AM_CFLAGS += @FLAG_M64@
AM_CXXFLAGS += @FLAG_M64@
Modified: branches/DARWIN/none/tests/Makefile.am
===================================================================
--- branches/DARWIN/none/tests/Makefile.am 2009-03-03 02:51:41 UTC (rev 9309)
+++ branches/DARWIN/none/tests/Makefile.am 2009-03-03 05:19:13 UTC (rev 9310)
@@ -127,14 +127,14 @@
check_PROGRAMS = \
ansi args \
- bitfield1 blockfault \
+ bitfield1 \
bug129866 \
closeall coolo_strlen \
discard exec-sigmask execve faultstatus fcntl_setown \
fdleak_cmsg fdleak_creat fdleak_dup fdleak_dup2 \
fdleak_fcntl fdleak_open fdleak_pipe \
fdleak_socketpair \
- floored fork fucomip manythreads \
+ floored fork fucomip \
munmap_exe map_unaligned map_unmap mq \
nestedfns \
pth_atfork1 pth_blockedsig pth_cancel1 pth_cancel2 pth_cvsimple \
@@ -160,6 +160,22 @@
fdleak_ipv4 \
pending
endif
+# DDD:
+# - blockfault hangs
+# - manythreads has lots of this:
+# --61831:0:aspacem sync_check_mapping_callback: segment mismatch:
+# kernel's seg:
+# --61831:0:aspacem start=0x102538000 end=0x1025b7fff prot=3 dev=0 ino=0
+# offset=0 name="(none)"
+# --61831:0:aspacem sync_check_mapping_callback: segment mismatch: V's seg:
+# --61831:0:aspacem NSegment{ , start=0x10067a000, end=0x109a1efff,
+# smode=SmFixed, dev=0, ino=0, offset=0, fnIdx=-1, hasR=0,
+# hasW=0, hasX=0, hasT=0, mark=0, name="(none)"}
+if ! VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN
+ check_PROGRAMS += \
+ blockfault \
+ manythreads
+endif
AM_CFLAGS += $(AM_FLAG_M3264_PRI)
Modified: branches/DARWIN/none/tests/amd64/Makefile.am
===================================================================
--- branches/DARWIN/none/tests/amd64/Makefile.am 2009-03-03 02:51:41 UTC (rev 9309)
+++ branches/DARWIN/none/tests/amd64/Makefile.am 2009-03-03 05:19:13 UTC (rev 9310)
@@ -50,19 +50,32 @@
slahf-amd64.vgtest
check_PROGRAMS = \
- bug127521-64 bug132813-amd64 bug137714-amd64 bug132918 \
- bug156404-amd64 \
+ bug127521-64 bug132813-amd64 bug132918 \
clc \
- faultstatus fcmovnu fxtract $(INSN_TESTS) looper jrcxz \
+ $(INSN_TESTS) \
rcl-amd64 \
redundantRexW \
- smc1 shrld \
- nibz_bennee_mmap \
- slahf-amd64
+ smc1 \
+ nibz_bennee_mmap
if BUILD_SSSE3_TESTS
check_PROGRAMS += ssse3_misaligned
endif
+# DDD: not sure if these ones should work on Darwin or not... if not, should
+# be moved into amd64-linux/.
+if ! VGCONF_OS_IS_DARWIN
+ check_PROGRAMS += \
+ bug137714-amd64 \
+ bug156404-amd64 \
+ faultstatus \
+ fcmovnu \
+ fxtract \
+ looper \
+ jrcxz \
+ shrld \
+ slahf-amd64
+endif
+
AM_CFLAGS += @FLAG_M64@
AM_CXXFLAGS += @FLAG_M64@
AM_CCASFLAGS = @FLAG_M64@
Modified: branches/DARWIN/none/tests/amd64/nibz_bennee_mmap.c
===================================================================
--- branches/DARWIN/none/tests/amd64/nibz_bennee_mmap.c 2009-03-03 02:51:41 UTC (rev 9309)
+++ branches/DARWIN/none/tests/amd64/nibz_bennee_mmap.c 2009-03-03 05:19:13 UTC (rev 9310)
@@ -29,6 +29,10 @@
#include <stdlib.h>
#include <sys/mman.h>
+#if !defined(MAP_ANONYMOUS)
+#define MAP_ANONYMOUS 0
+#endif
+
int main(int argc, char **argv)
{
void *p;
Modified: branches/DARWIN/none/tests/amd64/redundantRexW.c
===================================================================
--- branches/DARWIN/none/tests/amd64/redundantRexW.c 2009-03-03 02:51:41 UTC (rev 9309)
+++ branches/DARWIN/none/tests/amd64/redundantRexW.c 2009-03-03 05:19:13 UTC (rev 9310)
@@ -6,8 +6,10 @@
#include <stdlib.h>
#include <stdio.h>
-#include <malloc.h> /* for memalign */
#include <assert.h>
+#if !defined(__APPLE__)
+#include <malloc.h>
+#endif
typedef unsigned char UChar;
@@ -168,10 +170,17 @@
{
XMMRegs* regs;
Mem* mem;
- regs = memalign(16, sizeof(XMMRegs)); assert(regs);
- mem = memalign(16, sizeof(Mem)); assert(mem);
+ // Darwin lacks memalign, but malloc is always 16-aligned anyway.
+ #if defined(__APPLE__)
+ regs = malloc(sizeof(XMMRegs) + 16); assert(regs);
+ mem = malloc(sizeof(Mem) + 16); assert(mem);
+ #else
+ regs = memalign(16, sizeof(XMMRegs) + 16); assert(regs);
+ mem = memalign(16, sizeof(Mem) + 16); assert(mem);
+ #endif
- /* Both have to be 16-aligned so we can do movapd et al */
+ /* Both have to be 16-aligned so we can do movapd et al. 16-byte
+ * alignment is standard on AMD64. */
assert( 0 == (0xFL & (unsigned long int)regs) );
assert( 0 == (0xFL & (unsigned long int)mem) );
Modified: branches/DARWIN/none/tests/amd64/smc1.c
===================================================================
--- branches/DARWIN/none/tests/amd64/smc1.c 2009-03-03 02:51:41 UTC (rev 9309)
+++ branches/DARWIN/none/tests/amd64/smc1.c 2009-03-03 05:19:13 UTC (rev 9310)
@@ -101,7 +101,7 @@
{
int i;
code = mmap(NULL, 20, PROT_READ|PROT_WRITE|PROT_EXEC,
- MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+ MAP_PRIVATE|MAP_ANON, -1, 0);
assert(code != MAP_FAILED);
for (i = 0; i < 10; i += 2) {
set_dest ( (Addr)&p );
Modified: branches/DARWIN/none/tests/amd64/ssse3_misaligned.c
===================================================================
--- branches/DARWIN/none/tests/amd64/ssse3_misaligned.c 2009-03-03 02:51:41 UTC (rev 9309)
+++ branches/DARWIN/none/tests/amd64/ssse3_misaligned.c 2009-03-03 05:19:13 UTC (rev 9310)
@@ -1,5 +1,8 @@
+
+#if !defined(__APPLE__)
#include <malloc.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -8,7 +11,12 @@
void maybe_fault ( int delta )
{
+ // Darwin lacks memalign, but malloc is always 16-aligned anyway.
+ #if defined(__APPLE__)
+ char* x = malloc(32/*size*/);
+ #else
char* x = memalign(16/*alignment*/,32/*size*/);
+ #endif
assert(x);
assert(0 == ((16-1) & (unsigned long)x));
memset(x, 0, 32);
Modified: branches/DARWIN/none/tests/amd64/ssse3_misaligned.vgtest
===================================================================
--- branches/DARWIN/none/tests/amd64/ssse3_misaligned.vgtest 2009-03-03 02:51:41 UTC (rev 9309)
+++ branches/DARWIN/none/tests/amd64/ssse3_misaligned.vgtest 2009-03-03 05:19:13 UTC (rev 9310)
@@ -1,3 +1,3 @@
prog: ssse3_misaligned
-prereq: ../../../tests/arch_test amd64-sse3
+prereq: ../../../tests/arch_test amd64-ssse3
vgopts: -q
Modified: branches/DARWIN/none/tests/x86/Makefile.am
===================================================================
--- branches/DARWIN/none/tests/x86/Makefile.am 2009-03-03 02:51:41 UTC (rev 9309)
+++ branches/DARWIN/none/tests/x86/Makefile.am 2009-03-03 05:19:13 UTC (rev 9310)
@@ -67,6 +67,9 @@
getseg \
movx int pushpopseg \
smc1 yield
+if BUILD_SSSE3_TESTS
+ check_PROGRAMS += ssse3_misaligned
+endif
# DDD: not sure if these ones should work on Darwin or not... if not, should
# be moved into x86-linux/.
@@ -88,10 +91,7 @@
sbbmisc \
seg_override \
sigcontext
-if BUILD_SSSE3_TESTS
- check_PROGRAMS += ssse3_misaligned
endif
-endif
AM_CFLAGS += @FLAG_M32@ $(FLAG_MMMX) $(FLAG_MSSE)
AM_CXXFLAGS += @FLAG_M32@ $(FLAG_MMMX) $(FLAG_MSSE)
Modified: branches/DARWIN/none/tests/x86/ssse3_misaligned.c
===================================================================
--- branches/DARWIN/none/tests/x86/ssse3_misaligned.c 2009-03-03 02:51:41 UTC (rev 9309)
+++ branches/DARWIN/none/tests/x86/ssse3_misaligned.c 2009-03-03 05:19:13 UTC (rev 9310)
@@ -1,5 +1,8 @@
+
+#if !defined(__APPLE__)
#include <malloc.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -8,7 +11,12 @@
void maybe_fault ( int delta )
{
+ // Darwin lacks memalign, but malloc is always 16-aligned anyway.
+ #if defined(__APPLE__)
+ char* x = malloc(32/*size*/);
+ #else
char* x = memalign(16/*alignment*/,32/*size*/);
+ #endif
assert(x);
assert(0 == ((16-1) & (unsigned long)x));
memset(x, 0, 32);
Modified: branches/DARWIN/none/tests/x86/ssse3_misaligned.vgtest
===================================================================
--- branches/DARWIN/none/tests/x86/ssse3_misaligned.vgtest 2009-03-03 02:51:41 UTC (rev 9309)
+++ branches/DARWIN/none/tests/x86/ssse3_misaligned.vgtest 2009-03-03 05:19:13 UTC (rev 9310)
@@ -1,3 +1,3 @@
prog: ssse3_misaligned
-prereq: ../../../tests/arch_test x86-sse3
+prereq: ../../../tests/arch_test x86-ssse3
vgopts: -q
|
|
From: Tom H. <th...@cy...> - 2009-03-03 03:48:22
|
Nightly build on vauxhall ( x86_64, Fedora 10 ) started at 2009-03-03 03:20:04 GMT
Results differ from 24 hours ago
Checking out valgrind source tree ... done
Configuring valgrind ... done
Building valgrind ... done
Running regression tests ... failed
Regression test results follow
== 485 tests, 0 stderr failures, 1 stdout failure, 0 post failures ==
none/tests/pth_cvsimple (stdout)
=================================================
== 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
== 486 tests, 0 stderr failures, 0 stdout failures, 0 post failures ==
=================================================
== Difference between 24 hours ago and now ==
=================================================
*** old.short Tue Mar 3 03:34:18 2009
--- new.short Tue Mar 3 03:48:18 2009
***************
*** 4,6 ****
Building valgrind ... done
! Running regression tests ... done
--- 4,6 ----
Building valgrind ... done
! Running regression tests ... failed
***************
*** 8,10 ****
! == 486 tests, 0 stderr failures, 0 stdout failures, 0 post failures ==
--- 8,11 ----
! == 485 tests, 0 stderr failures, 1 stdout failure, 0 post failures ==
! none/tests/pth_cvsimple (stdout)
|
|
From: Tom H. <th...@cy...> - 2009-03-03 03:45:03
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2009-03-03 03:05:04 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 476 tests, 5 stderr failures, 0 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) helgrind/tests/tc20_verifywrap (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 477 tests, 5 stderr failures, 0 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) helgrind/tests/tc20_verifywrap (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Tue Mar 3 03:25:05 2009 --- new.short Tue Mar 3 03:44:48 2009 *************** *** 8,10 **** ! == 477 tests, 5 stderr failures, 0 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) --- 8,10 ---- ! == 476 tests, 5 stderr failures, 0 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) |
|
From: Tom H. <th...@cy...> - 2009-03-03 03:32:21
|
Nightly build on mg ( x86_64, Fedora 9 ) started at 2009-03-03 03:10:04 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 482 tests, 4 stderr failures, 2 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) memcheck/tests/linux/timerfd-syscall (stdout) none/tests/linux/mremap2 (stdout) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 483 tests, 5 stderr failures, 2 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) helgrind/tests/hg05_race2 (stderr) memcheck/tests/linux/timerfd-syscall (stdout) none/tests/linux/mremap2 (stdout) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Tue Mar 3 03:21:07 2009 --- new.short Tue Mar 3 03:32:15 2009 *************** *** 8,10 **** ! == 483 tests, 5 stderr failures, 2 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) --- 8,10 ---- ! == 482 tests, 4 stderr failures, 2 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) *************** *** 13,15 **** exp-ptrcheck/tests/pth_specific (stderr) - helgrind/tests/hg05_race2 (stderr) memcheck/tests/linux/timerfd-syscall (stdout) --- 13,14 ---- |
|
From: <sv...@va...> - 2009-03-03 02:51:49
|
Author: njn
Date: 2009-03-03 02:51:41 +0000 (Tue, 03 Mar 2009)
New Revision: 9309
Log:
'arch_test' was totally broken on x86/Darwin. This commit fixes it. As
a result, a lot of test prerequisites that incorrectly failed now pass.
Which means that 19 more tests run, which result in 32 more failures. The
insn_* ones account for most of these.
Modified:
branches/DARWIN/tests/arch_test.c
Modified: branches/DARWIN/tests/arch_test.c
===================================================================
--- branches/DARWIN/tests/arch_test.c 2009-03-02 17:25:35 UTC (rev 9308)
+++ branches/DARWIN/tests/arch_test.c 2009-03-03 02:51:41 UTC (rev 9309)
@@ -76,9 +76,10 @@
#endif // VGP_ppc32_aix5 || VGP_ppc64_aix5
//---------------------------------------------------------------------------
-// {x86,amd64}-linux (part 1 of 2)
+// x86-linux, amd64-linux, amd64-darwin (part 1 of 2)
//---------------------------------------------------------------------------
-#if defined(VGP_x86_linux) || defined(VGP_amd64_linux)
+#if defined(VGP_x86_linux) || defined(VGP_amd64_linux) || \
+ defined(VGP_amd64_darwin)
static void cpuid ( unsigned int n,
unsigned int* a, unsigned int* b,
unsigned int* c, unsigned int* d )
@@ -89,36 +90,44 @@
: "0" (n) /* input */
);
}
-#endif // VGP_x86_linux || VGP_amd64_linux
+#endif // VGP_x86_linux || VGP_amd64_linux || VGP_amd64_darwin
//---------------------------------------------------------------------------
-// {x86,amd64}-darwin (part 1 of 2)
+// x86-darwin (part 1 of 2)
//---------------------------------------------------------------------------
-#if defined(VGP_x86_darwin) || defined(VGP_amd64_darwin)
+// We can't use the one above for x86-darwin, because we get this:
+//
+// arch_test.c:88: error: can't find a register in class ‘BREG’ while
+// reloading ‘asm’
+//
+// because %ebx is reserved for PIC. This version preserves %ebx.
+#if defined(VGP_x86_darwin)
static void cpuid ( unsigned int n,
unsigned int* a, unsigned int* b,
unsigned int* c, unsigned int* d )
{
+ unsigned int abcd[4] = { n, 0, 0, 0 };
+
__asm__ __volatile__ (
- "pushl %%eax\n\t"
- "pushl %%ebx\n\t"
- "pushl %%ecx\n\t"
- "pushl %%edx\n\t"
- "movl %4, %%eax\n\t"
- "cpuid\n\t"
- "movl %%eax,%0\n\t"
- "movl %%ebx,%1\n\t"
- "movl %%ecx,%2\n\t"
- "movl %%edx,%3\n\t"
- "popl %%edx\n\t"
- "popl %%ecx\n\t"
- "popl %%ebx\n\t"
- "popl %%eax\n\t"
- : "=m" (*a), "=m" (*b), "=m" (*c), "=m" (*d)
- : "mr" (n)
- );
+ "\tmovl %%ebx,%%esi\n"
+ "\tmovl 0(%0),%%eax\n"
+ "\tcpuid\n"
+ "\tmovl %%eax,0(%0)\n"
+ "\tmovl %%ebx,4(%0)\n"
+ "\tmovl %%ecx,8(%0)\n"
+ "\tmovl %%edx,12(%0)\n"
+ "\tmovl %%esi,%%ebx\n"
+ : /*out*/
+ : /*in*/ "r"(abcd)
+ : /*clobber*/ "eax", "esi", "ecx", "edx", "memory", "cc"
+ );
+
+ *a = abcd[0];
+ *b = abcd[1];
+ *c = abcd[2];
+ *d = abcd[3];
}
-#endif // VGP_x86_darwin || VGP_amd64_darwin
+#endif // VGP_x86_darwin
//---------------------------------------------------------------------------
// {x86,amd64}-{linux,darwin} (part 2 of 2)
|