]> granicus.if.org Git - strace/log
strace
14 years ago* NEWS: Update for 4.5.19 release.
Dmitry V. Levin [Tue, 6 Oct 2009 10:40:17 +0000 (10:40 +0000)]
* NEWS: Update for 4.5.19 release.

14 years agoPrepare debian/* files for release
Frederik Schüler [Mon, 5 Oct 2009 20:50:07 +0000 (20:50 +0000)]
Prepare debian/* files for release

* debian/rules: Do not ship ChangeLog anymore.
* debian/control: Update to Debian standards version 3.8.1, and remove
Roland from the Maintainers list.  This closes Debian bug #521458.
* debian/changelog: Document changes and prepare for release.

14 years ago* defs.h [HPPA]: Lower MAX_ARGS from 32 to 6.
Dmitry V. Levin [Mon, 5 Oct 2009 23:32:39 +0000 (23:32 +0000)]
* defs.h [HPPA]: Lower MAX_ARGS from 32 to 6.

14 years ago* ipc.c [LINUX] (sys_shmat): HPPA does not use an IPC multiplexer.
Dmitry V. Levin [Mon, 5 Oct 2009 23:31:54 +0000 (23:31 +0000)]
* ipc.c [LINUX] (sys_shmat): HPPA does not use an IPC multiplexer.

Based on patch from Carlos O'Donell.

14 years ago* linux/hppa/syscallent.h: Update syscalls.
Carlos O'Donell [Mon, 14 Sep 2009 02:06:20 +0000 (02:06 +0000)]
* linux/hppa/syscallent.h: Update syscalls.

Based on work by Kyle McMartin and Helge Deller.

14 years agoFix SA_HANDLER function pointer comparisons for hppa
Carlos O'Donell [Wed, 9 Sep 2009 18:13:19 +0000 (18:13 +0000)]
Fix SA_HANDLER function pointer comparisons for hppa

* signal.c (sys_sigaction): Cast SA_HANDLER function pointers to long.
(sys_rt_sigaction): Likewise.

14 years agoCRIS: Correct first argument to upeek()
Edgar E. Iglesias [Mon, 5 Oct 2009 14:41:02 +0000 (14:41 +0000)]
CRIS: Correct first argument to upeek()

This complements commit ea0e6e80260d2b1b7ad40282012b0e47869bcddf.
* syscall.c [CRISV10 || CRISV32] (syscall_fixup, syscall_enter): Pass
tcp pointer instead of pid to upeek().
* util.c [CRISV10 || CRISV32] (printcall): Likewise.

Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
14 years ago* signal.c (do_signalfd): Fix typo in output format.
Dmitry V. Levin [Mon, 5 Oct 2009 13:45:19 +0000 (13:45 +0000)]
* signal.c (do_signalfd): Fix typo in output format.

14 years ago* Makefile.am (gen_changelog_start_date): Fix date.
Dmitry V. Levin [Mon, 21 Sep 2009 18:37:10 +0000 (18:37 +0000)]
* Makefile.am (gen_changelog_start_date): Fix date.

14 years agoPrepare for 4.5.19 release
Dmitry V. Levin [Mon, 14 Sep 2009 16:34:34 +0000 (16:34 +0000)]
Prepare for 4.5.19 release

* NEWS: Update for 4.5.19 release.
* configure.ac: Version 4.5.19.
* debian/changelog: 4.5.19-1.
* strace.spec: 4.5.19-1.

14 years agoUpdate debian/* to 4.5.18-1
Dmitry V. Levin [Mon, 14 Sep 2009 17:03:20 +0000 (17:03 +0000)]
Update debian/* to 4.5.18-1

* debian/changelog: Update to 4.5.18-1.
* debian/compat: Set compatibility level to 7.
* debian/control (Build-Depends): Update debhelper requirement.
(strace, strace64): Add Section and Priority tags.

14 years agoFix fadvise64 decoding on ARM
Kirill A. Shutemov [Sat, 19 Sep 2009 00:21:33 +0000 (03:21 +0300)]
Fix fadvise64 decoding on ARM

* file.c (sys_fadvise64_64) [ARM]: Fix argument ordering.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
14 years agoFix follow fork/vfork on Linux ARM OABI
Dmitry V. Levin [Fri, 18 Sep 2009 11:30:14 +0000 (11:30 +0000)]
Fix follow fork/vfork on Linux ARM OABI

__NR_SYSCALL_BASE eis 0 for EABI and is 0x900000 for OABI.
* process (change_syscall) [LINUX && ARM]: Mask off the high order bits
when changing syscall.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
Reviewed-by: Kirill A. Shutemov <kirill@shutemov.name>
14 years agoMark shell scripts as executable
Mike Frysinger [Mon, 14 Sep 2009 03:00:50 +0000 (23:00 -0400)]
Mark shell scripts as executable

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoIgnore ioctlsort helper program
Mike Frysinger [Mon, 14 Sep 2009 03:00:06 +0000 (23:00 -0400)]
Ignore ioctlsort helper program

* .gitignore: Add ioctlsort.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agolinux/errno: Add ERFKILL
Mike Frysinger [Mon, 14 Sep 2009 02:53:12 +0000 (22:53 -0400)]
linux/errno: Add ERFKILL

* linux/errnoent.h: Change ERRNO_132 to ERFKILL according to errno 132
definition introduced in Linux 2.6.31.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoAdd accept4 socketcall
Paolo Bonzini [Fri, 14 Aug 2009 10:34:06 +0000 (12:34 +0200)]
Add accept4 socketcall

This second patch in the series adds support for accept4 as a socketcall
sub-call.  Besides the need to renumber all system calls, this poses
no problem.
Tested on i686.

* linux/arm/syscallent.h: Add accept4 socketcall.
* linux/m68k/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/sparc/syscallent.h: Likewise.
* linux/syscallent.h: Likewise.

* linux/sparc/syscall.h (SYS_sub_accept4): Declare.
(SYS_socket_nsubcalls): Update.
* linux/syscall.h: Likewise.

14 years agoReplace x86-64 paccept with accept4
Paolo Bonzini [Fri, 14 Aug 2009 10:34:05 +0000 (12:34 +0200)]
Replace x86-64 paccept with accept4

This patch changes the paccept syscall to accept4 for x86-64, since
the former was dropped in Linux kernel commit v2.6.27-rc7-14-g2d4c826.
At the same time, it adds support for pretty printing its arguments.

* linux/x86_64/syscallent.h: Replace paccept with accept4,
hook in sys_accept4.
* net.c (sys_accept): Leave a small stub calling the new...
(do_accept): ... function, which also adds a flags_arg argument.
(sys_accept4): New.

14 years agoZero-extend 32-bit addresses when printing argv array.
Andreas Schwab [Fri, 28 Aug 2009 17:36:20 +0000 (19:36 +0200)]
Zero-extend 32-bit addresses when printing argv array.

(printargv): Zero-extend 32-bit addresses.
Fixes RH#519480 "64-bit strace is lazy on execve of 32-bit
process".

15 years agoAdd more futex decoding.
Andreas Schwab [Wed, 12 Aug 2009 07:54:42 +0000 (09:54 +0200)]
Add more futex decoding.

* process.c (FUTEX_WAIT_REQUEUE_PI, FUTEX_CMP_REQUEUE_PI)
(FUTEX_PRIVATE_FLAG, FUTEX_CLOCK_REALTIME): Define.
(futexops): Add entries for them.
(sys_futex): Decode FUTEX_CMP_REQUEUE_PI and
FUTEX_WAIT_REQUEUE_PI.

15 years agoGenerate ChangeLog from git log
Dmitry V. Levin [Thu, 9 Jul 2009 00:47:41 +0000 (00:47 +0000)]
Generate ChangeLog from git log

* .gitignore: Add ChangeLog
* ChangeLog: Rename to ChangeLog-CVS.
* Makefile.am (gen-changelog): New rule.
(dist-hook): Depend on it.
(EXTRA_DIST): Add ChangeLog-CVS.
* README-hacking: Describe changes.
* gitlog-to-changelog: Import from gnulib.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
15 years agoCleanup trailing whitespaces and indentation that uses spaces before tabs
Dmitry V. Levin [Wed, 8 Jul 2009 11:21:17 +0000 (11:21 +0000)]
Cleanup trailing whitespaces and indentation that uses spaces before tabs

Correct spacing to fix warnings reported by
git diff --check 4b825dc642cb6eb9a060e54bf8d69288fbee4904 HEAD

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
15 years agoREADME-CVS: Rename to README-hacking
Dmitry V. Levin [Tue, 7 Jul 2009 22:33:41 +0000 (22:33 +0000)]
README-CVS: Rename to README-hacking

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
15 years ago.cvsignore: Remove obsolete file
Dmitry V. Levin [Tue, 7 Jul 2009 21:31:51 +0000 (21:31 +0000)]
.cvsignore: Remove obsolete file

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
15 years agoRevert unapproved commits.
Roland McGrath [Tue, 2 Jun 2009 23:49:22 +0000 (16:49 -0700)]
Revert unapproved commits.

15 years ago* strace.c (handle_stopped_tcbs): Fix cast for 4th argument passed to ptrace().
Dmitry V. Levin [Mon, 1 Jun 2009 18:45:41 +0000 (18:45 +0000)]
* strace.c (handle_stopped_tcbs): Fix cast for 4th argument passed to ptrace().

15 years ago* bjm.c (sys_query_module): Fix format warning reported by
Dmitry V. Levin [Mon, 1 Jun 2009 10:32:27 +0000 (10:32 +0000)]
* bjm.c (sys_query_module): Fix format warning reported by
gcc -Wformat-security.
* file.c (tprint_open_modes): Likewise.
* process.c (printargv): Likewise.
* signal.c (printsignal): Likewise.

15 years agoClean up header checks
Dmitry V. Levin [Mon, 1 Jun 2009 09:59:11 +0000 (09:59 +0000)]
Clean up header checks

* configure.ac: Reformat AC_CHECK_HEADERS to keep it sorted and
easily updated, and reduce merging errors in the future.
* system.c: Convert all non-standard #ifdef checks for specific
headers to regular #ifdef HAVE_*_H checks.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
15 years agofix thinko in ChangeLog
Denys Vlasenko [Mon, 20 Apr 2009 18:43:24 +0000 (18:43 +0000)]
fix thinko in ChangeLog

15 years ago* strace.c (printstatsol, printstat_sparc64):
Denys Vlasenko [Mon, 20 Apr 2009 18:30:13 +0000 (18:30 +0000)]
* strace.c (printstatsol, printstat_sparc64):
Remove NULL and error check for addr parameter.
(printoldstat, printstat, printoldstat64):
Move NULL and error check for addr parameter
so that it happens before printstatsol/printstat_sparc64 calls.

15 years ago* strace.c (collect_stopped_tcbs): Do not enable/disable signals
Denys Vlasenko [Mon, 20 Apr 2009 18:20:18 +0000 (18:20 +0000)]
* strace.c (collect_stopped_tcbs): Do not enable/disable signals
multiple times, do it just once per collecting pass.

15 years ago* file.c (print_dirfd): Use int for file descriptor, not a long.
Denys Vlasenko [Thu, 16 Apr 2009 12:06:16 +0000 (12:06 +0000)]
* file.c (print_dirfd): Use int for file descriptor, not a long.
* process.c (printwaitn): Use int for PID, not a long.

15 years ago* signal (sys_rt_sigtimedwait): Fix sigtimedwait syscall decoding.
Denys Vlasenko [Wed, 15 Apr 2009 13:31:59 +0000 (13:31 +0000)]
* signal (sys_rt_sigtimedwait): Fix sigtimedwait syscall decoding.

15 years ago* signal (sys_rt_sigaction): Print struct sigaction correctly
Denys Vlasenko [Wed, 15 Apr 2009 13:22:59 +0000 (13:22 +0000)]
* signal (sys_rt_sigaction): Print struct sigaction correctly
in 32/64 environment.
* desc.c (printflock): Add #ifdefs around earlier flock 32/64 fix
so that we don't waste time on arches with one personality.

15 years ago* signal.c: Whitespace, comment, and style fixes, no code changes.
Denys Vlasenko [Tue, 14 Apr 2009 12:51:00 +0000 (12:51 +0000)]
* signal.c: Whitespace, comment, and style fixes, no code changes.
* file.c: Ditto.
* time.c: Ditto.
* process.c: Ditto.
* resource.c: Ditto.

15 years ago* system.c (sram_alloc_flag): Add L2_SRAM constant.
Denys Vlasenko [Mon, 23 Mar 2009 13:12:46 +0000 (13:12 +0000)]
* system.c (sram_alloc_flag): Add L2_SRAM constant.
by Mike Frysinger (vapier AT gentoo.org).
(sys_sram_alloc): Fix improperly used %zu:
tcp->u_arg is not a size_t, it is a long.
* net.c (printcmsghdr): Fix improperly used %zu:
struct cmsghdr::cmsg_len is not a size_t.

15 years agoUpdate Changelog to more accurately describe the changes.
Denys Vlasenko [Fri, 20 Mar 2009 13:30:12 +0000 (13:30 +0000)]
Update Changelog to more accurately describe the changes.

15 years agoAs it turned out, "if (interrupted) break;" is needed in both loops,
Denys Vlasenko [Fri, 20 Mar 2009 13:28:00 +0000 (13:28 +0000)]
As it turned out, "if (interrupted) break;" is needed in both loops,
in "collect tasks" loop and in enclosing "collect/process" loop.
Before this patch, "strace cat" + "killall -INT strace" wasn't
making strace stop and exit. This patch restores 4.5.18 behavior
in this regard.

15 years agoRemove "better attach to SIGSTOP", it is not correct...
Denys Vlasenko [Tue, 17 Mar 2009 14:46:54 +0000 (14:46 +0000)]
Remove "better attach to SIGSTOP", it is not correct...
(^C fix remains).

15 years ago* strace.c (startup_attach): Take care to correctly attach
Denys Vlasenko [Tue, 17 Mar 2009 14:29:59 +0000 (14:29 +0000)]
* strace.c (startup_attach): Take care to correctly attach
to stopped processes by resending SIGSTOP.
(collect_stopped_tcbs): Check for ^C here, not in trace().
(trace): Remove check for ^C.

15 years agoDecode fcntl's F_{GET,SET}LEASE, F_NOTIFY, and F_DUPFD_CLOEXEC.
Denys Vlasenko [Tue, 10 Mar 2009 20:41:58 +0000 (20:41 +0000)]
Decode fcntl's F_{GET,SET}LEASE, F_NOTIFY, and F_DUPFD_CLOEXEC.
By Mike Frysinger (vapier AT gentoo.org)
* desc.c: Add F_SETLEASE, F_GETLEASE, F_NOTIFY,
F_DUPFD_CLOEXEC to fcntlcmds[]. Create notifyflags[] array.
(sys_fcntl): Handle new flags.

Optimize printing of open modes.
* defs.h: Declare sprint_open_modes(),
remove unused parameter in tprint_open_modes().
* desc.c (sprint_open_modes): Move fuction definition from here...
* file.c (sprint_open_modes): To here.
(tprint_open_modes): Use sprint_open_modes(), it already
generates needed string.
* ipc.c: Remove unused parameter from calls
to tprint_open_modes().

15 years agodefs.h: cosmetics (wrap overlong line)
Denys Vlasenko [Fri, 6 Mar 2009 00:33:24 +0000 (00:33 +0000)]
defs.h: cosmetics (wrap overlong line)

15 years agoAVR32 support by Hans-Christian Egtvedt
Denys Vlasenko [Fri, 27 Feb 2009 20:32:52 +0000 (20:32 +0000)]
AVR32 support by Hans-Christian Egtvedt
(hans-christian.egtvedt AT atmel.com).
* configure.ac: Make it recognize avr32.
* defs.h: Define LINUX_AVR32.
* linux/avr32/syscallent.h: New file.
* Makefile.am: Reference linux/avr32/syscallent.h.
* proc.c (change_syscall, setarg): Add support for avr32.
(struct xlat struct_user_offsets[]): Ditto.
* syscall.c (get_scno): Ditto.
(get_error, force_result, syscall_enter): Ditto.
* util.c (getpc, printcall): Ditto.

15 years agoCRIS support by Hinko Kocevar (hinko.kocevar AT cetrtapot.si)
Denys Vlasenko [Wed, 25 Feb 2009 17:08:40 +0000 (17:08 +0000)]
CRIS support by Hinko Kocevar (hinko.kocevar AT cetrtapot.si)
* configure.ac: Make it recognize cris.
* process.c: Define ARG_xxx constants for cris.
(change_syscall): Add support for cris.
(struct_user_offsets): Add cris-specific data.
* signal.c (sys_sigreturn): Add support for cris.
* syscall.c (get_scno): Add support for cris.
(syscall_fixup): Add support for cris.
(get_error): Add support for cris.
(syscall_enter): Add support for cris.
(force_result): While at it, fix cpp directives indentation.
* util.c (printcall): Add support for cris.

15 years agoBy Hans-Christian Egtvedt (hans-christian.egtvedt AT atmel.com):
Denys Vlasenko [Wed, 25 Feb 2009 14:24:02 +0000 (14:24 +0000)]
By Hans-Christian Egtvedt (hans-christian.egtvedt AT atmel.com):

strace.c: suppress "warning: unused static" message by adding #ifdef's around
 a variable
.gitignore: trivial
test/*.c: cleanup (suppress warnings, much better style).

15 years agoReplace many more bare ptrace calls with calls to wrappers
Denys Vlasenko [Tue, 24 Feb 2009 15:17:53 +0000 (15:17 +0000)]
Replace many more bare ptrace calls with calls to wrappers
which do proper error-checking and set tcp->ptrace_errno.
In some cases, missing error checking is added.
Error handling for trace_syscall() failures and other cases
where tcp->ptrace_errno is nonzero is cleaned up a bit
and made more verbose if we see error other than ESRC.
Some comments are added or expanded.
* defs.h: Declare ptrace_cmds[]. Modify do_ptrace
declaration (last parameter is long, not void *).
* process.c: Make ptrace_cmds[] non-static.
(change_syscall): Use do_ptrace() instead of bare ptrace().
* signal.c: Use do_ptrace() instead of bare ptrace().
* strace.c: Update trace_syscall() failure handling.
* syscall.c: Use do_ptrace() instead of bare ptrace().
* util.c: Use do_ptrace() instead of bare ptrace().
Update do_ptrace() wrapper.
(str_PTRACE_xxx): New function - helper returning "PTRACE_xxx".
(do_ptrace_peekdata): New function - wrapper for PTRACE_PEEKDATA
(do_ptrace5): New function - wrapper for 5-argument ptrace calls.

15 years ago* process.c: Indent preprocessor directives so that nesting
Denys Vlasenko [Tue, 24 Feb 2009 12:59:47 +0000 (12:59 +0000)]
* process.c: Indent preprocessor directives so that nesting
can be figured out. Add PTRACE_SET_SYSCALL to ptrace_cmds[].

15 years agolinux/ioctlent.sh: update by Mike Frysinger (now collects enums too)
Denys Vlasenko [Mon, 23 Feb 2009 13:22:06 +0000 (13:22 +0000)]
linux/ioctlent.sh: update by Mike Frysinger (now collects enums too)

15 years agoMore cleanups from Mike Frysingler:
Denys Vlasenko [Mon, 23 Feb 2009 08:07:45 +0000 (08:07 +0000)]
More cleanups from Mike Frysingler:
README: update an URL
.gitignore: added
config.guess config.sub install-sh: removed, they are revenerated
 by autoconf anyway

15 years agoHACKING-scripts: new doc file by Mike Frysinger
Denys Vlasenko [Mon, 23 Feb 2009 07:56:01 +0000 (07:56 +0000)]
HACKING-scripts: new doc file by Mike Frysinger

15 years agos/sort | uniq/sort -u/
Denys Vlasenko [Sun, 22 Feb 2009 03:01:20 +0000 (03:01 +0000)]
s/sort | uniq/sort -u/

15 years agoFurther signalent.h cleanup.
Denys Vlasenko [Fri, 20 Feb 2009 17:38:47 +0000 (17:38 +0000)]
Further signalent.h cleanup.
* linux/ia64/signalent.h: Remove, it is identical to common signalent.h
sans "SIGRTnn" definitions which are redundant.
* linux/powerpc/signalent.h: Remove, it is identical to common signalent.h
sans outdated "SIGUNUSED" which should be "SIGSYS".
* linux/s390/signalent.h: Ditto.
* linux/s390x/signalent.h: Ditto.
* Makefile.am: Remove references to the above files.

15 years agoPatch by Mike Frysinger (vapier AT gentoo.org).
Denys Vlasenko [Fri, 20 Feb 2009 17:32:34 +0000 (17:32 +0000)]
Patch by Mike Frysinger (vapier AT gentoo.org).
* linux/ioctlent.sh: Update sed machinery to parse _IOC() macros
with two constants.

15 years agoPatch by Mike Frysinger (vapier AT gentoo.org).
Denys Vlasenko [Fri, 20 Feb 2009 16:24:39 +0000 (16:24 +0000)]
Patch by Mike Frysinger (vapier AT gentoo.org).
* Makefile.am: Remove reference to linux/sh/signalent.h.
* linux/sh/signalent.h: Remove, it is identical to common signalent.h.

15 years agofix accidental damage to ChangeLog
Denys Vlasenko [Fri, 20 Feb 2009 16:03:42 +0000 (16:03 +0000)]
fix accidental damage to ChangeLog

15 years agoPatch by Mike Frysinger (vapier AT gentoo.org).
Denys Vlasenko [Fri, 20 Feb 2009 16:00:41 +0000 (16:00 +0000)]
Patch by Mike Frysinger (vapier AT gentoo.org).
* linux/errnoent.h: Make ERRNO_58 show EDEADLOCK for POWERPC.
* Makefile.am: Remove reference to linux/powerpc/errnoent.h.
* linux/powerpc/errnoent.h: Remove, we can use common errnoent.h now.

15 years agoPatch by Mike Frysinger (vapier AT gentoo.org).
Denys Vlasenko [Fri, 20 Feb 2009 15:51:51 +0000 (15:51 +0000)]
Patch by Mike Frysinger (vapier AT gentoo.org).
Removing redundant errnoent.h files.
* Makefile.am: Remove references to linux/ia64/errnoent.h,
linux/s390/errnoent.h, linux/s390x/errnoent.h and linux/sh/errnoent.h.
* linux/ia64/errnoent.h: Remove, this arch uses common errnoent.h.
* linux/s390/errnoent.h: Ditto.
* linux/s390x/errnoent.h: Ditto.
* linux/sh/errnoent.h: Ditto.

15 years agotest/sigkill_rain.c: a testcase with lots of async deaths
Denys Vlasenko [Fri, 13 Feb 2009 10:26:31 +0000 (10:26 +0000)]
test/sigkill_rain.c: a testcase with lots of async deaths

15 years ago.
Roland McGrath [Wed, 11 Feb 2009 03:03:29 +0000 (03:03 +0000)]
.

15 years ago2009-02-10 Roland McGrath <roland@redhat.com>
Roland McGrath [Wed, 11 Feb 2009 03:03:28 +0000 (03:03 +0000)]
2009-02-10  Roland McGrath  <roland@redhat.com>

* configure.ac: Check for struct sigcontext.
* signal.c [LINUX] [M68K] (struct sigcontext): Don't define it if
[HAVE_STRUCT_SIGCONTEXT].
From Muttley Meen <muttley.meen@gmail.com>.

15 years agoCleanup after tcb table expansion simplification.
Denys Vlasenko [Tue, 10 Feb 2009 16:03:20 +0000 (16:03 +0000)]
Cleanup after tcb table expansion simplification.
There was code which was trying to continue tracing
even if table expansion fails. Now we treat it as fatal
failure, so this code is removed by this change.
* defs.h: Delete TCB_FOLLOWFORK constant.
* process.c: Delete fork_tcb() and all calls of it.
* strace.c (startup_attach): Remove usage of TCB_FOLLOWFORK.
* syscall.c: Indent preprocessor directives.

15 years ago* defs.h: Correct the comment about TCB_SUSPENDED.
Denys Vlasenko [Mon, 9 Feb 2009 18:55:59 +0000 (18:55 +0000)]
* defs.h: Correct the comment about TCB_SUSPENDED.
* strace.c: Fix misplaced #endif.
* util.c: Indent preprocessor directives, mark code parts
which can never be reached by compilation because of
the combination of #if directives. These are likely dead code,
I want to remove them later.

15 years ago* strace.c (newoutf): Prevent -o FILENAME overflowing the stack.
Denys Vlasenko [Thu, 29 Jan 2009 20:38:20 +0000 (20:38 +0000)]
* strace.c (newoutf): Prevent -o FILENAME overflowing the stack.
(startup_attach): Fix wrong pid in "Process <PID> attached".
(handle_group_exit): Do not consider exit to be spurious if
tcb has TCB_STARTUP bit set - we can attach to the task
right before its death, it can legitimately happen.
(handle_stopped_tcbs): Ditto.

15 years ago* process.c (internal_clone): Check and complain if pid value
Denys Vlasenko [Wed, 28 Jan 2009 19:00:54 +0000 (19:00 +0000)]
* process.c (internal_clone): Check and complain if pid value
looks insane.
* strace.c (alloc_tcb): Clear *all* fields in reused tcb.
(main): Query and remember uname() info on startup.
(handle_stopped_tcbs): Do not use PTRACE_SETOPTIONS on Linux < 2.6.29.
(printleader): Correct printing of "<unavailable>" markers.

15 years ago* strace.c (collect_stopped_tcbs): Guard against the case when
Denys Vlasenko [Tue, 27 Jan 2009 19:38:44 +0000 (19:38 +0000)]
* strace.c (collect_stopped_tcbs): Guard against the case when
waitpid() reports the same task multiple times.
Run tested.

15 years ago* process.c (printwaitn): Add comment about wait4() pid expansion.
Denys Vlasenko [Mon, 26 Jan 2009 19:09:35 +0000 (19:09 +0000)]
* process.c (printwaitn): Add comment about wait4() pid expansion.
Use #ifdef ALPHA instead of LINUX_64BIT, it was misleading
(by implying "any 64-bit platform").
* defs.h: Remove now-unused LINUX_64BIT define.
* resource.c (sys_osf_getrusage): Fix indentation.

15 years agofix fallout from recent tcb table expansion error handling change
Denys Vlasenko [Mon, 26 Jan 2009 12:55:40 +0000 (12:55 +0000)]
fix fallout from recent tcb table expansion error handling change

15 years agosyscall.c (get_scno): Fix warnings about unused 'pid' variable
Denys Vlasenko [Fri, 23 Jan 2009 16:30:26 +0000 (16:30 +0000)]
syscall.c (get_scno): Fix warnings about unused 'pid' variable

15 years agoBy Michal Nowak <mnowak@redhat.com>:
Denys Vlasenko [Fri, 23 Jan 2009 16:10:22 +0000 (16:10 +0000)]
By Michal Nowak <mnowak@redhat.com>:
* mem.c (print_ldt_entry): Fix warning:
Format '%#08lx' expects type 'long unsigned int', but
argument 2 was type 'unsigned int'.

15 years ago* strace.c (collect_stopped_tcbs): Do not return NULL when ECHILD
Denys Vlasenko [Wed, 21 Jan 2009 19:05:43 +0000 (19:05 +0000)]
* strace.c (collect_stopped_tcbs): Do not return NULL when ECHILD
is detected, return collected list instead. Fixes symptom when
the last "+++ killed by SIGxxx +++" is not printed.

15 years agoTwo cleanups: tcb table expansion failure is not really a survivable
Denys Vlasenko [Sat, 17 Jan 2009 01:52:54 +0000 (01:52 +0000)]
Two cleanups: tcb table expansion failure is not really a survivable
event, we do not have any viable way to continue. No wonder most
places where that is detected have FIXMEs.
It's way simpler to treat as fatal failure, and handle it inside
tcb table expansion finctions.
Second cleanup: tidy up haphazard locations of a few externs.

* defs.h: Change return type of expand_tcbtab() to void.
Declare change_syscall().
* process.c: Change all callsites of alloctcb(), alloc_tcb() and
fork_tcb(), removing now-redundant error checks.
(fork_tcb): Change return type to void - it can't fail now.
* strace.c: Move extern declarations out of function bodies.
Change all callsites of alloctcb(), alloc_tcb() and
fork_tcb(), removing now-redundant error checks.
(expand_tcbtab): Change return type to void - it can't fail now.
On failure to expand, print a message, clean up, and exit.
(alloc_tcb): On failure to expand, print a message, clean up, and exit.
* util.c (setbpt): Remove extern declaration from function body.

15 years ago* defs.h: Update a comment. No code changes.
Denys Vlasenko [Sat, 17 Jan 2009 01:06:18 +0000 (01:06 +0000)]
* defs.h: Update a comment. No code changes.
* strace.c (handle_stopped_tcbs): Discard all execve stops
and clear TCB_WAITEXECVE bit.
* syscall.c (get_scno): Add the code to not mistakenly
treat ptrace stop as execve stop (execve stops can be blocked
by traced program).
Fixes RH#477775 "strace hangs if the target process blocks SIGTRAP".

15 years ago* process.c: Add a comment. No code changes.
Denys Vlasenko [Sat, 17 Jan 2009 00:21:31 +0000 (00:21 +0000)]
* process.c: Add a comment. No code changes.
* strace.c (collect_stopped_tcbs): Stop reversing list of stopped
tcp's. I'm not totally convinced it is crucial, but this is surely
fits the concept of "least surprise".
Do not collect TCB_SUSPENDED tcp's (this is closer to how
it was before).
(handle_stopped_tcbs): Remove the code to reject TCB_SUSPENDED tcp's,
it's done earlier now. In an unobvious way, this was causing
SIGSTOPs from freshly attached children to be misinterpreted.

15 years ago* linux/bfin/syscallent.h: sys_futex has 6 parameters, not 5.
Denys Vlasenko [Wed, 14 Jan 2009 14:29:45 +0000 (14:29 +0000)]
* linux/bfin/syscallent.h: sys_futex has 6 parameters, not 5.

15 years agoFixes for ptrace() argument parsing.
Denys Vlasenko [Tue, 13 Jan 2009 18:30:55 +0000 (18:30 +0000)]
Fixes for ptrace() argument parsing.
* process.c: Add parsing of PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG,
PTRACE_GETSIGINFO, PTRACE_SETSIGINFO.
* strace.c (handle_stopped_tcbs): Make PTRACE_SETOPTIONS
define check more robust.
* defs.h: Declare several "extern const struct xlat" arrays here.
* desc.c: Remove open_mode_flags[] and open_access_modes[]
extern declarations.
* net.c: Remove open_mode_flags[] extern declaration.
* sock.c: Remove addrfams[] extern declaration.
* util.c: Remove struct_user_offsets[] extern declaration.
* signal.c: Remove open_mode_flags[] extern declaration.

15 years ago* defs.h: Add new struct tcb fields: wait_status, next_need_service.
Denys Vlasenko [Fri, 9 Jan 2009 17:22:56 +0000 (17:22 +0000)]
* defs.h: Add new struct tcb fields: wait_status, next_need_service.
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.

15 years agoOutput format fixes, improving the situation after recent
Denys Vlasenko [Tue, 6 Jan 2009 21:45:06 +0000 (21:45 +0000)]
Output format fixes, improving the situation after recent
change which added better handling of processes suddenly
disappearing. Now we often do not finish last line
before exiting in those cases.
The only change affecting something other than output
is change in umovestr where we were calling
abort() on ptrace error.

* strace.c (trace): If trace_syscall() failed with ESRCH,
finish current output line with " <unfinished ...>".
(mp_ioctl): While we are at it, fix gross style mismatch
in this function definition. No code chages.
* syscall.c (trace_syscall): If decode fails on syscall exit,
finish current output line with "= ? <unavailable>".
* util.c (umoven): Do not complain if error is ESRCH.
(umovestr): Do not complain and do not abort() if error is ESRCH.
* defs.h: Remove unused tcp parameter from printtrailer().
* process.c: Adjust printtrailer() calls accordingly.
* strace.c: Adjust printtrailer() calls accordingly.
* syscall.c: Adjust printtrailer() calls accordingly.

15 years ago* desc.c (printflock): Fix display of fcntl(F_SETLK) on
Denys Vlasenko [Tue, 6 Jan 2009 15:12:52 +0000 (15:12 +0000)]
* desc.c (printflock): Fix display of fcntl(F_SETLK) on
non-native 32-bit architecture.
Fixes RH#471169 "format fcntl64() system calls for
32 bit application incorrect".

* desc.c: const'ify two static struct xlat vector[]'s,
convert all remaining old style C parameter declarations
in this file.

15 years ago* syscall.c: more cosmetics. fixed a few localized style discrepancies.
Denys Vlasenko [Fri, 2 Jan 2009 18:10:08 +0000 (18:10 +0000)]
* syscall.c: more cosmetics. fixed a few localized style discrepancies.
The only actual code change is a trivial one where
a char *array[] made const and static.

15 years ago* defs.h, syscall.c: explain why x86 does not need TCB_WAITEXECVE trick,
Denys Vlasenko [Fri, 2 Jan 2009 18:02:45 +0000 (18:02 +0000)]
* defs.h, syscall.c: explain why x86 does not need TCB_WAITEXECVE trick,
and what syscall_fixup() is expected to do. Comments only, no code changes.

15 years ago* strace.c: Fix compile failure: on some systems PTRACE_O_xxx
Denys Vlasenko [Fri, 2 Jan 2009 16:55:24 +0000 (16:55 +0000)]
* strace.c: Fix compile failure: on some systems PTRACE_O_xxx
and PTRACE_EVENT_xxx constants are not defined.

15 years agotrailing whitespace removal, no code changes
Denys Vlasenko [Fri, 2 Jan 2009 13:03:44 +0000 (13:03 +0000)]
trailing whitespace removal, no code changes

15 years ago2008-11-13 Kirill A. Shutemov <kirill@shutemov.name>
Dmitry V. Levin [Thu, 1 Jan 2009 23:23:47 +0000 (23:23 +0000)]
2008-11-13  Kirill A. Shutemov  <kirill@shutemov.name>

* linux/arm/syscallent.h: Update syscalls.
Based on patch by Enrico Scholz.

15 years ago2008-11-13 Kirill A. Shutemov <kirill@shutemov.name>
Dmitry V. Levin [Thu, 1 Jan 2009 23:20:38 +0000 (23:20 +0000)]
2008-11-13  Kirill A. Shutemov  <kirill@shutemov.name>

* linux/arm/syscallent.h: Fix build on ARM EABI which does not
provide syscalls socketcall and ipc.

15 years ago2009-01-01 Andreas Schwab <schwab@suse.de>
Dmitry V. Levin [Thu, 1 Jan 2009 22:47:51 +0000 (22:47 +0000)]
2009-01-01  Andreas Schwab  <schwab@suse.de>

* net.c (sys_accept): Properly decode third argument as pointer to
int.

15 years agoExperimental support for -D option.
Denys Vlasenko [Tue, 30 Dec 2008 20:51:30 +0000 (20:51 +0000)]
Experimental support for -D option.
Unlike normal case, with -D *grandparent* process exec's,
becoming a traced process. Child exits (this prevents traced process
from having children it doesn't expect to have), and grandchild
attaches to grandparent similarly to strace -p PID.
This allows for more transparent interaction in cases
when process and its parent are communicating via signals,
wait() etc. Without -D, strace process gets lodged in between,
disrupting parent<->child link.

* strace.c: Add global flag variable daemonized_tracer for -D option.
(startup_attach): If -D, fork and block parent in pause().
In this case we are already a child, we in fact created a grandchild.
After attaching to grandparent, grandchild SIGKILLs parent.
(startup_child): If -D, parent blocks in wait(), then
execs the program to strace. Normally (w/o -D), it is child
who execs the program.
(main): Detect -D option, call startup_attach() if it is given.

15 years agoFixing many instances of broken indentation with spaces instead of tabs.
Denys Vlasenko [Tue, 30 Dec 2008 18:47:55 +0000 (18:47 +0000)]
Fixing many instances of broken indentation with spaces instead of tabs.
No code changes.

15 years agoPatch by Kirill A. Shutemov:
Denys Vlasenko [Tue, 30 Dec 2008 17:50:46 +0000 (17:50 +0000)]
Patch by Kirill A. Shutemov:
Fix some warnings on ARM build.
* defs.h: include <sys/ptrace.h> on arm too.
* syscall.c: EABI arm does not need decode_subcall(), ifdef it out.

15 years ago* linux/syscallent.h: Mark sendfile(2) as network syscall.
Denys Vlasenko [Mon, 29 Dec 2008 20:04:15 +0000 (20:04 +0000)]
* linux/syscallent.h: Mark sendfile(2) as network syscall.
* linux/*/syscallent.h: Same, for all architectures.

