Red Hat Bugzilla – Bug 105366
RFE: correct strace behaviour for piped output
Last modified: 2016-12-13 16:51:02 EST
Description of problem:
Format of piped output generated by strace distinguishes from redirected output.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
gcc -Wall -Werror system.c -o system
strace -fF -o redirect.log ./system
strace -fF -o '|cat >pipe.log' ./system
redirect.log and pipe.log are essentially different.
redirect.log and pipe.log should look about the same.
Rationale: piped output feature is oftenly used to process output by non-interactive filter.
So it requires offline-style output and line buffering.
Created attachment 94714 [details]
Created attachment 94715 [details]
I've put a slightly different but equivalent patch in upstream.
The next Fedora Core update package will have it.
However, you haven't applied the change to set line buffering for piped output.
Created attachment 96529 [details]
proposed patch (set line buffering for piped output)
An errata has been issued which should help the problem described in this bug report.
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen
this bug report if the solution does not work for you.
Your extra patch is superfluous. See the setvbuf call later in the
function. setlinebuf is not portable, btw.