Description of problem: Format of piped output generated by strace distinguishes from redirected output. Version-Release number of selected component (if applicable): 4.4.99 How reproducible: Always Steps to Reproduce: 1. gcc -Wall -Werror system.c -o system 2. strace -fF -o redirect.log ./system 3. strace -fF -o '|cat >pipe.log' ./system Actual results: redirect.log and pipe.log are essentially different. Expected results: 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] system.c
Created attachment 94715 [details] proposed patch
I've put a slightly different but equivalent patch in upstream. The next Fedora Core update package will have it.
Thanks. 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. http://rhn.redhat.com/errata/RHBA-2003-294.html
Your extra patch is superfluous. See the setvbuf call later in the function. setlinebuf is not portable, btw.
Indeed.