15 years ago* defs.h: Remove sigtrap80 field from struct tcb.
Denys Vlasenko [Mon, 29 Dec 2008 19:13:27 +0000 (19:13 +0000)]
* defs.h: Remove sigtrap80 field from struct tcb.
* strace.c: Add ptrace_stop_sig static variable
and use it in place of tcp->sigtrap80.
Add ptrace_opts_set static flag variable.
(trace): Set ptrace options once, not per-process.
If unexpected SIGTRAP is later received,
revert back to using SIGTRAP
(assume old, broken kernel).

15 years agoFix build breakage from my previous commit.
Denys Vlasenko [Tue, 23 Dec 2008 16:14:42 +0000 (16:14 +0000)]
Fix build breakage from my previous commit.
 Now I test for PT_SETOPTIONS being #defined.
Remove trailing whitespace.
No actual code changes.

15 years agoMake strace correctly handle SIGTRAP produced by e.g.
Denys Vlasenko [Mon, 22 Dec 2008 19:14:47 +0000 (19:14 +0000)]
Make strace correctly handle SIGTRAP produced by e.g.
kill(2) and by trapping instruction.
* defs.h: Add sigtrap80 field to struct tcb.
* strace.c (alloc_tcb): Initialize it to SIGTRAP.
(detach): Use tcp->sigtrap80 instead of SIGTRAP constant.
(trace): Attempt to set PTRACE_O_TRACESYSGOOD and
PTRACE_O_TRACEEXEC options on each newly attached process,
distinquish between SIGTRAP and (SIGTRAP | 0x80) stops.
Fixes RH#162774 "strace ignores int3 SIGTRAP".

