From pb@wave.campus.luth.se  Thu Apr 16 03:20:49 1998
Received: from wave.campus.luth.se (pb@wave.campus.luth.se [130.240.193.79])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA00593
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 16 Apr 1998 03:18:37 -0700 (PDT)
          (envelope-from pb@wave.campus.luth.se)
Received: (from pb@localhost)
          by wave.campus.luth.se (8.8.4/8.8.4)
	  id MAA00830; Thu, 16 Apr 1998 12:15:38 GMT
Message-Id: <199804161215.MAA00830@wave.campus.luth.se>
Date: Thu, 16 Apr 1998 12:15:38 GMT
From: PB <pb@wave.campus.luth.se>
Reply-To: pb@wave.campus.luth.se
To: FreeBSD-gnats-submit@freebsd.org
Subject: /bin/dd owerflows at 4 GB (4*2**30)
X-Send-Pr-Version: 3.2

>Number:         6316
>Category:       bin
>Synopsis:       Using 'dd' with byte amounts above 4 GB causes 'dd' to overflow
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 16 03:30:00 PDT 1998
>Closed-Date:    Thu Apr 16 08:43:10 PDT 1998
>Last-Modified:  Thu Apr 16 08:43:57 PDT 1998
>Originator:     PB
>Release:        FreeBSD 2.2-BETA_A i386
>Organization:
none
>Environment:

(ncr0:3:0): "EXABYTE EXB-8500-85Qanx0 06X0" type 1 removable SCSI 2
st1(ncr0:3:0): Sequential-Access 
st1(ncr0:3:0): 4.0 MB/s (250 ns, offset 8)

>Description:

Tried this:
dd if=/dev/zero of=/dev/rst1 bs=65536
70970+0 records in
70969+0 records out
356057088 bytes transferred in 9452.929942 secs (37666 bytes/sec)

with a "EXABYTE 8MM Data Cartridge 2048"
Exabyte specify the transfer rate to ~500 KB/s

So this would give amount of transfered data to 340 MB on a exabyte tape..
But the records indicate 4.3 GB
Seems not correct :-)

Executing "dd if=/dev/zero of=/dev/null bs=1048576" and using and using 
"kill -29 <pid>" gives:
  4042+0 records in
  4042+0 records out
  4238344192 bytes transferred in 100.735966 secs (42073793 bytes/sec)
  4147+0 records in
  4147+0 records out
  53477376 bytes transferred in 103.401957 secs (517180 bytes/sec)

Seems as 'st.bytes' in dd.h i declared as u_int64_t is giving:
test_printf.c:20: warning: integer overflow in expression

When the value is above "st.bytes = 1024*1024*2047 + 1024*1023 + 1023+0;"

>How-To-Repeat:

	Use 'dd' on byte transfers above 4 GB.

>Fix:
	
	Use your calculator and the 'record' numbers until fixed.

>Release-Note:
>Audit-Trail:

From: A Joseph Koshy <koshy@india.hp.com>
To: freebsd-gnats-submit@freebsd.org, pb@wave.campus.luth.se, phk@freebsd.org
Cc:  Subject: Re: bin/6316: Using 'dd' with byte amounts above 4 GB causes 'dd' to overflow
Date: Thu, 16 Apr 1998 17:35:27 +0530

 This PR should be closed, as it was fixed in rev 1.11 of "misc.c"
 
     revision 1.11
     date: 1998/02/11 02:23:31;  author: asami;  state: Exp;  lines: +2 -2
     Fix printing for bytes read > 4G.
 
     Reviewed by:    bde
 
 Regards,
 Koshy
 <koshy@india.hp.com>	My Personal Opinions Only.
 
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Thu Apr 16 08:43:10 PDT 1998 
State-Changed-Why:  
Fixed by bde in revision 1.11 or misc.c. 
>Unformatted:
