3458 Commits

Author SHA1 Message Date
18757252c5 tests/stat64.c: use libtests
* tests/stat64.c: Use SKIP_MAIN_UNDEFINED.
2016-01-05 22:35:52 +00:00
9e51ce1751 tests/stat.c: use libtests
* tests/stat.c: Use SKIP_MAIN_UNDEFINED.
2016-01-05 22:35:11 +00:00
929bc6fba1 tests/lstat64.c: use libtests
* tests/lstat64.c: Use SKIP_MAIN_UNDEFINED.
2016-01-05 22:34:30 +00:00
096a436b91 tests/lstat.c: use libtests
* tests/lstat.c: Use SKIP_MAIN_UNDEFINED.
2016-01-05 22:33:26 +00:00
fc2c61498c tests/fstat64.c: use libtests
* tests/fstat64.c: Use SKIP_MAIN_UNDEFINED.
2016-01-05 22:32:37 +00:00
2902146c1c tests/fstat.c: use libtests
* tests/fstat.c: Use SKIP_MAIN_UNDEFINED.
2016-01-05 22:31:46 +00:00
ec6b85e59c tests/statfs.c: use libtests
* tests/statfs.c (main): Use perror_msg_and_fail.
2016-01-05 22:28:51 +00:00
d88c2d8cc3 tests/xettimeofday.c: use libtests
* tests/xettimeofday.c (main): Use assert and perror_msg_and_skip.
2016-01-06 00:14:36 +00:00
7994f14ae5 tests/utime.c: use libtests
* tests/utime.c (main): Use assert and perror_msg_and_skip.
2016-01-06 00:14:36 +00:00
55095d06e9 tests/filter-unavailable.c: use libtests
* tests/filter-unavailable.c (main): Use perror_msg_and_fail.
2016-01-06 00:14:36 +00:00
339a15b619 tests/scm_rights.c: use libtests
* tests/scm_rights.c (main): Use perror_msg_and_fail and perror_msg_and_skip.
2016-01-06 00:14:36 +00:00
e301e98342 tests/caps.c: use libtests
* tests/caps.c (main): Use perror_msg_and_skip.
2016-01-06 00:14:36 +00:00
3174812d8d tests/rt_sigqueueinfo.c: use libtests
* tests/rt_sigqueueinfo.c (main): Use assert and perror_msg_and_skip.
2016-01-06 00:14:36 +00:00
55deec66a9 tests/umount.c: use libtests
* tests/umount.c: Use SKIP_MAIN_UNDEFINED.
(main): Use perror_msg_and_fail.
2016-01-06 00:14:36 +00:00
fa8d4491e3 tests/umount2.c: use libtests
* tests/umount2.c (main): Use perror_msg_and_fail.
2016-01-06 00:05:41 +00:00
6a641fce5d tests/times.c: use libtests
* tests/times.c (main): Use perror_msg_and_fail and perror_msg_and_skip.
2016-01-05 23:44:59 +00:00
f2e29da95f tests/times-fail.c: use assert
* tests/times-fail.c (main): Use assert.
2016-01-04 23:43:09 +00:00
82924318f0 tests/memfd_create.c: use libtests
* tests/memfd_create.c: Use SKIP_MAIN_UNDEFINED.
2016-01-04 23:41:27 +00:00
71ac6ff9e8 tests/execveat.c: use libtests
* tests/execveat.c: Use SKIP_MAIN_UNDEFINED.
2016-01-04 23:40:24 +00:00
c47adebc67 tests/xetitimer.c: use libtests
* tests/xetitimer.c (main): Use perror_msg_and_skip.
2016-01-04 23:38:19 +00:00
10a69f8108 tests/sysinfo.c: use libtests
* tests/sysinfo.c (main): Use perror_msg_and_skip.
2016-01-05 23:37:14 +00:00
9c8654e3e0 tests/sigaltstack.c: use libtests
* tests/sigaltstack.c (main): Use perror_msg_and_skip.
2016-01-05 23:37:01 +00:00
463bb88de1 tests/adjtimex.c: use libtests
* tests/adjtimex.c (main): Use perror_msg_and_skip.
2016-01-05 23:36:59 +00:00
cadf3543f7 tests/xet_robust_list.c: use libtests
* tests/xet_robust_list.c: Use SKIP_MAIN_UNDEFINED.
(main): Use perror_msg_and_skip and tail_alloc.
2016-01-05 23:25:00 +00:00
4cd38c0d77 tests/umovestr2.c: use libtests
* tests/umovestr2.c (main): Use get_page_size and tail_alloc.
2016-01-05 23:24:50 +00:00
4eb5d79c45 tests/umovestr.c: use libtests
* tests/umovestr.c (main): Use perror_msg_and_skip and tail_alloc.
2016-01-05 23:24:36 +00:00
6a733fd461 tests/time.c: use libtests
* tests/time.c: Use SKIP_MAIN_UNDEFINED.
(main): Use perror_msg_and_skip and tail_alloc.
2016-01-05 23:17:11 +00:00
164e577824 tests/sendfile64.c: use libtests
* tests/sendfile64.c: Use SKIP_MAIN_UNDEFINED.
(main): Use assert, perror_msg_and_fail, perror_msg_and_skip,
and tail_alloc.
2016-01-05 23:17:11 +00:00
54ba3b5c32 tests/sendfile.c: use libtests
* tests/sendfile.c: Use SKIP_MAIN_UNDEFINED.
(main): Use assert, perror_msg_and_fail, perror_msg_and_skip,
and tail_alloc.
2016-01-05 23:17:11 +00:00
0c8853c3c3 tests: include tests.h instead of config.h
Automatically edit tests/*.c files using the following perl one-liner:

perl -0777 -pi -e \
's/#ifdef HAVE_CONFIG_H\n# include "config\.h"\n#endif\n*/#include "tests.h"\n/' \
tests/*.c
2016-01-05 23:17:11 +00:00
87e6b230ff tests: introduce libtests
Introduce tests/libtests.a with common functions for use in tests.

* tests/tests.h: New file.
* tests/error_msg.c: Likewise.
* tests/tail_alloc.c: Likewise.
* tests/get_page_size.c: Likewise.
* tests/Makefile.am (libtests_a_SOURCES, libtests_a_CPPFLAGS,
check_LIBRARIES, LDADD): New variables.
(clock_xettime_LDADD, filter_unavailable_LDADD, mq_LDADD,
pc_LDADD, times_LDADD): Add $(LDADD).
* tests/.gitignore: Add libtests.a.
2016-01-05 23:17:07 +00:00
10eab9db85 tests: enable strace-k.test only for --with-libunwind configurations
Also, since -k option does not support multiple personalities,
add strace-k.test to XFAIL_TESTS when running mpers tests.

* tests/Makefile.am (MPERS_NAME, LIBUNWIND_TESTS, XFAIL_TESTS_,
XFAIL_TESTS_m32, XFAIL_TESTS_mx32, XFAIL_TESTS): New variables.
[USE_LIBUNWIND] (LIBUNWIND_TESTS): Add strace-k.test.
(TESTS): Replace strace-k.test with $(LIBUNWIND_TESTS).
* bootstrap: Substitute MPERS_NAME variable in tests-*/Makefile.am.
* tests/strace-k.test: Do not check for -k option availability.
2016-01-01 23:09:02 +00:00
f32126ba79 Move gcc compat macros to gcc_compat.h
* defs.h: Include "gcc_compat.h".
(GNUC_PREREQ, ATTRIBUTE_NORETURN, ATTRIBUTE_FORMAT,
ATTRIBUTE_ALIGNED, ATTRIBUTE_PACKED, ATTRIBUTE_MALLOC,
ATTRIBUTE_NOINLINE, ATTRIBUTE_ALLOC_SIZE): Move ...
* gcc_compat.h: ... here.
* Makefile.am (strace_SOURCES): Add gcc_compat.h.
2016-01-02 14:29:33 +00:00
72dc1b48b8 Move defs.h from noinst_HEADERS to strace_SOURCES
* Makefile.am (noinst_HEADERS): Move defs.h ...
(strace_SOURCES): ... here.
2015-12-31 14:15:59 +00:00
0171752084 test: remove fork.c and vfork.c
These manual tests are obsoleted by fork-f.test and vfork-f.test.