15 years agoMake strace somewhat resilient against process disappearing
Denys Vlasenko [Wed, 17 Dec 2008 19:21:59 +0000 (19:21 +0000)]
Make strace somewhat resilient against process disappearing
under its claws. Prime example is sudden SIGKILL.
Fixes RH#472053

15 years agotwo instances of s/sa_handler == SIG_DFL/sa_handler == SIG_IGN/
Denys Vlasenko [Wed, 17 Dec 2008 17:22:03 +0000 (17:22 +0000)]
two instances of s/sa_handler == SIG_DFL/sa_handler == SIG_IGN/

15 years agoThis patch does not change any logic.
Denys Vlasenko [Tue, 16 Dec 2008 18:18:40 +0000 (18:18 +0000)]
This patch does not change any logic.

It merely passes tcp pointer to upeek instead of pid.
This is needed if one wants to check or change
some tcp fields.

I have patches which require this. I can imagine someone else
eventually needing to look at tcp for completely orthogonal reasons.

15 years ago2008-11-11 Dmitry V. Levin <ldv@altlinux.org>
Dmitry V. Levin [Wed, 10 Dec 2008 13:51:40 +0000 (13:51 +0000)]
2008-11-11  Dmitry V. Levin  <ldv@altlinux.org>

* sock.c [LINUX] (sock_ioctl): Parse more SIOCS* ioctls.

15 years agoAdd RH# bugzilla tags
Dmitry V. Levin [Wed, 10 Dec 2008 13:47:22 +0000 (13:47 +0000)]
Add RH# bugzilla tags

15 years ago.
Roland McGrath [Wed, 10 Dec 2008 06:09:34 +0000 (06:09 +0000)]
.

15 years ago2008-12-09 Roland McGrath <roland@redhat.com>
Roland McGrath [Wed, 10 Dec 2008 06:09:29 +0000 (06:09 +0000)]
2008-12-09  Roland McGrath  <roland@redhat.com>

* strace.1 (DIAGNOSTICS): New section, describe exit behavior.

15 years agomanpage: document new feature of propagating exit code/signal death status.
Denys Vlasenko [Tue, 9 Dec 2008 14:15:56 +0000 (14:15 +0000)]
manpage: document new feature of propagating exit code/signal death status.