commit | c9f85b38766a0e14f4f035f6d702fe57b6b9110c | [log] [tgz] |
---|---|---|
author | Denys Vlasenko <dvlasenk@redhat.com> | Mon Feb 08 14:52:32 2016 +0100 |
committer | Denys Vlasenko <dvlasenk@redhat.com> | Mon Feb 08 18:17:38 2016 +0100 |
tree | f9a3076f725d0077e01a33f6a47339a5216adc2c | |
parent | 7469e252fa89935970701cf05460ce6c3c72b46d [diff] |
Close stdin/out after child is forked Testcase: { sleep 1; yes | head -n99999; } | strace -o/dev/null sh -c 'exec <&-; sleep 9' The writer (head) will be able to perform writes to write end of the pipe. With strace call removed, head will immediately get SIGPIPE. This change fixes this: now writer immediately gets SIGPIPE with strace too. * strace.c (startup_child): Close stdin/out and reopen them to /dev/null. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This is strace -- a diagnostic, debugging and instructional userspace utility for Linux. It is used to monitor interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state. The operation of strace is made possible by the kernel feature known as ptrace.
strace is released under a Berkeley-style license at the request of Paul Kranenburg; see the file COPYING for details.
See the file NEWS for information on what has changed in recent versions.
Please send bug reports and enhancements to the strace mailing list.