Commit Graph

4884 Commits

Author SHA1 Message Date
cabcca717a btrfs.c: print 64-bit fields of btrfs_ioctl_vol_args_v2 using PRIu64 format
* block.c (btrfs_ioctl): Print size and transid fields
of struct_btrfs_ioctl_vol_args_v2 using PRIu64 format.
2016-12-19 19:58:16 +00:00
201fd3c185 block.c: change type of long long fileds to int64_t
* block.c (struct_blkpg_partition): Change type of start and length
fields from long long to int64_t.
(print_blkpg_req): Print them using PRId64 format.
2016-12-19 19:58:16 +00:00
Eugene Syromyatnikov
1fe5d9bed5 Introduce current_klongsize in addition to current_wordsize
Subsequent commits are going to use current_klongsize
as the tracee's size of kernel_ulong_t type.

* defs.h (PERSONALITY0_KLONGSIZE): New macro.
[X86_64] (PERSONALITY2_KLONGSIZE): Likewise.
[SUPPORTED_PERSONALITIES > 1] (PERSONALITY1_KLONGSIZE): Likewise.
[SUPPORTED_PERSONALITIES == 1] (current_klongsize): Likewise.
[SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_KLONGSIZE ==
PERSONALITY1_KLONGSIZE] (current_klongsize): Likewise.
[SUPPORTED_PERSONALITIES != 1 && (SUPPORTED_PERSONALITIES != 2 ||
PERSONALITY0_KLONGSIZE != PERSONALITY1_KLONGSIZE)] (current_klongsize):
New variable prototype.
* syscall.c [!current_klongsize] (current_klongsize): New variable.
[!current_klongsize] (personality_klongsize): New array.
(set_personality) [!current_klongsize]: Update current_klongsize
with the appropriate value from personality_klongsize.
2016-12-19 14:39:48 +00:00
6452c4deeb configure: define SIZEOF_KERNEL_LONG_T macro
Provide SIZEOF_KERNEL_LONG_T macro in addition to SIZEOF_LONG and
SIZEOF_LONG_LONG for checking of kernel_long_t and kernel_ulong_t
types at the time of preprocessing.

* configure.ac (AC_CHECK_SIZEOF): Add kernel_long_t.
2016-12-19 14:37:59 +00:00
dfff7d5571 Remove getarg_ll
This function has never been used in the code, and in perspective
the whole ext_arg thing will go away.

* defs.h (getarg_ll): Remove prototype.
* util.c (getarg_ll): Remove.
2016-12-19 14:21:40 +00:00
fc346f1d91 struct tcb: make types of syscall arguments unsigned
This is the first step in the direction of revisiting current practice
of indiscriminate use of signed types for syscall arguments and memory
addresses.

* kernel_types.h (kernel_ureg_t): New type, typedef to unsigned long.
* defs.h (struct tcb): Change type of u_arg from long to kernel_ureg_t.
[HAVE_STRUCT_TCB_EXT_ARG]: Change type of ext_arg from long long
to unsigned long long.
* desc.c (decode_select): Change type of syscall arguments from long
to kernel_ureg_t.
(SYS_FUNC(oldselect)): Change type of select_args from long
to kernel_ureg_t.
* io.c (print_lld_from_low_high_val): Remove no longer needed cast
of syscall arguments to unsigned long.
* lseek.c (SYS_FUNC(lseek)): Cast syscall argument from unsigned long
to long.
* mem.c (print_mmap): Change type of syscall arguments from long
to kernel_ureg_t.
(SYS_FUNC(old_mmap), SYS_FUNC(old_mmap_pgoff)): Change type of u_arg
from long to kernel_ureg_t.
(SYS_FUNC(mmap), SYS_FUNC(mmap_pgoff), SYS_FUNC(mmap_pgoff)): Remove
no longer needed cast of syscall arguments to unsigned long.
* pathtrace.c (pathtrace_match): Change type of args and select_args
from long to kernel_ureg_t.
* util.c (getarg_ull): Remove no longer needed casts of syscall
arguments to unsigned types.
2016-12-19 12:38:29 +00:00
29107a40e9 s390: fix decoding of mmap2 syscall when arguments are not available
* mem.c [S390] (SYS_FUNC(old_mmap_pgoff)): Use umove_or_printaddr
instead of umoven to fetch mmap arguments, fix return value when this
fetch fails.
2016-12-19 12:34:51 +00:00
ed256d30ee Fix pathmatch of oldselect syscall on 64-bit architectures
* pathtrace.c (pathtrace_match): Fix fetching of 32-bit oldselect
arguments on 64-bit architectures.
2016-12-19 11:49:58 +00:00
4cb2d29f2f Cleanup oldselect
* desc.c (SYS_FUNC(oldselect)): Rewrite without use of macros.
2016-12-19 11:40:43 +00:00
0547dc1ad5 Change scno type from long to unsigned long
Use an unsigned type for syscall numbers as they are not intended
for signed arithmetics.  Introduce kernel_scno_t as a typedef
to unsigned long, that could be changed later to kernel_ulong_t.

