dd -- bs>=2G, error writing to /dev/null - possible bug? (win7; coreutils 8.26)

Corinna Vinschen corinna-cygwin@cygwin.com
Sun Mar 12 11:39:00 GMT 2017


On Mar 12 00:33, Josef Frank wrote:
> 
> Dear all,
> 
> 
> dd utility has problems to write to /dev/null with bs>=2^31,
> while bs<2^31 is ok.
> 
> Increasing bs further to 2^33 leads to extended error message
> 
> For description see below

Thanks for the testcase.  It's a combination of two bugs:

- At a crucial point in write(2), Cygwin used an int variable where
  it should have used a ssize_t variable.  This fouled up the return
  value for lengths >= 2^31.

- When writing to the Windows NUL device, NtWriteFile only returns the
  lower 32 bits od the number of bytes written.  This fouls up the
  return value of write(2) for lengths >= 2^32.

I fixed the first problem and created a workaround for the second.

I uploaded new developer snapshots to https://cygwin.de/snapshots/
Please give 'em a try.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20170312/e0f6c0a1/attachment.sig>


More information about the Cygwin mailing list