Bug 49811

Summary: ttcp -r stats output appended to data output
Product: [Retired] Red Hat Raw Hide Reporter: jm493 <john.mann>
Component: ttcpAssignee: Radek Vokál <rvokal>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: jwright, pekkas
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-02-22 13:42:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
replace add stdout's with stderr none

Description jm493 2001-07-24 09:53:20 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.5-0.2.9 i686)

Description of problem:
ttcp -r  sends both the transmitted data, and the connection logging and
transfer statistics to stdout.  This adds junk to the end of file
transfers, and prevents using ttcp for network integrity checking.

How reproducible:
Always

Steps to Reproduce:
1. In window a$ ttcp -r > x.x
2. In window b$ dd if=/dev/zero bs=1 count=100 | ttcp -t localhost
3. in window a$ ls -l x.x ; cat -v x.x
	

Actual Results:  $ ttcp -r > x.x
ttcp-r: socket
ttcp-r: accept from 127.0.0.1
$ ls -l x.x ; cat -v x.x
-rw-r--r--    1 johnm    cos           340 Jul 24 19:51 x.x
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ttcp-r:
buflen=8192, nbuf=2048, align=16384/0, port=5001  tcp
ttcp-r: 100 bytes in 0.00 real seconds = 22.83 KB/sec +++
ttcp-r: 2 I/O calls, msec/call = 2.19, calls/sec = 467.51
ttcp-r: 0.0user 0.0sys 0:00real 0% 0i+0d 0maxrss 0+1pf 0+0csw
========
e.g.  first 2 printfs go to stderr, rest get appended to data file (now 340
bytes instead of 100).


Expected Results:  $ /usr/src/redhat/BUILD/ttcp-1.12/ttcp -r > x.x   
ttcp-r: buflen=8192, nbuf=2048, align=16384/0, port=5001  tcp
ttcp-r: socket
ttcp-r: accept from 127.0.0.1
ttcp-r: 100 bytes in 0.00 real seconds = 25.81 KB/sec +++
ttcp-r: 2 I/O calls, msec/call = 1.94, calls/sec = 528.54
ttcp-r: 0.0user 0.0sys 0:00real 0% 0i+0d 0maxrss 0+1pf 0+0csw
$ ls -l x.x ; cat -v x.x
-rw-r--r--    1 johnm    cos           100 Jul 24 19:52 x.x
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@$ 
========
e.g. all the printfs go to stderr, transferred file is same size as sent.


Additional info:

It may also be a good idea to add a -q flag to supress all diagnositc
output.

Comment 1 jm493 2001-07-24 09:54:54 UTC
Created attachment 24687 [details]
replace add stdout's with stderr

Comment 2 Pekka Savola 2001-07-24 10:22:17 UTC
Nice one.  Also fixed now in my src.rpm at
http://www.netcore.fi/pekkas/linux/ipv6/.

As for '-q'..  I think that'd be rather non-mainstream use, and better would be
just
to redirect stderr to /dev/null locally if needed.

Comment 3 Jim Wright 2001-12-10 23:13:48 UTC
this bug from july 2001 rawhide is still present in final RH72, and is still
marked new in bugzilla.

Comment 4 Radek Vokál 2005-02-22 13:42:30 UTC
I've pushed out new version of ttcp with several changes (mainly from Pekka's
upstream)