diff --git a/clone2.diff b/clone2.diff new file mode 100644 index 0000000..c32d358 --- /dev/null +++ b/clone2.diff @@ -0,0 +1,20 @@ +2008-06-30 Jan Kratochvil + + Fix ia64 `-f' on CLONE2 formerly crashing the child. + * util.c [IA64] (restore_arg0, restore_arg1): Define as empty. + +--- util.c 20 May 2008 00:34:34 -0000 1.75 ++++ util.c 30 Jun 2008 16:23:00 -0000 +@@ -1379,6 +1379,12 @@ set_arg1 (struct tcb *tcp, arg_setup_sta + return errno ? -1 : 0; + } + ++/* ia64 does not return the input arguments from functions (and syscalls) ++ according to ia64 RSE (Register Stack Engine) behavior. */ ++ ++# define restore_arg0(tcp, state, val) ((void) (state), 0) ++# define restore_arg1(tcp, state, val) ((void) (state), 0) ++ + #elif defined (SPARC) || defined (SPARC64) + + typedef struct regs arg_setup_state; diff --git a/strace.changes b/strace.changes index d954775..2225eed 100644 --- a/strace.changes +++ b/strace.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jun 30 18:44:58 CEST 2008 - schwab@suse.de + +- Fix following vfork and clone2. + ------------------------------------------------------------------- Thu Apr 10 12:54:45 CEST 2008 - ro@suse.de diff --git a/strace.spec b/strace.spec index 0878b27..c56c6d0 100644 --- a/strace.spec +++ b/strace.spec @@ -17,7 +17,7 @@ License: BSD 3-Clause Group: Development/Tools/Debuggers AutoReqProv: on Version: 4.5.16 -Release: 44 +Release: 56 Summary: A utility to trace the system calls of a program Source: strace-%{version}.tar.bz2 Patch: strace-%{version}.diff @@ -27,6 +27,8 @@ Patch4: strace-sysinfo.diff Patch5: strace-graph.diff Patch6: ioctl.diff Patch8: ptrace.diff +Patch9: vfork.diff +Patch10: clone2.diff Url: http://sourceforge.net/projects/strace/ BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -52,6 +54,8 @@ Authors: %patch5 %patch6 %patch8 +%patch9 +%patch10 %build export CFLAGS="$RPM_OPT_FLAGS" @@ -75,6 +79,8 @@ rm -rf $RPM_BUILD_ROOT %doc %{_mandir}/man1/strace.1.gz %changelog +* Mon Jun 30 2008 schwab@suse.de +- Fix following vfork and clone2. * Thu Apr 10 2008 ro@suse.de - added baselibs.conf file to build xxbit packages for multilib support diff --git a/vfork.diff b/vfork.diff new file mode 100644 index 0000000..bb6026c --- /dev/null +++ b/vfork.diff @@ -0,0 +1,42 @@ +2008-06-27 Jan Kratochvil + + * util.c (CLONE_VFORK): Define if not defined already. + (setbpt): Clear CLONE_VFORK for SYS_CLONE and SYS_CLONE2. New comment. + Originally found by Vitaly Mayatskikh. + +--- util.c 20 May 2008 00:34:34 -0000 1.75 ++++ util.c 30 Jun 2008 12:53:31 -0000 +@@ -1281,6 +1281,9 @@ struct tcb *tcp; + #ifndef CLONE_PTRACE + # define CLONE_PTRACE 0x00002000 + #endif ++#ifndef CLONE_VFORK ++# define CLONE_VFORK 0x00004000 ++#endif + #ifndef CLONE_STOPPED + # define CLONE_STOPPED 0x02000000 + #endif +@@ -1524,12 +1527,17 @@ struct tcb *tcp; + #ifdef SYS_clone2 + case SYS_clone2: + #endif +- if ((tcp->u_arg[arg0_index] & CLONE_PTRACE) == 0 +- && (arg_setup (tcp, &state) < 0 +- || set_arg0 (tcp, &state, +- tcp->u_arg[arg0_index] | CLONE_PTRACE) < 0 +- || arg_finish_change (tcp, &state) < 0)) +- return -1; ++ /* ia64 calls directly `clone (CLONE_VFORK)' contrary to x86 ++ SYS_vfork above. Even on x86 we turn the VFORK semantics ++ into plain FORK - each application must not depend on the ++ VFORK specifics according to POSIX. We would hang waiting ++ for the parent resume otherwise. */ ++ if ((arg_setup (tcp, &state) < 0 ++ || set_arg0 (tcp, &state, ++ (tcp->u_arg[arg0_index] | CLONE_PTRACE) ++ & ~CLONE_VFORK) < 0 ++ || arg_finish_change (tcp, &state) < 0)) ++ return -1; + tcp->flags |= TCB_BPTSET; + tcp->inst[0] = tcp->u_arg[arg0_index]; + tcp->inst[1] = tcp->u_arg[arg1_index];