Subject: Re: bug#12626: Bug?: dd limited to <2G read size (2G-8K) on 64 bit machine?

From: Linda Walsh <[email-masked]>
Date: Fri, 12 Oct 2012 10:17:42 -0700

I tried using gvim instead... ;-)

I found:
  /* Warn about partial reads if bs=SIZE is given and iflag=fullblock
     is not, and if counting or skipping bytes or using direct I/O.
     This helps to avoid confusion with miscounts, and to avoid issues
     with direct I/O on GNU/Linux.  */
  warn_partial_read =
    (! (conversions_mask & C_TWOBUFS) && ! (input_flags & O_FULLBLOCK)
     && (skip_records
         || (0 < max_records && max_records < (uintmax_t) -1)
         || (input_flags | output_flags) & O_DIRECT));

------------
I'm not doing conversions and didn't have fullblock set.
I'm not skipping records
input has o_direct set...

but the troublesome line:
         || (0 < max_records && max_records < (uintmax_t) -1)
I asked to copy 1,2 or 4 records

uintmax -1 =  0xffff fffe --- I don't understand, if max_records is >0
and less than ~4G-1, set this flag?

I'm assuming it's a flag to display the message or not, as I know it 
doesn't display the message most of the time...

Is that right uintmax?   or should that be an unsigned long int max?

But I don't think that's the root cause of what I am seeing.  But that 
statement doesn't look right....
It acts more like something (maybe not dd), is running with a 32-bit 
word size.

ldd shows dd linking with lib64 targets:

>  ldd dd
        linux-vdso.so.1 (0x00007fff6d5ff000)
        librt.so.1 => /lib64/librt.so.1 (0x0000003001800000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003000400000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003001000000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003000000000)

---
Does dd have a 32-bit limit on numb blocks?

Paul Eggert wrote:
> On 10/11/2012 08:11 PM, Linda Walsh wrote:
>   
>> I find that if I try to use a read size of > (2G-8K), I get partial read errors.
>>     
>
> My guess is that it's your kernel, or maybe your
> file system, and not dd per se.  Try running 'strace'.
>