From: Nicholas Nethercote Date: Mon, 15 Nov 2004 20:42:06 +0000 (+0000) Subject: add a bunch of tests X-Git-Tag: svn/VALGRIND_3_0_0~1295 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3cb945e9b3e81f4737ff127d8e3038923334ec2;p=thirdparty%2Fvalgrind.git add a bunch of tests git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3018 --- diff --git a/coregrind/vg_syscalls.c b/coregrind/vg_syscalls.c index 7339c5a424..b9d88febab 100644 --- a/coregrind/vg_syscalls.c +++ b/coregrind/vg_syscalls.c @@ -5701,8 +5701,8 @@ POSTx(sys_adjtimex) PREx(sys_utimes, 0) { PRINT("sys_utimes ( %p, %p )", arg1,arg2); - PRE_MEM_RASCIIZ( "utimes(filename)", arg1 ); PRE_REG_READ2(long, "utimes", char *, filename, struct timeval *, tvp); + PRE_MEM_RASCIIZ( "utimes(filename)", arg1 ); if (arg2 != (UWord)NULL) PRE_MEM_READ( "utimes(tvp)", arg2, sizeof(struct vki_timeval) ); } @@ -5995,10 +5995,10 @@ POSTx(sys_sigpending) PREx(sys_rt_sigpending, NBRunInLWP) { - PRINT( "sys_sigpending ( %p )", arg1 ); + PRINT( "sys_rt_sigpending ( %p )", arg1 ); PRE_REG_READ2(long, "rt_sigpending", vki_sigset_t *, set, vki_size_t, sigsetsize); - PRE_MEM_WRITE( "sigpending(set)", arg1, sizeof(vki_sigset_t)); + PRE_MEM_WRITE( "rt_sigpending(set)", arg1, sizeof(vki_sigset_t)); } POSTx(sys_rt_sigpending) diff --git a/memcheck/tests/scalar.c b/memcheck/tests/scalar.c index d2f9098959..bcee26378f 100644 --- a/memcheck/tests/scalar.c +++ b/memcheck/tests/scalar.c @@ -484,8 +484,8 @@ int main(void) SY(__NR_wait4, x0, x0+1, x0, x0+1); // __NR_swapoff 115 - //GO(__NR_swapoff, ".s .m"); - //SY(__NR_swapoff); + GO(__NR_swapoff, "n/a"); + //SY(__NR_swapoff); // (Not yet handled by Valgrind) // __NR_sysinfo 116 GO(__NR_sysinfo, "1s 1m"); @@ -576,8 +576,8 @@ int main(void) SY(__NR_fchdir, x0-1); // __NR_bdflush 134 - //GO(__NR_bdflush, ".s .m"); - //SY(__NR_bdflush); + GO(__NR_bdflush, "n/a"); + //SY(__NR_bdflush); // (Not yet handled by Valgrind) // __NR_sysfs 135 //GO(__NR_sysfs, ".s .m"); @@ -744,12 +744,12 @@ int main(void) SY(__NR_rt_sigprocmask, x0, x0+1, x0+1, x0); // __NR_rt_sigpending 176 - //GO(__NR_rt_sigpending, ".s .m"); - //SY(__NR_rt_sigpending); + GO(__NR_rt_sigpending, "2s 1m"); + SY(__NR_rt_sigpending, x0, x0+1); // __NR_rt_sigtimedwait 177 - //GO(__NR_rt_sigtimedwait, ".s .m"); - //SY(__NR_rt_sigtimedwait); + GO(__NR_rt_sigtimedwait, "4s 3m"); + SY(__NR_rt_sigtimedwait, x0+1, x0+1, x0+1, x0); // __NR_rt_sigqueueinfo 178 //GO(__NR_rt_sigqueueinfo, ".s .m"); @@ -760,20 +760,20 @@ int main(void) //SY(__NR_rt_sigsuspend); // __NR_pread64 180 - //GO(__NR_pread64, ".s .m"); - //SY(__NR_pread64); + GO(__NR_pread64, "5s 1m"); + SY(__NR_pread64, x0, x0, x0+1, x0, x0); // __NR_pwrite64 181 - //GO(__NR_pwrite64, ".s .m"); - //SY(__NR_pwrite64); + GO(__NR_pwrite64, "5s 1m"); + SY(__NR_pwrite64, x0, x0, x0+1, x0, x0); // __NR_chown 182 GO(__NR_chown, "3s 1m"); SY(__NR_chown, x0, x0, x0); // __NR_getcwd 183 - //GO(__NR_getcwd, ".s .m"); - //SY(__NR_getcwd); + GO(__NR_getcwd, "2s 1m"); + SY(__NR_getcwd, x0, x0+1); // __NR_capget 184 GO(__NR_capget, "2s 2m"); @@ -788,8 +788,8 @@ int main(void) //SY(__NR_sigaltstack); // __NR_sendfile 187 - //GO(__NR_sendfile, ".s .m"); - //SY(__NR_sendfile); + GO(__NR_sendfile, "4s 1m"); + SY(__NR_sendfile, x0, x0, x0+1, x0); // __NR_getpmsg 188 //GO(__NR_getpmsg, ".s .m"); @@ -912,12 +912,12 @@ int main(void) //SY(__NR_pivot_root); // (Not yet handled by Valgrind) // __NR_mincore 218 - //GO(__NR_mincore, ".s .m"); - //SY(__NR_mincore); + GO(__NR_mincore, "3s 1m"); + SY(__NR_mincore, x0, x0+40960, x0); // __NR_madvise 219 - //GO(__NR_madvise, ".s .m"); - //SY(__NR_madvise); + GO(__NR_madvise, "3s 0m"); + SY(__NR_madvise, x0, x0, x0); // __NR_getdents64 220 GO(__NR_getdents64, "3s 1m"); @@ -996,12 +996,16 @@ int main(void) //SY(__NR_tkill); // (Not yet handled by Valgrind) // __NR_sendfile64 239 - //GO(__NR_sendfile64, ".s .m"); - //SY(__NR_sendfile64); + GO(__NR_sendfile64, "4s 1m"); + SY(__NR_sendfile64, x0, x0, x0+1, x0); // __NR_futex 240 - //GO(__NR_futex, ".s .m"); - //SY(__NR_futex); + #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); // __NR_sched_setaffinity 241 GO(__NR_sched_setaffinity, "3s 1m"); @@ -1068,8 +1072,8 @@ int main(void) SY(__NR_epoll_wait, x0, x0, x0+1, x0); // __NR_remap_file_pages 257 - //GO(__NR_remap_file_pages, ".s .m"); - //SY(__NR_remap_file_pages); + GO(__NR_remap_file_pages, "n/a"); + //SY(__NR_remap_file_pages); // (Not yet handled by Valgrind) // __NR_set_tid_address 258 GO(__NR_set_tid_address, "1s 0m"); @@ -1124,8 +1128,8 @@ int main(void) //SY(__NR_tgkill); // (Not yet handled by Valgrind) // __NR_utimes 271 - //GO(__NR_utimes, ".s .m"); - //SY(__NR_utimes); + GO(__NR_utimes, "2s 2m"); + SY(__NR_utimes, x0, x0+1); // __NR_fadvise64_64 272 GO(__NR_fadvise64_64, "n/a"); diff --git a/memcheck/tests/scalar.stderr.exp b/memcheck/tests/scalar.stderr.exp index 0230c86066..ef5c7951b6 100644 --- a/memcheck/tests/scalar.stderr.exp +++ b/memcheck/tests/scalar.stderr.exp @@ -1469,6 +1469,9 @@ Syscall param wait4(rusage) points to unaddressable byte(s) by 0x........: ... Address 0x........ is not stack'd, malloc'd or (recently) free'd ----------------------------------------------------- +115: __NR_swapoff n/a +----------------------------------------------------- +----------------------------------------------------- 116: __NR_sysinfo 1s 1m ----------------------------------------------------- @@ -1719,6 +1722,9 @@ Syscall param fchdir(fd) contains uninitialised byte(s) by 0x........: __libc_start_main (...libc...) by 0x........: ... ----------------------------------------------------- +134: __NR_bdflush n/a +----------------------------------------------------- +----------------------------------------------------- 136: __NR_personality 1s 0m ----------------------------------------------------- @@ -2358,6 +2364,134 @@ Syscall param rt_sigprocmask(oldset) points to unaddressable byte(s) by 0x........: ... Address 0x........ is not stack'd, malloc'd or (recently) free'd ----------------------------------------------------- +176: __NR_rt_sigpending 2s 1m +----------------------------------------------------- + +Syscall param rt_sigpending(set) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param rt_sigpending(sigsetsize) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param rt_sigpending(set) points to unaddressable byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd +----------------------------------------------------- +177:__NR_rt_sigtimedwait 4s 3m +----------------------------------------------------- + +Syscall param rt_sigtimedwait(set) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param rt_sigtimedwait(info) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param rt_sigtimedwait(timeout) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param rt_sigtimedwait(sigsetsize) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param rt_sigtimedwait(set) points to unaddressable byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param rt_sigtimedwait(info) points to unaddressable byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param rt_sigtimedwait(timeout) points to unaddressable byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd +----------------------------------------------------- +180: __NR_pread64 5s 1m +----------------------------------------------------- + +Syscall param pread64(fd) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param pread64(buf) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param pread64(count) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param pread64(offset_low32) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param pread64(offset_high32) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param pread64(buf) points to unaddressable byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd +----------------------------------------------------- +181: __NR_pwrite64 5s 1m +----------------------------------------------------- + +Syscall param pwrite64(fd) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param pwrite64(buf) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param pwrite64(count) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param pwrite64(offset_low32) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param pwrite64(offset_high32) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param pwrite64(buf) points to unaddressable byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd +----------------------------------------------------- 182: __NR_chown 3s 1m ----------------------------------------------------- @@ -2382,6 +2516,25 @@ Syscall param chown16(path) points to unaddressable byte(s) by 0x........: ... Address 0x........ is not stack'd, malloc'd or (recently) free'd ----------------------------------------------------- +183: __NR_getcwd 2s 1m +----------------------------------------------------- + +Syscall param getcwd(buf) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param getcwd(size) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param getcwd(buf) points to unaddressable byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd +----------------------------------------------------- 184: __NR_capget 2s 2m ----------------------------------------------------- @@ -2432,6 +2585,35 @@ Syscall param capset(data) points to unaddressable byte(s) by 0x........: ... Address 0x........ is not stack'd, malloc'd or (recently) free'd ----------------------------------------------------- +187: __NR_sendfile 4s 1m +----------------------------------------------------- + +Syscall param sendfile(out_fd) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param sendfile(in_fd) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param sendfile(offset) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param sendfile(count) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param sendfile(offset) points to unaddressable byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd +----------------------------------------------------- 190: __NR_vfork 0s 0m ----------------------------------------------------- ----------------------------------------------------- @@ -2878,6 +3060,48 @@ Syscall param setfsgid(gid) contains uninitialised byte(s) 217: __NR_pivot_root n/a ----------------------------------------------------- ----------------------------------------------------- +218: __NR_mincore 3s 1m +----------------------------------------------------- + +Syscall param mincore(start) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param mincore(length) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param mincore(vec) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param mincore(vec) points to unaddressable byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd +----------------------------------------------------- +219: __NR_madvise 3s 0m +----------------------------------------------------- + +Syscall param madvise(start) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param madvise(length) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param madvise(advice) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... +----------------------------------------------------- 220: __NR_getdents64 3s 1m ----------------------------------------------------- @@ -3337,6 +3561,75 @@ Syscall param fremovexattr(name) points to unaddressable byte(s) 238: __NR_tkill n/a ----------------------------------------------------- ----------------------------------------------------- +239: __NR_sendfile64 4s 1m +----------------------------------------------------- + +Syscall param sendfile64(out_fd) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param sendfile64(in_fd) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param sendfile64(offset) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param sendfile64(count) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param sendfile64(offset) points to unaddressable byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd +----------------------------------------------------- +240: __NR_futex 5s 2m +----------------------------------------------------- + +Syscall param futex(futex) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param futex(op) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param futex(val) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param futex(utime) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param futex(uaddr2) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param futex(futex) points to unaddressable byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param futex(timeout) points to unaddressable byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd +----------------------------------------------------- 241:__NR_sched_setaffinity 3s 1m ----------------------------------------------------- @@ -3489,6 +3782,9 @@ Syscall param epoll_wait(events) points to unaddressable byte(s) by 0x........: ... Address 0x........ is not stack'd, malloc'd or (recently) free'd ----------------------------------------------------- +257:__NR_remap_file_pages n/a +----------------------------------------------------- +----------------------------------------------------- 258:__NR_set_tid_address 1s 0m ----------------------------------------------------- @@ -3554,6 +3850,31 @@ Syscall param fstatfs64(buf) points to unaddressable byte(s) 270: __NR_tgkill n/a ----------------------------------------------------- ----------------------------------------------------- +271: __NR_utimes 2s 2m +----------------------------------------------------- + +Syscall param utimes(filename) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param utimes(tvp) contains uninitialised byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + +Syscall param utimes(filename) points to unaddressable byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param utimes(tvp) points to unaddressable byte(s) + at 0x........: syscall (in /...libc...) + by 0x........: __libc_start_main (...libc...) + by 0x........: ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd +----------------------------------------------------- 272: __NR_fadvise64_64 n/a ----------------------------------------------------- -----------------------------------------------------