[PATCH] exit/kill ourself with straced child's exitcode/signal

Denys Vlasenko dvlasenk at redhat.com
Wed Sep 24 16:58:05 UTC 2008

This patch is intended to implement this RFE:


There are some patches for this, but apparently discussion
on mailing list died out with no results. At least that bug
is still open. Moreover, the patches are somewhat buggy.

I propose this patch.

I think in real-world usage people do not check strace usage in scripts. They
just use it correctly, so that it doesn't exit(1) with usage info and whatnot.

But I know that when I try to debug something by replacing "cmd [args]"
with "strace cmd [args]" the fact that it's sometimes a problem
that parent does not see exit code of cmd but sees zero.

IOW: I do not think that there are users who will be adversely affected by this
change in behavior. Therefore I do not think adding a switch to enable this is
worth it. It will be just a case of featuritis.

Problems this patch fixes compared to previous patches:

* strace returns exit code of straced process, *never its children*.
* If child died from a signal, strace will (try to) die from the same signal.
* strace -p <pid> is not affected (will exit 0 as before).


More information about the Strace-devel mailing list