wrong warning about File grew, 4294967296 new bytes not copied

View: New views
2 Messages — Rating Filter:   Alert me  

wrong warning about File grew, 4294967296 new bytes not copied

by Jörg Begemann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

wrong warning about File grew, 4294967296 new bytes not copied

Hello,

I have found something which might be a bug in cpio.

Using version 2.9 of cpio I copied a complete partition
using the command
   find . -depth -print | cpio -pdmuV /mnt
and I received an warning:
   cpio: File xxxxx grew, 4294967296 new bytes not copied
Looking at file xxxxx I verified, that it was completly
and correctly copied. The file xxxxx has a size of nearly
6 GB.

Looking closer to the source I found in util.c:

warn_if_file_changed (char *file_name, unsigned long old_file_size,
                      off_t old_file_mtime)
....
if (new_file_stat.st_size > old_file_size)
....

I suppose the if-condition is the point of problem because
of comparing two different types.

I compiled cpio on my 32-bit SuSE linux system with support for large files.
According to my config.h there is
#define _FILE_OFFSET_BITS 64
/* #undef _LARGE_FILES */

Therefore I think that new_file_stat.st_size is of type off_t
which is 64 bit because of _FILE_OFFSET_BITS. old_file_size is
of tpye unsigned long, which is 32 bit because of my 32 bit linux
system. Comparing a file size of 6GB using 64 bit with 6GB modulo
32 bit resulted into 2^32, which is 4294967296 .


Hope this information will be useful,
  J. Begemann

 


_______________________________________________
Bug-cpio mailing list
Bug-cpio@...
http://lists.gnu.org/mailman/listinfo/bug-cpio

Re: wrong warning about File grew, 4294967296 new bytes not copied

by Ladislav Michnovič-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Nov 16, 2007 5:35 PM, Jörg Begemann <j.begemann@...> wrote:

>
>
>
> Hello,
>
>  I have found something which might be a bug in cpio.
>
>  Using version 2.9 of cpio I copied a complete partition
>  using the command
>     find . -depth -print | cpio -pdmuV /mnt
>  and I received an warning:
>     cpio: File xxxxx grew, 4294967296 new bytes not copied
>  Looking at file xxxxx I verified, that it was completly
>  and correctly copied. The file xxxxx has a size of nearly
>  6 GB.
>
>  Looking closer to the source I found in util.c:
>
>  warn_if_file_changed (char *file_name, unsigned long old_file_size,
>                        off_t old_file_mtime)
>  ....
>  if (new_file_stat.st_size > old_file_size)
>  ....
>
>  I suppose the if-condition is the point of problem because
>  of comparing two different types.
>
>  I compiled cpio on my 32-bit SuSE linux system with support for large
> files.
Hi. Which version of SuSE do you have?
I have fixed this issue in cpio 2.9 for 10.3. See the changelog of the cpio RPM:
---
Wed Jul 25 13:14:53 CEST 2007 - lmichnovic@...
- fixed types of variables for LFS support (*lfs_correction.patch)
---
and reported here in this ML. SuSE 10.2 has cpio 2.6, which is not affected.

 Regards Ladislav.

_______________________________________________
Bug-cpio mailing list
Bug-cpio@...
http://lists.gnu.org/mailman/listinfo/bug-cpio
LightInTheBox - Buy quality products at wholesale price!