On attempts to block or set SIGTRAP handler, for example, using sigaction syscall, we generate an additional SIGSTOP. This change gets rid of this SIGSTOP sending/ignoring. It appears to work just fine. It also works if I force strace to not use PTRACE_O_TRACESYSGOOD, which means strace stops will be marked with SIGTRAP, not (SIGTRAP | 0x80) - I wondered maybe that's when this hack is needed. So, why we even have TCB_SIGTRAPPED? No one knows. It predates version control: this code was present in the initial commit, in 1999. No adequate comments, either. Moreover, TCB_SIGTRAPPED is not set in sys_rt_sigaction and sys_sigprocmask syscalls - the ones which are most usually used to implement signal blocking, it is only set in obsolete sys_signal, sys_sigaction, sys_sigsetmask, and in some dead non-Linux code. I think whatever bug it was fixing is gone long ago - at least as long as sys_rt_sigaction is used by glibc. Again, since glibc (and uclibc) uses sys_rt_sigaction and sys_sigprocmask, modified code paths are not used by most programs anyway. * defs.h: Remove definition of TCB_SIGTRAPPED. * signal.c (sys_sigvec): Don't set TCB_SIGTRAPPED and don't send SIGSTOP. (sys_sigsetmask): Likewise. (sys_sigaction): Likewise. (sys_signal): Likewise. * strace.c (trace): Remove code which executes if TCB_SIGTRAPPED is set. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This is strace 4.0, a system call tracer for SunOS 4.x, Linux, System V release 4, Solaris 2.x and Irix 5.x. strace is released under a Berkeley-style license at the request of Paul Kranenburg; see the file COPYRIGHT for details. Read the INSTALL file for generic instructions on how to install strace. If configure cannot guess your system configuration, you can specify it on the command line after the other options like this: ./configure --prefix=/usr i486-linux A single sunos4.1 binary should work on all the sun4, sun4c and sun4m kernel architectures. Let me know if sun4d doesn't work. Other i486-*-sysv4 systems may work with little or no tweaking. See the file NEWS for information on what has changed in recent versions. See the file PORTING if you like strace but it doesn't work on an operating system you use frequently. See the file CREDITS to see who has contributed to strace. See the file TODO if you feel like helping out. You can get the latest version of strace from its homepage at http://sourceforge.net/projects/strace/ . Please send bug reports and enhancements to the strace mailinglist at strace-devel@lists.sourceforge.net, or directly to Wichert Akkerman <wakkerma@debian.org>
Description
Languages
C
92.2%
Shell
3.4%
M4
1.4%
Makefile
0.8%
Roff
0.7%
Other
1.5%