From: Dmitry V. L. <ld...@al...> - 2011-06-20 18:28:40
|
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 |