* kernel_types.h (kernel_scno_t): New type, typedef to unsigned long.
* defs.h (struct tcb): Change type of scno field from long
to kernel_scno_t.
(syscall_name): Change argument type from long to kernel_scno_t.
(scno_in_range, scno_is_valid): Change argument type from unsigned long
to kernel_scno_t.
* linux/aarch64/set_scno.c (arch_set_scno): Change scno argument type
from long to kernel_scno_t.
* linux/alpha/set_scno.c (arch_set_scno): Likewise.
* linux/arc/set_scno.c (arch_set_scno): Likewise.
* linux/arm/set_scno.c (arch_set_scno): Likewise.
* linux/avr32/set_scno.c (arch_set_scno): Likewise.
* linux/bfin/set_scno.c (arch_set_scno): Likewise.
* linux/crisv10/set_scno.c (arch_set_scno): Likewise.
* linux/hppa/set_scno.c (arch_set_scno): Likewise.
* linux/i386/set_scno.c (arch_set_scno): Likewise.
* linux/ia64/set_scno.c (arch_set_scno): Likewise.
* linux/m68k/set_scno.c (arch_set_scno): Likewise.
* linux/metag/set_scno.c (arch_set_scno): Likewise.
* linux/microblaze/set_scno.c (arch_set_scno): Likewise.
* linux/mips/set_scno.c (arch_set_scno): Likewise.
* linux/nios2/set_scno.c (arch_set_scno): Likewise.
* linux/or1k/set_scno.c (arch_set_scno): Likewise.
* linux/powerpc/set_scno.c (arch_set_scno): Likewise.
* linux/riscv/set_scno.c (arch_set_scno): Likewise.
* linux/s390/set_scno.c (arch_set_scno): Likewise.
* linux/sh/set_scno.c (arch_set_scno): Likewise.
* linux/sh64/set_scno.c (arch_set_scno): Likewise.
* linux/sparc/set_scno.c (arch_set_scno): Likewise.
* linux/tile/set_scno.c (arch_set_scno): Likewise.
* linux/x86_64/set_scno.c (arch_set_scno): Likewise.
* linux/xtensa/set_scno.c (arch_set_scno): Likewise.
* linux/aarch64/get_scno.c (arch_get_scno): Change scno variable type
from long to kernel_scno_t.
* linux/alpha/get_scno.c (arch_get_scno): Likewise.
* linux/arm/get_scno.c (arch_get_scno): Likewise.
* linux/sh/get_scno.c (arch_get_scno): Likewise.
* linux/x86_64/get_scno.c (arch_get_scno): Likewise.
* syscall.c (arch_set_scno): Likewise.
(shuffle_scno): Change return type from long to kernel_scno_t.
(syscall_name): Change argument type from long to kernel_scno_t.
2016-12-18 22:57:57 +00:00
ae39bba347 Lowercase SCNO_IN_RANGE and SCNO_IS_VALID
* defs.h (SCNO_IN_RANGE): Rename to scno_in_range.  All callers updated.
(SCNO_IS_VALID): Rename to scno_is_valid.  All callers updated.
2016-12-18 22:57:57 +00:00
832fd63fc4 Turn SCNO_IN_RANGE and SCNO_IS_VALID into static inline functions
* defs.h (SCNO_IN_RANGE, SCNO_IS_VALID): Transform into static inline
functions.
2016-12-18 22:57:57 +00:00
f73dcf3c21 count.c: use syserror instead of direct u_error access
* count.c (count_syscall): Use syserror instead of u_error.
2016-12-18 22:57:57 +00:00
f0ba3723f5 Replace "(unsigned long) -1L" with -1UL
* defs.h (dumpiov): Replace "(unsigned long) -1L" with -1UL.
* io.c (print_iovec, tprint_iov): Likewise.
* msghdr.c (SYS_FUNC(sendmsg)): Likewise.
* syscall.c (dumpio): Likewise.
* poll.c (decode_poll_exiting): Replace "(unsigned int) -1" with -1U.
2016-12-18 14:09:51 +00:00
ee75f4e926 Add toplevel recursive check-valgrind rule
* Makefile.am (.PHONY): Add check-valgrind-local.
(check-valgrind): New rule.
* configure.ac (AM_EXTRA_RECURSIVE_TARGETS): Add it.
2016-12-18 14:09:51 +00:00
0fcb3efcf3 m4: fix check-valgrind-* rules generated by AX_VALGRIND_CHECK
* m4/ax_valgrind_check.m4 (check-valgrind-$(1)): Depend
on $(BUILT_SOURCES), honor $(AM_MAKEFLAGS), build check-am
instead of check-TESTS.
2016-12-18 14:09:51 +00:00
c121227125 travis: do coverage using a dedicated build
* .travis.yml (after_success): Remove.
(matrix): Create an entry for the regular x86_64 target.
* travis-success.sh: Merge into ...
* travis-build.sh: ... this file.  Disable optimization
for coverage builds.
* travis-install.sh: Rename COVERAGE=true to CHECK=coverage.
2016-12-18 14:09:51 +00:00
faf03528c2 mips n32: provide fallback definitions of kernel_long_t/kernel_ulong_t
* kernel_types.h [!(HAVE___KERNEL_LONG_T && HAVE___KERNEL_ULONG_T) &&
LINUX_MIPSN32] (kernel_long_t, kernel_ulong_t): Define to long long types.
2016-12-17 12:06:24 +00:00
Eugene Syromyatnikov
f958b3ce5b util: simplify definitions of bit mask constants in umovestr
* util.c (umovestr): Do not check for SIZEOF_LONG in definitions
of bit mask constants.
2016-12-17 12:06:24 +00:00
Eugene Syromyatnikov
6f4ecb2add tests: check decoding of prctl operations without arguments
* tests/prctl-no-args.c: New file.
* tests/prctl-no-args.test: New test.
* tests/.gitignore: Add prctl-no-args.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add prctl-no-args.test.
2016-12-17 12:06:21 +00:00
Eugene Syromyatnikov
2dd34a4da7 tests: check decoding of prctl PR_[GS]ET_SECUREBITS operations
* tests/prctl-securebits.c: New file.
* tests/prctl-securebits.test: New test.
* tests/.gitignore: Add prctl-securebits.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add prctl-securebits.test.
2016-12-17 12:06:07 +00:00
Eugene Syromyatnikov
73e9623acf tests: check decoding of prctl PR_[GS]ET_DUMPABLE operations
* tests/prctl-dumpable.c: New file.
* tests/prctl-dumpable.test: New test.
* tests/.gitignore: Add prctl-dumpable.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add prctl-dumpable.test.
2016-12-17 12:02:07 +00:00
Eugene Syromyatnikov
ea01cb0e5b prctl: implement decoding of SUID_DUMP_* constants in PR_[GS]ET_DUMPABLE
* xlat/pr_dumpable.in: New file.
* prctl.c: Include "xlat/pr_dumpable.h".
(SYS_FUNC(prctl)): Decode returned value of PR_GET_DUMPABLE operation
and the second syscall argument of PR_SET_DUMPABLE operation
as SUID_DUMP_* constants.
2016-12-17 11:40:03 +00:00
f55ef46feb Include "kernel_types.h" in defs.h and tests/tests.h
As kernel_ulong_t type is going to be used in the definition
of struct tcb and in many function prototypes, make it readily
available for every source file by including "kernel_types.h"
in defs.h and tests/tests.h files.

