new ptrace_setoptions causes strace to sometimes dump core

Dmitry V. Levin ldv at
Wed Mar 2 23:41:01 UTC 2011

On Wed, Mar 02, 2011 at 04:56:20AM -0500, Mike Frysinger wrote:
> when testing things on ppc64, `make distcheck` failed because of a core file 
> in the tests/ subdir.  playing with things, it seems that strace doesnt like 
> it when you cut its pipe short.

Yes, here is more reliable reproducer:
$ (strace -df / 2>&1; echo >&2 \$?=$?) |:

strace can be killed by SIGPIPE, especially in debug mode which is quite
verbose.  I wouldn't say strace doesnt like it, though.  Many programs get
killed by SIGPIPE because it's quite logical for them to do so.

> the new ptrace_setoptions does just that though -- it calls fgrep with -q 
> which causes fgrep to quite immediately upon a match.  and the match in 
> question happens to be the first line.
> perhaps drop the -q option, have fgrep redirect to /dev/null, and add a 
> comment that the -q option cant be added back in ?

Yes, I think it's OK to use /dev/null here, adding a comment why we should
avoid grep -q.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <>

More information about the Strace-devel mailing list