summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Prepare for 4.9 releasev4.9Dmitry V. Levin2014-08-153-13/+24
| | | | | | * NEWS: Update for 4.9 release. * debian/changelog: 4.9-1. * strace.spec: 4.9-1.
* Sync strace.spec and debian/ with packagesDmitry V. Levin2014-08-154-27/+59
| | | | | | | * debian/changelog: Sync with 4.8-1.1. * debian/control: Likewise. * debian/rules: Likewise. * strace.spec: Sync with 4.8-5.
* NEWS: Update for 4.9 releaseDmitry V. Levin2014-08-151-2/+5
|
* Update syscall tables to the point where they include renameat2Mike Frysinger2014-08-1519-30/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | * linux/dummy.h: Add printargs aliases for sys_sched_getattr and sys_sched_setattr. * linux/aarch64/syscallent1.h: Add kcmp/finit_module/sched_setattr/ sched_getattr/renameat2. * linux/alpha/syscallent.h: Add kcmp/finit_module. * linux/arm/syscallent.h: Add sched_setattr/sched_getattr/renameat2. * linux/hppa/syscallent.h: Add sched_setattr/sched_getattr/utimes/renameat2. * linux/i386/syscallent.h: Add sched_setattr/sched_getattr/renameat2. * linux/ia64/syscallent.h: Likewise. * linux/m68k/syscallent.h: Likewise. * linux/microblaze/syscallent.h: Likewise. * linux/mips/syscallent-n32.h: Likewise. * linux/mips/syscallent-n64.h: Add getdents64/sched_setattr/sched_getattr/ renameat2. * linux/mips/syscallent-o32.h: Add sched_setattr/sched_getattr/renameat2. * linux/powerpc/syscallent.h: Fix finit_module/kcmp order. Add sched_setattr/ sched_getattr/renameat2. * linux/s390/syscallent.h: Add sched_setattr/sched_getattr/renameat2. * linux/s390x/syscallent.h: Likewise. * linux/sparc/syscallent.h: Likewise. * linux/x32/syscallent.h: Likewise. * linux/x86_64/syscallent.h: Likewise. * linux/xtensa/syscallent.h: Add sched_setattr/sched_getattr.
* renameat2: add decoding supportMike Frysinger2014-08-154-4/+27
| | | | | | | | * file.c (decode_renameat, sys_renameat2): New functions. (sys_renameat): Use decode_renameat. * pathtrace.c (pathtrace_match): Handle sys_renameat2. * linux/syscall.h (sys_renameat2): New prototype. * xlat/rename_flags.in: New file.
* CREDITS: fix generation in out of tree buildsMike Frysinger2014-08-141-2/+2
| | | | | | | | The {...} code changes the working dir with `cd`, but the commands outside of that block expects to be in the original dir. Change to a subshell so the path outside of this block remains unchanged. * Makefile.am ($(srcdir)/CREDITS): Change {...} to (...).
* ia64: add missing syscallsMike Frysinger2014-08-141-0/+9
| | | | | | | | | | | When the preadv/pwritev syscalls were added, the ones before it in the ia64 list were missed, so all the syscalls there and later were not in the right location (causing things to be decoded incorrectly). Add the missing syscalls before preadv which also re-aligns all the syscalls after that point. This fixes the uio.test. * linux/ia64/syscallent.h: Add syscalls 1310 through 1318.
* ia64: fix sigaction decodingMike Frysinger2014-08-141-4/+4
| | | | | | | | | Looks like ia64 doesn't have sa_restorer either, yet still defines SA_RESTORER. Deploy the same trick that HPPA is using to make the test pass. * signal.c (SA_RESTORER): Undefine when IA64 is defined. (struct new_sigaction) [IA64]: Disable sa_restorer.
* tests: skip detach-stopped.test when PTRACE_SEIZE doesn't workDmitry V. Levin2014-08-121-0/+5
| | | | | | | | detach-stopped.test is known to fail when PTRACE_SEIZE is not available, so skip the test in that case. * tests/detach-stopped.test: Check for "strace -d" output and skip the test when it says that PTRACE_SEIZE doesn't work.
* sh: fix syscall numbering for recv and sendtoErik Johansson2014-08-111-2/+2
| | | | * linux/sh/syscallent.h: Swap recv and sendto syscall entries.
* tests: fix uio building w/out preadv/pwritevMike Frysinger2014-08-113-2/+16
| | | | | | | | | | | The preadv/pwritev symbols weren't added to glibc until the 2.10 release, so trying to build the uio test leads to link failures. Add configure tests and update uio.test to handle this. * configure.ac (AC_CHECK_FUNCS): Add preadv/pwritev. * tests/uio.c: Include config.h. (main): Check for HAVE_PREADV and HAVE_PWRITEV. * tests/uio.test: Check exit status of uio helper.
* tests: ignore *.tmp filesMike Frysinger2014-08-111-0/+1
| | | | | | The tests like to generate random .tmp files, so ignore them. * tests/.gitignore: Add *.tmp.
* tests: fix shell errors in detach testsMike Frysinger2014-08-113-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The current detach test code does: set -e ... cleanup() { set +e kill ... wait ... } ... cleanup exit 0 The problem is that while `set -e` is disabled for the body of the cleanup function, it isn't necessarily disabled in the caller scope. So if the return value of the cleanup function (`wait` in this case) is non-zero, the script ends up failing overall. Add an explicit return 0 to the cleanup function so that we don't kill the overall test pipeline. * tests/detach-running.test (cleanup): Add return 0. * tests/detach-sleeping.test (cleanup): Likewise. * tests/detach-stopped.test (cleanup): Likewise.
* set_ptracer_any: add a little documentationMike Frysinger2014-08-111-0/+2
| | | | | | | This way I don't have to keep reading up on these options and wondering why the code isn't aborting when the call fails. * tests/set_ptracer_any.c (main): Note prctl failures are ok.
* signal: fix thinko in sa_restorerMike Frysinger2014-08-101-2/+2
| | | | | | | | Previous commit here re-added the bugs trying to be fixed due to a logic thinko. The patches were tested in isolation and hand merged later. Oops. * signal.c (struct new_sigaction): Change || to &&.
* sigaction test: support arches w/out SA_RESTORER and swapped argsMike Frysinger2014-08-091-1/+6
| | | | | | | | | Running Linux 3.15 (sparc64) and glibc 2.17 (sparc32) triggers a rt_sigaction call that does not use SA_RESTORER and has an order where it inserts a restorer and a size. The current tests don't support that ordering, so add another regex. * tests/sigaction.awk: Support no SA_RESTORER and swapped args.
* alpha/sparc: fix arg count for rt_sigactionMike Frysinger2014-08-092-2/+2
| | | | | | | Both these arches have a rt_sigaction syscall that takes 5 args, not 4. * linux/alpha/syscallent.h (rt_sigaction): Change nargs to 5. * linux/sparc/syscallent.h (rt_sigaction): Change nargs to 5.
* hppa: fix sigaction decodingMike Frysinger2014-08-091-2/+8
| | | | | | | | | | | | Since the rt_sigaction syscall on hppa doesn't have a sa_restorer, do not include it in the kernel struct. We also have to undefine SA_RESTORER so that code doesn't try to use it. The headers will export this, but the syscall doesn't actually respect it. * signal.c (SA_RESTORER): Undefine when HPPA is defined. (struct new_sigaction): Disable sa_restorer on hppa.
* alpha: fix sigaction decodingMike Frysinger2014-08-091-0/+2
| | | | | | | Since the rt_sigaction syscall on alpha doesn't have a sa_restorer, do not include it in the kernel struct. * signal.c (struct new_sigaction): Disable sa_restorer on alpha.
* Prepare for -yy option supportDmitry V. Levin2014-08-082-3/+3
| | | | | | * defs.h (show_fd_path): Change type to unsigned int. * strace.c (show_fd_path): Likewise. (init): Handle repeated -y option.
* Fix preadv/pwritev offset decoding on ILP32 architecturesDmitry V. Levin2014-08-071-3/+3
| | | | | | | This fixes regression introduced by the previous commit. * io.c (print_llu_from_low_high_val) [SIZEOF_LONG != SIZEOF_LONG_LONG]: Cast argument to unsigned long before casting it to unsigned long long.
* Fix preadv/pwritev offset decoding on bigendian architecturesDmitry V. Levin2014-08-074-30/+42
| | | | | | | | | | | | | | This partially reverts commit 7845a42b39e59e904d01e75e21f7bc7eb6462560. * util.c (printllval): Remove align argument. * defs.h (printllval): Update prototype. (printllval_aligned, printllval_unaligned): Remove. * file.c (sys_readahead, sys_truncate64, sys_ftruncate64, sys_fadvise64, sys_fadvise64_64, sys_sync_file_range, sys_sync_file_range2, sys_fallocate): Replace printllval_aligned call with printllval. * io.c (sys_pread, sys_pwrite): Likewise. (print_llu_from_low_high_val): New function. (sys_preadv, sys_pwritev): Use it instead of printllval_unaligned.
* Decode file descriptors returned by accept and accept4 syscallsDmitry V. Levin2014-08-062-6/+8
| | | | | | | * net.c (do_accept): Rename to do_sockname. (sys_accept, sys_accept4): Update callers, return RVAL_FD. (sys_getsockname, sys_getpeername): Call do_sockname directly. * tests/net-fd.test: Update.
* x32: update io_{setup,submit} syscallsMike Frysinger2014-08-011-2/+4
| | | | | | | | Starting in 3.16, these two syscalls have gotten their own entry point for x32. See linux 7fd44dacdd803c0bbf38bf478d51d280902bb0f1. * linux/x32/syscallent.h: Change existing io_{setup,submit} to 64bit, and add new entry points for x32 specifically.
* xtensa: sort values in struct_user_offsetsMax Filippov2014-06-181-17/+17
| | | | | | | | | | | | | Otherwise ptrace syscall argument decoding is wrong: ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x4048eb]) = 0 ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x3fa6cd30]) = 0 ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x8040676d]) = 0 instead of ptrace(PTRACE_PEEKUSER, 296, pc, [0x4048eb]) = 0 ptrace(PTRACE_PEEKUSER, 296, a1, [0x3fa6cd30]) = 0 ptrace(PTRACE_PEEKUSER, 296, a0, [0x8040676d]) = 0 * process.c (struct_user_offsets) [XTENSA]: Sort values.
* Document -k option as experimentalDmitry V. Levin2014-06-183-3/+3
| | | | | | | | | | strace -k does not produce a reliable output on all supported configurations yet, even basic strace-k.test is known to fail on some of them. * strace.c (usage): Document -k option as experimental. * strace.1: Likewise. * NEWS: Likewise.
* tests: robustify -k testDmitry V. Levin2014-06-186-30/+28
| | | | | | | | | Split stack-fcall.c into several compilation units so that intermediate function calls would not be optimized out by compiler. * tests/stack-fcall.c: Move intermediate functions to ... * tests/stack-fcall-*.c: ... new files. * tests/Makefile.am (stack_fcall_SOURCES): Add stack-fcall-*.c.
* tests: enhance -k testDmitry V. Levin2014-06-132-2/+14
| | | | | | | | Add two more function calls to the stack. Suggested by Masatake YAMATO. * tests/stack-fcall.c (f1): Rename to f3. (f1, f2): New functions. * tests/strace-k.test: Update.
* unwind: ignore memory mappings that have no PROT_EXEC bit setDmitry V. Levin2014-06-131-3/+7
| | | | | * unwind.c (build_mmap_cache): For each memory mapping being scanned, save its PROT_EXEC bit and skip the mapping if it is not set.
* unwind: cleanup build_mmap_cacheDmitry V. Levin2014-06-131-40/+42
| | | | | | | * unwind.c (build_mmap_cache): Move local variables to the code branch where they are used. Check return code of sscanf and strdup. Do not treat unusual memory mappings as fatal errors. Do not skip memory mappings with path names starting with "[".
* unwind: remove unused field from mmap_cache_tDmitry V. Levin2014-06-131-12/+0
| | | | | * unwind.c (mmap_cache_t): Remove "deleted" field. (build_mmap_cache): Remove initialization of "deleted" field.
* unwind: refactor stacktrace_walkDmitry V. Levin2014-06-121-92/+87
| | | | | * unwind.c (stacktrace_walk): Move stack frame printing code to separate function print_stack_frame.
* unwind: constify binary_filename and symbol_name functions argumentsDmitry V. Levin2014-06-121-11/+11
| | | | | | * unwind.c (call_action_fn, print_call_cb, sprint_call_or_error, queue_put, queue_put_call): Add const qualifier to binary_filename and symbol_name arguments.
* unwind: disable stack trace with multiple personalitiesLuca Clementi2014-06-111-0/+18
| | | | | | * unwind.c (unwind_cache_invalidate, unwind_print_stacktrace, unwind_capture_stacktrace): Disable stack tracing of non-default personality processes.
* unwind: rename function_off_set to function_offsetDmitry V. Levin2014-06-051-11/+11
| | | | | | * unwind.c (call_action_fn, stacktrace_walk, STACK_ENTRY_SYMBOL_FMT, print_call_cb, sprint_call_or_error, queue_put, queue_put_call): Rename function_off_set to function_offset.
* unwind: fix a bug in range updating of binary searchDmitry V. Levin2014-06-051-3/+3
| | | | * unwind.c (print_stacktrace): Fix another off-by-one error in binary search.
* unwind: use fopen64 instead of fopenDmitry V. Levin2014-06-051-1/+11
| | | | | | * unwind.c (fopen_for_input): Define to fopen64 iff [_LARGEFILE64_SOURCE && HAVE_FOPEN64], otherwise define it to fopen. (build_mmap_cache): Use fopen_for_input instead of fopen.
* unwind: fix build on 32-bit architecturesDmitry V. Levin2014-06-053-5/+5
| | | | | | | | | | | | Fix compilation warnings in unwind.c on 32-bit architectures. On some architectures getuid is actually getuid32, so change the test to use getpid instead of getuid. * unwind.c (STACK_ENTRY_SYMBOL_FMT): Explicitly cast function_off_set to unsigned long. (queue_put_error): Change the 3rd argument's type to unsigned long. * tests/stack-fcall.c (f1): Use getpid instead of getuid. * tests/strace-k.test: Likewise.
* tests: robustify -w option testDmitry V. Levin2014-06-051-2/+2
| | | | * tests/count.test: Allow nanosleep to spend a bit less time than 1 second.
* Fix delete_module decodingDmitry V. Levin2014-06-044-7/+16
| | | | | | | | * xlat/delete_module_flags.in: New file. * file.c (sys_delete_module): Move ... * bjm.c (sys_delete_module): ... to here. Decode 1st argument using printstr instead of printpath. * NEWS: Mention it.
* Decode paths associated with file descriptors returned by syscallsZubin Mithra2014-06-046-8/+32
| | | | | | | | | | | | * defs.h (RVAL_FD): New macro. (RVAL_MASK, RVAL_STR, RVAL_NONE): Update. * desc.c (sys_dup, sys_delete_module): New functions. (do_dup2, decode_open, sys_creat): Change return value to RVAL_FD. * linux/dummy.h (sys_delete_module, sys_dup): Remove. * linux/syscall.h (sys_delete_module, sys_dup): New prototypes. * syscall.c (trace_syscall_exiting): Handle RVAL_FD. Signed-off-by: Zubin Mithra <zubin.mithra@gmail.com>
* NEWS: Prepare for 4.9 releaseDmitry V. Levin2014-06-031-2/+34
|
* Warn about flags that have no effect with -cDmitry V. Levin2014-06-031-5/+22
| | | | | | * strace.c (init): Issue a warning if -i, -k, -r, -t, -T, or -y is used along with -c. This fixes Debian bug #443895.
* debian: enable security hardening featuresDmitry V. Levin2014-06-031-1/+5
| | | | | | * debian/rules: Follow the advice in https://wiki.debian.org/Hardening and enable maximum hardening as for programs that handle untrusted data. Patch by Markus <waldeck@gmx.de>.
* debian: update control fileDmitry V. Levin2014-06-031-3/+3
| | | | | | | | | | | | | | * debian/control (strace64): Fix a typo in package description. Patch by Pascal De Vuyst <pascal.devuyst@gmail.com>. (strace, strace-udeb): Add x32 to architecture list. Patch by Guillaume Morin <guillaume@morinfr.org>. (strace, strace-udeb): Add or1k to architecture list. Patch by Christian Svensson <debian@cmd.nu>. (strace, strace-udeb): Add arm64 to architecture list, and remove defunct arm. Patch by Wookey <wookey@debian.org>. This fixes Debian bugs: #697625, #727018, #742235, #749956.
* manpage: minor correctionsDmitry V. Levin2014-06-031-18/+23
| | | | | | | | | | | | $ groff -ww -mandoc -z strace.1 strace.1:65: warning: macro `IX' not defined * strace.1: define IX macro as empty for groff. Change remaining '-' as minus to '\-'. Have two word spaces after a full stop as an end of sentence. Use extra space ('\,' or '\/') between roman and italic characters. Based on patch by Bjarni Ingi Gislason <bjarniig@rhi.hi.is>. This fixes Debian bug #725987.
* unwind: tests: add a test for -k optionMasatake YAMATO2014-05-304-1/+64
| | | | | | | | | | | * tests/stack-fcall.c: New test target. * tests/strace-k.test: New test driver. * tests/Makefile.am (check_PROGRAMS): Add stack-fcall. (TESTS): Add strace-k.test. * tests/.gitignore: Add stack-fcall. Signed-off-by: Masatake YAMATO <yamato@redhat.com> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
* unwind: move stacktrace capturing and mmap cache invalidating to ↵Masatake YAMATO2014-05-303-40/+14
| | | | | | | | | | | | | | | | trace_syscall_entering Instead of handling stacktrace capturing and mmap cache invalidating in sys_* functions, handle them uniformly in trace_syscall_entering using new flags introduced by previous two commits. The patch is simpler than its older version(v3). The value of hide_log_until_execve is just ignored. I found the value is nothing to do with this patch. unwind_cache_invalidate is mentioned only once in trace_syscall_exiting. Both are suggested by Dmitry Levin. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
* unwind: add SE and SI flags to syscall entries for all architecturesDmitry V. Levin2014-05-3028-361/+361
| | | | | | Add SE flag to execve, exit, and exit_group syscall entries. Add SI flag to brk, execve, mmap, mprotect, mremap, munmap, remap_file_pages, shmat, and shmdt syscall entries.
* unwind: introduce markers specifying the needs of special care in unwindingMasatake YAMATO2014-05-302-0/+6
| | | | | | | | | | | | | | | | | | | | | | Some system calls require capturing the stack trace before they are processed in kernel. Typical one is execve. Some system calls require invalidating mmap cache after they are processed in kernel. In current implementation these requirements are handled directly by appropriate syscall handlers. However, it is difficult to keep the source code maintainable using this approach to cover all system calls which have such requirements. A more generic way to implement this is to flag all syscalls that require special processing, and handle these flags right in trace_syscall_entering instead of changing syscall handlers. This patch just defines new flags: STACKTRACE_INVALIDATE_CACHE and STACKTRACE_CAPTURE_ON_ENTER. The names of macros are suggested by Dmitry Levin. Signed-off-by: Masatake YAMATO <yamato@redhat.com>