* defs.h: Include "kernel_types.h".
* tests/tests.h: Likewise.
* desc.c: Do not include "kernel_types.h".
* dirent.c: Likewise.
* keyctl.c: Likewise.
* syscall.c: Likewise.
* linux/asm_stat.h: Likewise.
* tests/answer.c: Likewise.
* tests/epoll_pwait.c: Likewise.
* tests/fanotify_init.c: Likewise.
* tests/fanotify_mark.c: Likewise.
* tests/file_handle.c: Likewise.
* tests/ftruncate.c: Likewise.
* tests/getdents.c: Likewise.
* tests/init_delete_module.h: Likewise.
* tests/inotify.c: Likewise.
* tests/inotify_init1.c: Likewise.
* tests/ioprio.c: Likewise.
* tests/ipc_msgbuf.c: Likewise.
* tests/kcmp.c: Likewise.
* tests/kexec_file_load.c: Likewise.
* tests/kexec_load.c: Likewise.
* tests/keyctl.c: Likewise.
* tests/lookup_dcookie.c: Likewise.
* tests/lseek.c: Likewise.
* tests/mq_sendrecv.c: Likewise.
* tests/nsyscalls.c: Likewise.
* tests/pkey_alloc.c: Likewise.
* tests/pkey_free.c: Likewise.
* tests/pkey_mprotect.c: Likewise.
* tests/prctl-pdeathsig.c: Likewise.
* tests/prctl-tsc.c: Likewise.
* tests/preadv2-pwritev2.c: Likewise.
* tests/process_vm_readv_writev.c: Likewise.
* tests/read-write.c: Likewise.
* tests/setfsugid.c: Likewise.
* tests/setns.c: Likewise.
* tests/truncate.c: Likewise.
* tests/unshare.c: Likewise.
* tests/xgetrlimit.c: Likewise.
2016-12-16 12:01:44 +00:00
2fc39d0a4c Post-release administrivia
* NEWS: Add a header line for the next release.
* debian/changelog.in: Add a changelog entry for 4.15-1.
* strace.spec.in: Likewise.
2016-12-15 00:08:06 +00:00
3a838cd31a xlat: provide fallback definitions for NETLINK_* constants
As new constants have been added gradually over kernel releases, define
all constant values to make newer constants decoded properly when strace
is built with older kernel headers.

