summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* Add a test for the latest select decoding fixDr. David Alan Gilbert2013-11-05
| | | | * test/select.c (main): Add a test for nfds larger than FD_SETSIZE.
* test/select.c: make comment more understandable.Denys Vlasenko2013-11-05
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Fix select decoding with bogus (huge or negative) nfds.Dr. David Alan Gilbert2013-11-05
| | | | | | | | | | | | We used to allocate and fetch bit arrays using a sanitized length, but then iterate over them with "j < arg[0]" condition, where arg[0] is not sanitized. This segfaults if arg[0] is huge or negative. This change fixes this. Add test/select.c to capture the case. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Improve sigreturn decoding on x86 to show RT signal bits too.Denys Vlasenko2013-07-16
| | | | | | | | | This includes decoding of 32-bit sigreturn by 64-bit strace, which previously wasn't done. Added a test for it. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* test: add mtd/ubi test helpersMike Frysinger2013-05-02
| | | | | | | | | | | | I used these to develop the mtd/ubi ioctl decoders. * test/.gitignore: Add mtd/ubi. * test/Makefile: Declare all tests in a PROGS var. Declare build targets .PHONY. (all): Depend on $(PROGS) instead of hardcoded list. (clean): Remove $(PROGS) instead of hardcoded list. * test/mtd.c: New file. * test/ubi.c: Likewise.
* test: include headers for used funcsMike Frysinger2013-05-02
| | | | | | | | | | | | | These funcs use things like wait/write/read/strcmp but sometimes don't include the right header for them. * test/Makefile: Add -Wall to CFLAGS. * test/clone.c: Include unistd.h. * test/fork.c: Include sys/wait.h. * test/sig.c: Include unistd.h. * test/sigkill_rain.c: Include sys/wait.h. * test/vfork.c: Include sys/wait.h. * test/wait_must_be_interruptible.c: Include string.h
* test/threaded_execve: fix on metagJames Hogan2013-05-01
| | | | | | | | | | The metag ABI has stacks growing upwards so clone expects the stack argument to point at the bottom of the stack instead of the top. * test/threaded_execve.c [__metag__]: Define clone2 differently to avoid a segfault at runtime. Signed-off-by: James Hogan <james.hogan@imgtec.com>
* test/skodic: make a bit more portableJames Hogan2013-05-01
| | | | | | | | | * test/skodic.c (main): Don't use MAP_FIXED since valid virtual addresses vary between architectures (as far as I can tell the use of MAP_FIXED is not relevant to the test). Also don't assume the file desriptor returned by open call is 3 when passing it to mmap. Signed-off-by: James Hogan <james.hogan@imgtec.com>
* Clean up mmap decodingDenys Vlasenko2013-02-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous code merges too many similar, but different ways of decoding mmap. For example, sys_old_mmap is "params in memory" API... except SH[64], where it is "params in regs", i.e. what sys_mmap ("new mmap") function does on other arches! It's much simpler when every mmap handler has same API regardless of arch. Where API means whether params are in regs or in memory, and whether offset is in bytes, pages, or 4k blocks. Then we just insert correct function pointers into arch syscall tables. It turns out there are four common mmap APIs over all architectures which exist in Linux kernel, and one outlier for S390. A number of mmap decoders were plain wrong in arch tables. For example, BFIN has no old_mmap. It returns ENOSYS. I checked kernel sources for all arches nad fixed the tables. There was dead code for x86_64 for old_mmap: x86_64 has no old_mmap. * mem.c: Refactor mmap functions so that we have five mmap syscall handlers, each with the fixed API (not varying by arch). * pathtrace.c (pathtrace_match): Adjust sys_func == mmap_func checks. * linux/syscall.h: Declare new mmap syscall handler functions. * linux/arm/syscallent.h: mmap2 is sys_mmap_pgoff. * linux/avr32/syscallent.h: mmap is sys_mmap_pgoff. * linux/bfin/syscallent.h: old_mmap is ENOSYS, mmap2 is sys_mmap_pgoff. * linux/hppa/syscallent.h: mmap2 is sys_mmap_4koff. * linux/i386/syscallent.h: mmap2 is sys_mmap_pgoff. * linux/ia64/syscallent.h: mmap2 is sys_mmap_pgoff. * linux/m68k/syscallent.h: mmap2 is sys_mmap_pgoff. * linux/microblaze/syscallent.h: old_mmap is sys_mmap, mmap2 is sys_mmap_pgoff. * linux/mips/syscallent.h: mmap is sys_mmap_4kgoff. * linux/or1k/syscallent.h: mmap2 is sys_mmap_pgoff. * linux/powerpc/syscallent.h: mmap2 is sys_mmap_4kgoff. * linux/s390/syscallent.h: mmap2 is sys_old_mmap_pgoff. * linux/s390x/syscallent.h: mmap is sys_old_mmap and thus has 1 arg. * linux/sh/syscallent.h: old_mmap2 is sys_mmap, mmap2 is sys_mmap_4koff. * linux/sh64/syscallent.h: Likewise. * linux/sparc/syscallent1.h: mmap is TD|TM. * linux/tile/syscallent1.h: mmap2 is sys_mmap_4koff. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fixes in "new" mmapDenys Vlasenko2013-02-18
| | | | | | | | | * mem.c (sys_mmap): Ensure unsigned expansion of tcp->u_arg[5]. Add page shift of offset for I386. Use tcp->ext_arg[5] as offset for X32. (sys_old_mmap): [X32] Remove this function, X32 doesn't use is. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Remove wrong x32-specific lseekDenys Vlasenko2013-02-17
| | | | | | | | | | | | Testing confirmed what I suspected: x32 lseek uses kernel-sized (i.e. wide) long for offset parameter. * file.c: Delete sys_lseek32. * linux/syscall.h: Likewise. * linux/x32/syscallent1.h: Likewise. * test/x32_lseek.c: New file. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* test/threaded_execve: make it also test a case when leader is not in syscallDenys Vlasenko2012-03-17
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Tidy up includes and copyright notices, fix indentationDenys Vlasenko2012-03-16
| | | | | | | | | | | | | | | The files not mentioned in changelog below had only copyright notices fixes and indentation fixes. * defs.h: Include <stdint.h> and <inttypes.h>. * file.c: Do not include <inttypes.h>. Move struct kernel_dirent declaration below top include block. * block.c: Do not include <stdint.h> and <inttypes.h>. * quota.c: Likewise. * desc.c: Likewise. * signal.c: Likewise. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fix a case of broken output if last seen syscall was exitDenys Vlasenko2012-01-28
| | | | | | | | | | | | | | | | | * defs.h: Rename tcp_last to printing_tcp. Explain what it means. Remove printtrailer() function. * process.c (sys_exit): Convert printtrailer() call to "printing_tcp = NULL". * strace.c: Add new variable printing_tcp. (cleanup): Convert printtrailer() call to "printing_tcp = NULL". (trace): Likewise. (trace): Fix checks for incomplete line - it was working wrongly if last syscall was exit. (printleader): Set printing_tcp. (printtrailer): Remove this function. * syscall.c: Remove tcp_last variable. (trace_syscall_entering): Don't set printing_tcp, printleader call now does it. (trace_syscall_exiting): Convert printtrailer() call to "printing_tcp = NULL". Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Add new test program: test/threaded_execve.cDenys Vlasenko2012-01-27
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Improve code readability by avoiding assignments inside if()Denys Vlasenko2011-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | * desc.c (decode_select): Move assignment out of if() condition. * file.c (sprinttime): Likewise. (sys_getdirentries): Likewise. * io.c (sys_ioctl): Likewise. * strace.c (test_ptrace_setoptions_followfork): Likewise. (main): Likewise. (proc_open): Likewise. (detach): Likewise. (proc_poll): Likewise. (trace): Likewise. * syscall.c (qualify): Likewise. (sys_indir): Likewise. * test/procpollable.c (main): Likewise. * test/sfd.c (main): Likewise. * time.c (printtv_bitness): Likewise. (sprinttv): Likewise. (print_timespec): Likewise. (void sprint_timespec): Likewise. (printitv_bitness): Likewise. * util.c (dumpstr): Likewise. (umovestr): Likewise. (fixvfork): Likewise. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Optimize sys_old_mmapDenys Vlasenko2011-08-23
| | | | | | | | | | | | * mem.c (sys_old_mmap): For Ia64 and 32-bit personality of x86-64, copy narrow parameters from userspace by single umove, not by six separate ones; then assign them to long u_arg[i]. For SH[64], avoid copying of tcp->u_arg. (sys_mmap): Add FIXME comment - SH64 and i386 seem to be handled differently for no apparent reason. * test/mmap_offset_decode.c: New test program, illustrates FIXME. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Add fflush after printf in test/sigkill_rain.cDenys Vlasenko2011-06-08
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Update test/* directory, it seem to be a bit bit-rottedDenys Vlasenko2011-06-08
| | | | | | | | Added README; modified sigkill_rain.c to be more understandable, made clone.c compile; added wait_must_be_interruptible.c test; updated Makefile and .gitignore. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Whitespace cleanups. no code changes.Denys Vlasenko2011-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bjm.c: Fix tabulation (such as extra spaces before tabs), convert punctuation where it deviates from prevalent form elsewhere in strace code, convert sizeof and offsetof where it deviates from from prevalent form, remove space between function/macro/array names and (parameters) or [index], add space between "if" and (condition), correct non-standard or wrong indentaion. * defs.h: Likewise * desc.c: Likewise * file.c: Likewise * ipc.c: Likewise * linux/arm/syscallent.h: Likewise * linux/avr32/syscallent.h: Likewise * linux/hppa/syscallent.h: Likewise * linux/i386/syscallent.h: Likewise * linux/ioctlsort.c: Likewise * linux/m68k/syscallent.h: Likewise * linux/microblaze/syscallent.h: Likewise * linux/powerpc/syscallent.h: Likewise * linux/s390/syscallent.h: Likewise * linux/s390x/syscallent.h: Likewise * linux/sh/syscallent.h: Likewise * linux/sh64/syscallent.h: Likewise * linux/tile/syscallent.h: Likewise * linux/x86_64/syscallent.h: Likewise * mem.c: Likewise * net.c: Likewise * pathtrace.c: Likewise * process.c: Likewise * signal.c: Likewise * sock.c: Likewise * strace.c: Likewise * stream.c: Likewise * sunos4/syscall.h: Likewise * sunos4/syscallent.h: Likewise * svr4/syscall.h: Likewise * svr4/syscallent.h: Likewise * syscall.c: Likewise * system.c: Likewise * test/childthread.c: Likewise * test/leaderkill.c: Likewise * test/skodic.c: Likewise * time.c: Likewise * util.c: Likewise Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Remove obsolete .cvsignore filesDmitry V. Levin2011-02-25
| | | | | * test/.cvsignore: Rename to test/.gitignore. * */.cvsignore, */*/.cvsignore: Removed.
* Cleanup trailing whitespaces and indentation that uses spaces before tabsDmitry V. Levin2009-07-08
| | | | | | | Correct spacing to fix warnings reported by git diff --check 4b825dc642cb6eb9a060e54bf8d69288fbee4904 HEAD Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
* Revert unapproved commits.Roland McGrath2009-06-02
|
* By Hans-Christian Egtvedt (hans-christian.egtvedt AT atmel.com):Denys Vlasenko2009-02-25
| | | | | | | strace.c: suppress "warning: unused static" message by adding #ifdef's around a variable .gitignore: trivial test/*.c: cleanup (suppress warnings, much better style).
* test/sigkill_rain.c: a testcase with lots of async deathsDenys Vlasenko2009-02-13
|
* * defs.h: Add new struct tcb fields: wait_status, next_need_service.Denys Vlasenko2009-01-09
| | | | | | | | | | | | make flags field wider (ints are easier to work with on many CPUs). * strace.c (trace): Split this function into two: collect_stopped_tcbs() and handle_stopped_tcbs(). Now we collect *all* waitable tasks, then handle them all, then repeat. Fixes RH#478419 "Some threads stop when strace with -f option is executed on a multi-thread process" * test/many_looping_threads.c: example program which cna't be straced successfully without this fix.
* Fix build breakage from my previous commit.Denys Vlasenko2008-12-23
| | | | | | Now I test for PT_SETOPTIONS being #defined. Remove trailing whitespace. No actual code changes.
* vda tests his commit powers by removing trailing whitespace from a testDenys Vlasenko2008-12-09
|
* 2007-11-06 Jan Kratochvil <jan.kratochvil@redhat.com>Roland McGrath2007-11-13
| | | | | | | | | * strace.c [LINUX] (droptcb): Recurse on TCP->parent if it is a TCB_EXITING zombie group leader. * test/childthread.c: New file. * test/.cvsignore, test/Makefile: Add it. Code advisory: Roland McGrath Fixes RH#354261.
* 2007-08-02 Jan Kratochvil <jan.kratochvil@redhat.com>Roland McGrath2007-08-03
| | | | | | | * test/leaderkill.c (start): Renamed to ... (start0): ... here. (start1): New function. (main): Created a new spare thread.
* 2007-07-05 Jan Kratochvil <jan.kratochvil@redhat.com>Roland McGrath2007-07-05
| | | | | * test/leaderkill.c: New file. * test/.cvsignore, test/Makefile: Add it.
* add cloneWichert Akkerman2000-09-03
|
* process.c: perform bpt trick for clone as well so we can get the pid of the ↵Wichert Akkerman2000-09-03
| | | | | | child before it starts doing something file.c: rename dirent64 struct to kernel_dirent64 so things compile again with newer libcs
* test/clone.c: minor fixupWichert Akkerman2000-08-10
| | | | | | | | | | | | Another bunch of patches from John Hughes merged: signal.c: + SVR4 printcontext(): sigset_t != sigset_t* + getcontext returns a value, so print on exit of syscall + add UC_FP to ucontext_flags for OS writers that can't spell + sys_signal(): special case SIG_{ERR,DFL,IGN} + decode_subcall(): only do subcall range checking when needed bunch of UnixWare updates aclocal.m4, acconfig.h, configure.in: add test for long long type
* add clone testWichert Akkerman2000-04-10
|
* README-linux: updated to note that strace might not compileWichert Akkerman2000-04-10
| | | | | | | | | | | | | | | | | | with development kernels bjm.c: sys_query_module: check if malloc succeeds system.c: sys_cap[gs]et(): check if malloc succeeds, only malloc once linux/syscallent.h: updated for 2.3.99pre3 linux/alpha/syscallent.h: updated for 2.3.99pre3, add all osf syscalls even though Linux doesn't implement them syscall.c: add global variables for MIPS registers as well syscall.c: move global variables to before get_scno since that uses them util.c: oops, misspelled defined process.c: fix ptrace calls in change_syscall mem.c: decode sys_madvise Merge patch from Topi Miettinen <Topi.Miettinen@nic.fi> + add support for quotactl, fdatasync, mlock, mlockall, munlockall & acct + small fix for RLIMIT_* and RUSAGE_BOTH + enhace support for capget and capset
* test/vfork.c: new file to test vfork tracesWichert Akkerman2000-02-19
| | | | | | | | test/.cvsignore: new file defs.h: Up maximum number of traced processed to 64 strace.c: Disable some debugging code from davidm implement setarg for more architectures implement change_syscall
* Automatically probe for sys/poll.hPavel Machek2000-02-01
| | | | | Include example of nasty program where strace (by design) gives incorrect output.
* Initial revisionWichert Akkerman1999-02-19