Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Apr 1998 12:15:38 GMT
From:      PB <pb@wave.campus.luth.se>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/6316: /bin/dd owerflows at 4 GB (4*2**30)
Message-ID:  <199804161215.MAA00830@wave.campus.luth.se>

next in thread | raw e-mail | index | archive | help


>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:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 16 03:30:00 PDT 1998
>Last-Modified:
>Originator:     PB
>Organization:
none
>Release:        FreeBSD 2.2-BETA_A i386
>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.

>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804161215.MAA00830>