freebsd-dev/usr.bin/truss
Andrey Zonov 896fc4638a - Fix detaching under some circumstances.
When truss is detaching from very active process it is possible to
  hang on waitpid(2) in restore_proc() forever, because
  ptrace(PT_SYSCALL) must be called before detaching, to allow the
  debugging process to continue execution.  Also when truss called with
  '-c' argument, it does not print anything after detach, because it
  immediately exits from restore_proc().

  To fix these two problems make detaching deferred, but then it is
  impossible to detach from a process which does not do any system call.
  To fix this issue use sigaction(2) instead of signal(3) to disable
  SA_RESTART flag for waitpid(2) that makes it non-restartable.  Remove
  global variable child_pid, because now detaching is handled in context
  where child's pid is known.

Reported by:	mjg
Tested by:	mjg, swills
Approved by:	kib (mentor)
MFC after:	2 weeks
2012-09-12 13:06:57 +00:00
..
amd64-fbsd32.c - Style(9) cleanup. 2012-09-02 11:03:18 +00:00
amd64-fbsd.c - Style(9) cleanup. 2012-09-02 11:03:18 +00:00
amd64-linux32.c - Style(9) cleanup. 2012-09-02 11:03:18 +00:00
amd64linux32.conf Teach truss about 32-bit FreeBSD and Linux binaries on amd64. Some 2008-05-16 15:34:06 +00:00
extern.h - Use pid_t type instead of just int. 2012-08-21 14:58:51 +00:00
fbsd32.conf Teach truss about 32-bit FreeBSD and Linux binaries on amd64. Some 2008-05-16 15:34:06 +00:00
i386-fbsd.c - Style(9) cleanup. 2012-09-02 11:03:18 +00:00
i386-linux.c - Style(9) cleanup. 2012-09-02 11:03:18 +00:00
i386.conf Don't want a stray systrace_args.c in objdir. 2007-05-22 10:36:12 +00:00
i386linux.conf Don't want a stray systrace_args.c in objdir. 2007-05-22 10:36:12 +00:00
ia64-fbsd.c - Style(9) cleanup. 2012-09-02 11:03:18 +00:00
main.c - Fix detaching under some circumstances. 2012-09-12 13:06:57 +00:00
Makefile Since truss also uses kdump's mkioctls script, pass the value of ${CPP} 2012-04-09 15:34:22 +00:00
mips-fbsd.c - Style(9) cleanup. 2012-09-02 11:03:18 +00:00
powerpc64-fbsd.c - Style(9) cleanup. 2012-09-02 11:03:18 +00:00
powerpc-fbsd.c - Style(9) cleanup. 2012-09-02 11:03:18 +00:00
setup.c - Fix detaching under some circumstances. 2012-09-12 13:06:57 +00:00
sparc64-fbsd.c - Style(9) cleanup. 2012-09-02 11:03:18 +00:00
syscall.h - Style(9) cleanup. 2012-09-02 11:03:18 +00:00
syscalls.c - Style(9) cleanup. 2012-09-02 11:03:18 +00:00
truss.1 Add -c option to summarize number of calls, errors, and system time. 2009-05-12 20:42:12 +00:00
truss.h - Fix detaching under some circumstances. 2012-09-12 13:06:57 +00:00