* xlat/netlink_protocols.in: Add default values for constants.
* net.c [!NETLINK_SOCK_DIAG && NETLINK_INET_DIAG]: Remove.
* socketutils.c: Likewise.
2016-12-14 08:09:10 +00:00
76d4eee640 tests: relax getaffinity return value check in tests/sched_xetaffinity.c
* tests/sched_xetaffinity.c (errstr): New variable.
(getaffinity, setaffinity): Initialize it.
(main): Use it.  Allow getaffinity return value to be less than
its cpusetsize argument.
2016-12-14 02:03:04 +00:00
a3f44329a5 tests: fix threads-execve.test for large pids
* tests/threads-execve.c (main): Fix expected output for large pids.
2016-12-14 01:02:03 +00:00
6dc96f5c75 Prepare for 4.15 release
* NEWS: Update for 4.15 release.
2016-12-13 20:21:22 +00:00
9b96cd97af .mailmap: add addresses of Thomas De Schampheleire
* .mailmap: Add both addresses of Thomas De Schampheleire here to avoid
duplications in CREDITS file.
2016-12-13 20:43:57 +00:00
8ed741fc59 Sync strace.spec and debian/ with packages
* debian/control: Add Vcs-* metadata from 4.13-0.1.
* debian/watch: Sync with 4.13-0.1.
* strace.spec.in: Sync with 4.14.0.100.622a-1.
2016-12-13 20:43:57 +00:00
3dac7272e8 tests: workaround a bug in GNU grep
Workaround a bug introduced in GNU grep 2.27, for details see
https://lists.gnu.org/archive/html/bug-grep/2016-12/msg00011.html

* tests/init.sh (grep_pid_status): New function.
* tests/detach-running.test: Use it instead of grep to search
in /proc/$pid/status.
* tests/detach-sleeping.test: Likewise.
* tests/detach-stopped.test: Likewise.
2016-12-13 20:21:22 +00:00
Eugene Syromyatnikov
34283c2f82 tests: fix typo in comment inside prctl-tsc.c 2016-12-13 20:21:22 +00:00
Sean Stangl
54c7792bfd Fix libunwind segfault when -p is passed before -k
* strace.c (init) [USE_LIBUNWIND]: Call unwind_tcb_init after
unwind_init for all allocated tcb structures if stack trace is enabled.
* unwind.c (unwind_tcb_init): Skip if tcb is already initialized.

Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
2016-12-13 20:21:22 +00:00
Eugene Syromyatnikov
9555f21588 Update NEWS
Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
2016-12-13 20:10:44 +00:00
ab28d7f1e5 tests: skip fault injection tests on unsupported platforms
* tests/fault_injection.sh: New file.
* tests/Makefile.am (EXTRA_DIST): Add it.
* tests/fault_injection-exit_group.test: Use it.
* tests/fault_injection.test: Likewise.
2016-12-07 19:46:13 +00:00
5aff0e3c6e tests: introduce require_min_kernel_version_or_skip function
* tests/init.sh (kernel_version_code,
require_min_kernel_version_or_skip): New functions.
* tests/threads-execve.test: Use require_min_kernel_version_or_skip.
2016-12-07 19:46:12 +00:00
Eugene Syromyatnikov
d679dcd6aa tests: add descriptions to prctl-pdeathsig and prctl-tsc tests 2016-12-07 18:28:33 +00:00
a2633e4a59 tests: robustify prctl-pdeathsig.test and prctl-tsc.test
Rrobustify remaining prctl tests against unrelated prctl invocations

