GNU bug report logs - #9734
[solaris] `dd if=/dev/urandom of=file bs=1024k count=1' gets a file of 133120 bytes

Previous Next

Package: coreutils;

Reported by: "Clark J. Wang" <dearvoid <at> gmail.com>

Date: Wed, 12 Oct 2011 12:34:02 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Clark J. Wang" <dearvoid <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: [solaris] `dd if=/dev/urandom of=file bs=1024k count=1' gets a file
	of 133120 bytes
Date: Wed, 12 Oct 2011 16:22:12 +0800
[Message part 1 (text/plain, inline)]
I'm not sure if it's a bug but it's not reasonable to me. On Solaris 11
(SunOS 5.11 snv_174, i86pc):

$ uname -a
SunOS sollab-242.cn.oracle.com 5.11 snv_174 i86pc i386 i86pc
$ pkg list gnu-coreutils
NAME (PUBLISHER)                                  VERSION
IFO
file/gnu-coreutils                                8.5-0.174.0.0.0.0.504
i--
$ /usr/gnu/bin/dd if=/dev/urandom of=file bs=1024k count=1
0+1 records in
0+1 records out
133120 bytes (133 kB) copied, 0.00290536 s, 45.8 MB/s
$ ls -l file
-rw-r--r-- 1 root root 133120 2011-10-12 16:12 file
$

I'm new to Solaris but I've never seen this problem whe I use Linux so it
really suprises me.

I found this in the man page of /dev/urandom on Solaris: "The limitation per
read for /dev/random is 1040 bytes. The limit for /dev/urandom is (128 *
1040 = 133120)." That seems to be the reason but I think dd should handle
that and check the return value of the read() system call and make sure
1024k bytes have really been read from /dev/urandom.

Any idea?

Thanks.

-Clark
[Message part 2 (text/html, inline)]

This bug report was last modified 13 years and 226 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.