* test/fork.c: Remove.
* test/vfork.c: Remove.
* test/Makefile (PROGS): Remove fork and vfork.
* test/.gitignore: Remove fork and vfork.
2015-12-30 23:28:35 +00:00
78db0f2dcf tests: add fork-f.test and vfork-f.test
Check how strace -f follows fork and vfork syscalls.

* tests/fork-f.c: New file.
* tests/fork-f.test: New test.
* tests/vfork-f.c: New file.
* tests/vfork-f.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add fork-f and vfork-f.
(TESTS): Add fork-f.test and vfork-f.test.
* tests/.gitignore: Add fork-f and vfork-f.
2015-12-30 23:08:32 +00:00
aef5e14ba2 Set SYSCALL_NEVER_FAILS flag for getpid, getppid and gettid syscall
* linux/*/syscallent*.h (getpid, getppid, gettid): Set NF flag.
2015-12-29 01:15:20 +00:00
dd039b74ef Set SYSCALL_NEVER_FAILS flag for umask syscall
Linux kernel always ANDs umask argument with 0700 and therefore
this syscall never fails.

* linux/*/syscallent*.h (umask): Set NF flag.
2015-12-29 01:15:06 +00:00
552f2f62fd alpha, ia64, mips, nios2, powerpc, sparc: always check for syscall error
On architectures that use dedicated registers to report syscall errors,
check for syscall error condition regardless of SYSCALL_NEVER_FAILS flag
in the syscall entry.  On architectures that use negated errno
semantics, there is no way to distinguish a syscall error from a valid
return code that looks like a syscall error, and the check for
SYSCALL_NEVER_FAILS flag remains the only way to tell one case
from another.