* tests/prctl-pdeathsig.test: Filter out unrelated PR_GET_* and PR_SET_*
prctl calls.
* tests/prctl-tsc.test: Likewise.
2016-12-07 16:22:50 +00:00
Thomas De Schampheleire
a3da3c32c1 Makefile.am: don't confuse CFLAGS and CFLAGS_FOR_BUILD
Commit dc427d50d9 enabled a number of extra
warning flags through configure.ac.  The configure script will determine
dynamically if CC supports these flags before adding them to WARN_CFLAGS.

ioctlsort is compiled with CC_FOR_BUILD, rather than CC.  Nevertheless,
the flags passed to this compilation also include WARN_CFLAGS (through
AM_CFLAGS).  This is incorrect: in a cross-compilation use case, CC
and CC_FOR_BUILD are not the same.  The former is the cross-compiler,
the latter is the host compiler.  Both may be of different versions
and support different warning flags.

In particular, this posed a problem when cross-compiling with a host
compiler gcc 4.1, which does not support all the new flags:

    /usr/bin/gcc -DHAVE_CONFIG_H   -I./linux/arm -I./linux/arm -I./linux
    -I./linux -I. -I. -I/host-sysroot/usr/include -Wall -Wempty-body
    -Wformat-security -Wignored-qualifiers -Winit-self -Wlogical-op
    -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration
    -Wold-style-definition -Wsign-compare -Wtype-limits -Wwrite-strings -O2
    -I/host-sysroot/usr/include -DIOCTLSORT_INC=\"ioctls_all0.h\" -c -o
    ioctlsort0.o ./ioctlsort.c
    cc1: error: unrecognized command line option "-Wempty-body"
    cc1: error: unrecognized command line option "-Wignored-qualifiers"
    cc1: error: unrecognized command line option "-Wlogical-op"
    cc1: error: unrecognized command line option "-Wmissing-parameter-type"
    cc1: error: unrecognized command line option "-Wold-style-declaration"
    cc1: error: unrecognized command line option "-Wtype-limits"
    make[2]: *** [ioctlsort0.o] Error 1

* Makefile.am (AM_CFLAGS_FOR_BUILD, AM_CPPFLAGS_FOR_BUILD): New
variables.
(ioctlsort_CPPFLAGS): Use AM_CPPFLAGS_FOR_BUILD instead of AM_CPPFLAGS.
(ioctlsort_CFLAGS): Use AM_CFLAGS_FOR_BUILD instead of AM_CFLAGS.
(ioctlsort_LDFLAGS): Use AM_LDFLAGS_FOR_BUILD instead of AM_LDFLAGS.
* m4/ax_prog_cc_for_build.m4 (AX_PROG_CC_FOR_BUILD): Redirect
WARN_CFLAGS and gl_unknown_warnings_are_errors, call st_WARN_CFLAGS,
substitute WARN_CFLAGS_FOR_BUILD.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
2016-12-07 15:53:13 +00:00
f91def0384 m4: prepare gl_WARN_ADD for simultaneous use of multiple compilers
* m4/warnings.m4 (gl_COMPILER_OPTION_IF): Change gl_Flags to use
_AC_LANG_PREFIX[]FLAGS in unquoted form.  Change gl_Warn to use gl_Flags
instead of _AC_LANG_ABBREV.  Change notification message to mention
the variable name of the compiler.
(gl_UNKNOWN_WARNINGS_ARE_ERRORS): Do nothing if
gl_unknown_warnings_are_errors is set.
(gl_WARN_ADD): Change the use of gl_UNKNOWN_WARNINGS_ARE_ERRORS from
AC_REQUIRE to a regular call.
2016-12-07 15:53:13 +00:00
cdeb5dda0a AX_PROG_CC_FOR_BUILD: redirect more variables related to C compiler
Some of these variables cannot be redirected using traditional
pushdef/popdef mechanism because of complex constructions like
[ac_cv_[]_AC_LANG_ABBREV[]_compiler_gnu] employed by autoconf macros.
Use st_SAVE_VAR/st_RESTORE_VAR to workaround this issue.

