[PATCH] make strace handle SIGTRAP properly

Dmitry V. Levin ldv at altlinux.org
Mon Jun 20 18:28:31 UTC 2011


On Mon, Jun 20, 2011 at 05:06:35PM +0200, Denys Vlasenko wrote:
> On Mon, 2011-06-20 at 04:07 +0400, Dmitry V. Levin wrote:
[...]
> > Unfortunately, this commit introduced a severe regression: starting with
> > v4.6-5-g3454e4b, strace -f follows vfork() with low probability.
> > Spotted with gcc which uses vfork().
> > 
> > Test case:
> > $ for i in `seq 0 99`; do ./strace -qf -o"|grep -c 'execve(\"'" -- sh -c 'echo "#include <stdio.h>" |gcc -xc -c -o/dev/null -'; done |sort -n |uniq -c
> >      83 3
> >      17 7
> 
> Looking at it.
> So far I don't have complete analysis, but I noticed something
> which may lead to understanding: strace sometimes exits sooner than
> piped-to log process:

No, that is not related to -o option processing.  In this slightly
modified example, no -o option is used:

$ for i in `seq 0 99`; do ./strace -qf -- sh -c 'echo "#include <stdio.h>" |gcc -xc -c -o/dev/null -' 2>&1 |grep -c 'execve("'; done |sort -n |uniq -c
     61 3
     39 7


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20110620/d0eb1422/attachment.bin>


More information about the Strace-devel mailing list