* linux/alpha/get_error.c (get_error): Ignore check_errno.
* linux/ia64/get_error.c: Likewise.
* linux/mips/get_error.c: Likewise.
* linux/nios2/get_error.c: Likewise.
* linux/powerpc/get_error.c: Likewise.
* linux/sparc/get_error.c: Likewise.
* linux/sparc64/get_error.c: Likewise.
2015-12-27 01:02:53 +00:00
0297e0c067 Handle unlikely errors from personality syscall
Despite being marked as SYSCALL_NEVER_FAILS, personality syscall still
might report a failure on some architectures due to obscure kernel
bugs.  Check for this unlikely case and let users know that their
kernel has gone bananas.

* personality.c (SYS_FUNC(personality)): Do not parse syscall return
value in case of syserror.
2015-12-27 00:18:35 +00:00
abfa939f57 Do not truncate return value of get{,e}[ug]id and setfs[ug]id syscalls
This should not be a user visible change unless the kernel does
something completely unexpected.  In the latter case, let user see
what is going on.

* uid.c (SYS_FUNC(getuid), SYS_FUNC(setfsuid)): Do not truncate
tcp->u_rval to uid_t on exiting syscall, return RVAL_DECODED.
2015-12-27 00:18:03 +00:00
727508b077 Enhance personality syscall decoding
* xlat/personality_options.in: Split into ...
* xlat/personality_types.in: ... personality types and ...
* xlat/personality_flags.in: ... personality flags.
* personality.c: Include "xlat/personality_types.h"
and "xlat/personality_flags.h" instead of "xlat/personality_options.h".
(SYS_FUNC(personality)): Print PER_MASK part of personality as
a symbolic value, and the rest of personality as a set of flags.
* tests/personality.c (main): Add more test cases.
* tests/personality.test: Update.
2015-12-26 02:10:46 +00:00
a147bf8500 sh, sh64: fix syscall flags in several syscall entries
* linux/sh/syscallent.h (geteuid32, getegid32, setfsuid32, setfsgid32):
Set SYSCALL_NEVER_FAILS flag.
(fchown32): Set TRACE_DESC flag.
* linux/sh64/syscallent.h: Likewise.
2015-12-25 21:15:59 +00:00
1e155f76e7 Print personality value 0xffffffff properly
Value 0xffffffff of personality syscall first argument has a special
meaning, it is not a set of personality flags.

* personality.c (SYS_FUNC(personality)): If personality equals
to 0xffffffff, print it verbatim.
* tests/personality.c (main): Test it.
2015-12-25 21:14:57 +00:00
f7423af0df tests: add personality.test
* tests/personality.c: New file.
* tests/personality.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add personality.
(TESTS): Add personality.test.
* tests/.gitignore: Add personality.
2015-12-25 02:27:06 +00:00
97cbf69756 Enhance personality syscall decoding
* personality.c (SYS_FUNC(personality)): On entering syscall,
print first argument not as a hex value but as a set of flags.
On exiting syscall, print return code as a set of flags.
* NEWS: Mention this enhancement.
2015-12-25 00:46:07 +00:00
ffb6c55d7d Set SYSCALL_NEVER_FAILS flag for personality syscall
Starting with commit
v2.6.29-6609-g11d06b2a1e5658f448a308aa3beb97bacd64a940, personality
syscall never fails to set the personality, but before commit
v2.6.35-rc1-372-g485d527 it still could return an error.
Starting with that commit, personality syscall never returns an error.

* linux/*/syscallent.h: Set SYSCALL_NEVER_FAILS flag in personality
syscall entries.
2015-12-25 00:45:43 +00:00
3eba72b9ab Add personality emulation flags
* xlat/personality_options.in: Add UNAME26, ADDR_NO_RANDOMIZE,
FDPIC_FUNCPTRS, MMAP_PAGE_ZERO, ADDR_COMPAT_LAYOUT, READ_IMPLIES_EXEC,
ADDR_LIMIT_32BIT, SHORT_INODE, WHOLE_SECONDS, STICKY_TIMEOUTS,
and ADDR_LIMIT_3GB.
2015-12-24 17:37:35 +00:00
dd1a80c8d2 arc, metag, nios2, or1k, tile: fix build
Fix build regression introduced by commit
34683e3926d8c2daa368afb805da422ee7043396.

* linux/32/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap.
* linux/arc/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap_pgoff.
* linux/nios2/syscallent.h: Likewise.
* linux/or1k/syscallent.h: Likewise.
* linux/tile/syscallent1.h: Add sys_ prefix to ARCH_mmap and sys_mmap_4koff.
* pathtrace.c (pathtrace_match): Handle SEN_ARCH_mmap.
* NEWS: Mention this build fix.

Reported-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
2015-12-24 17:36:58 +00:00
24fb8efa27 packages: remove acl development library from build dependencies
Starting with commit v4.9-46-g681452b that removed all references
to acl.h, we no longer use acl development library.

* .travis.yml (addons.apt.packages): Remove libacl1-dev.
* strace.spec (BuildRequires): Remove libacl-devel.
2015-12-24 00:02:36 +00:00