* m4/ax_prog_cc_for_build.m4: Redirect ac_cv_prog_cc_stdc,
ac_cv_prog_cc_c11, ac_cv_prog_cc_c99, ac_cv_prog_cc_c89,
am_cv_prog_cc_c_o, and am_cv_CC_dependencies_compiler_type using
pushdef/popdef.
Redirect ac_c_decl_warn_flag, ac_c_preproc_warn_flag, ac_c_werror_flag,
ac_compile, ac_compiler_gnu, ac_cpp, ac_cv_c_compiler_gnu,
ac_cv_c_decl_report, and ac_link using st_SAVE_VAR/st_RESTORE_VAR.
2016-12-07 11:14:03 +00:00
9beaf2c3d3 Move all gl_WARN_ADD calls to a separate m4 macro
This is going to be needed for the upcoming AX_PROG_CC_FOR_BUILD
change.

* configure.ac: Call st_WARN_CFLAGS before AX_PROG_CC_FOR_BUILD.
Move all gl_WARN_ADD calls ...
* m4/st_warn_cflags.m4: ... here.
2016-12-07 10:59:52 +00:00
c26d031c1f m4: introduce st_SAVE_VAR and st_RESTORE_VAR macros
These new macros are going to be needed for the upcoming
AX_PROG_CC_FOR_BUILD change.

* m4/st_save_restore_var.m4: New file.
2016-12-07 10:58:24 +00:00
5c20f4aac4 tests: add valgrind support to "make check"
* m4/ax_valgrind_check.m4: Import from the autoconf-archive package.
* configure.ac: Invoke AX_VALGRIND_CHECK.
* valgrind.supp: Move to tests/strace.supp.
* Makefile.am (EXTRA_DIST): Remove valgrind.supp.
* tests/Makefile.am: Add @VALGRIND_CHECK_RULES@.
(VALGRIND_FLAGS, VALGRIND_SUPPRESSIONS_FILES): New variables.
(EXTRA_DIST): Add strace.supp.
* tests/init.sh: Add valgrind command prefix to $STRACE when appropriate.
2016-12-06 16:20:54 +00:00
427e7431ba tests: robustify threads-execve.test against race conditions
Due to probabilistic nature of the test, try it several times.

* tests/threads-execve.c (NUMBER_OF_ITERATIONS): Change to 1.
* tests/threads-execve.test: Iterate up to 10 times.
2016-12-06 16:20:51 +00:00
51694267bd tests: fix expected output in strace-ttt.test
If strace -ttt is running too long, it might happen that time stamps
before and after its invocation differ for more than a second.
Adjust expected output to handle this rare but possible case.

* tests/strace-ttt.test: Allow any time stamp between start and finish
of strace invocation.
2016-12-06 15:27:21 +00:00
52fe35f262 tests: fix expected output in strace-tt.test
If strace -tt is running too long, it might happen that time stamps
before and after its invocation differ for more than a second.
Adjust expected output to handle this rare but possible case.

* tests/strace-tt.test: Allow any time stamp between start and finish
of strace invocation.
2016-12-06 15:27:08 +00:00
a2002a648e tests: robustify redirect.test against race conditions
Introduce a synchronization mechanism between the tracee and its peer.

* tests/redirect.test: Change timeout file to $OUT.  Let the tracee
remove $LOG, wait for $LOG removal in its peer.
2016-12-06 13:16:42 +00:00
997f49f190 tests: robustify attach-f-p.test against race conditions
Introduce a synchronization mechanism between attach-f-p and strace.

* tests/attach-f-p-cmd.c: New file.
* tests/Makefile.am (check_PROGRAMS): Add attach-f-p-cmd.
* tests/attach-f-p.c: Include <sys/stat.h>.
(main): Write to stdout instead of descriptor 3.  Wait for the peer
writing to stdout.
* tests/attach-f-p.test: Assume that ./attach-f-p-cmd works.
Use $OUT for expected output.  Use attach-f-p-cmd for unlocking $OUT.
2016-12-06 09:09:18 +00:00