jmacd / xdelta

open-source binary diff, delta/differential compression tools, VCDIFF/RFC 3284 delta compression
http://xdelta.org
1.12k stars 187 forks source link

Confusing error message: XD3_INVALID_INPUT #135

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. xdelta3 -e -f -s oldfile newfile patchfile   [on a local Mac]
2. xdelta3 -d -f -s oldfile patchfile newfile2  [on a remote Linux system]
3.

What is the expected output? What do you see instead?
Expected output is a successful run.
Instead, see following error message:
xdelta3: target window checksum mismatch: XD3_INVALID_INPUT

What version of the product are you using? On what operating system?
Mac: Xdelta version 3.0.0, Mac OS v10.6.8
Linux: Xdelta version 3.0v, Linux OS v2.6.32-33-generic x86_64 (Ubuntu 10.04 
Lucid)
See below for full xdelta3 information on each platform.

Please provide any additional information below.
Wonder if it is a cross platform / 64-bit issue?
Mac binary was obtained through MacPorts distribution.
Linux binary was obtained via 'apt-get install xdelta3'.

The procedure is to generate the patchfile on a local mac system, transfer the 
patchfile to a remote linux system, and run xdelta on the remote system to 
patch a copy of the original oldfile. It has been confirmed with md5 that the 
oldfile is identical on local and remote systems. the patch works on the local 
(mac) system, but fails *sometimes* when run on the remote (ubuntu) system.

Filesizes:
oldfile: 53,687,091,200 bytes
patchfile: 2,571,233,182 bytes

Mac xdelta3 config:
bash-3.2$ /usr/local/bin/xdelta3 test
Xdelta version 3.0.0, Copyright (C) 2007, 2008, 2009, 2010, Joshua 
MacDonaldnXdelta comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; see "COPYING" for details.
EXTERNAL_COMPRESSION=1
GENERIC_ENCODE_TABLES=0
GENERIC_ENCODE_TABLES_COMPUTE=0
REGRESSION_TEST=1
SECONDARY_DJW=1
SECONDARY_FGK=1
UNALIGNED_OK=1
VCDIFF_TOOLS=1
XD3_ALLOCSIZE=16384
XD3_DEBUG=0
XD3_ENCODER=1
XD3_POSIX=1
XD3_STDIO=0
XD3_WIN32=0
XD3_USE_LARGEFILE64=1
XD3_DEFAULT_LEVEL=3
XD3_DEFAULT_IOPT_SIZE=32768
XD3_DEFAULT_SPREVSZ=262144
XD3_DEFAULT_SRCWINSZ=67108864
XD3_DEFAULT_WINSIZE=8388608
XD3_HARDMAXWINSIZE=16777216
sizeof(void*)=8
sizeof(int)=4
sizeof(uint32_t)=4
sizeof(uint64_t)=8
sizeof(usize_t)=4
sizeof(xoff_t)=8

Linux xdelta3 config:
bash-3.2$ xdelta3 test
Xdelta version 3.0v, Copyright (C) 2007, 2008, Joshua MacDonald
Xdelta comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; see "COPYING" for details.
EXTERNAL_COMPRESSION=1
GENERIC_ENCODE_TABLES=0
GENERIC_ENCODE_TABLES_COMPUTE=0
REGRESSION_TEST=1
SECONDARY_DJW=1
SECONDARY_FGK=1
UNALIGNED_OK=1
VCDIFF_TOOLS=1
XD3_ALLOCSIZE=16384
XD3_DEBUG=0
XD3_ENCODER=1
XD3_POSIX=1
XD3_STDIO=0
XD3_WIN32=0
XD3_USE_LARGEFILE64=1
XD3_DEFAULT_LEVEL=3
XD3_DEFAULT_IOPT_SIZE=32768
XD3_DEFAULT_SPREVSZ=262144
XD3_DEFAULT_SRCWINSZ=67108864
XD3_DEFAULT_WINSIZE=8388608
XD3_HARDMAXWINSIZE=16777216
sizeof(void*)=8
sizeof(int)=4
sizeof(uint32_t)=4
sizeof(uint64_t)=8
sizeof(usize_t)=4
sizeof(xoff_t)=8

Original issue reported on code.google.com by nick.gia...@gmail.com on 24 Nov 2011 at 2:58

GoogleCodeExporter commented 9 years ago
This just started happening to me on Win 7 64-bit and Win 2008 R2 64-bit. I 
tried using both 32-bit and 64-bit xdelta executables, and no difference. The 
checksum fails if you use the standard parameters in this post, and if you try 
to skip the checksum with -n, the error is "source file is too short: 
XD3_INVALID_INPUT".

I had been using xdelta with no troubles for months in an automated backup 
system, and now the checksums are failing every time. My files are just over 
600 MB, but issue #131, which is a dupe of this problem, is working with files 
under 100 MB, so the error is not related to file size.

Original comment by naask...@gmail.com on 8 Jan 2012 at 6:08

GoogleCodeExporter commented 9 years ago
Actually, it turns out that one of the files on each end was slightly 
different, so the  "checksum mismatch" error now actually makes sense. A more 
meaningful error message would be helpful though.

Original comment by naask...@gmail.com on 11 Jan 2012 at 1:21

GoogleCodeExporter commented 9 years ago
hi, we also encounter this problem when the patch file is over 100MB. when we 
make the patch in win7 64bit and applay it in xp 32bit.

Original comment by linyi...@gmail.com on 15 Mar 2012 at 3:15

GoogleCodeExporter commented 9 years ago
First, I apologize for the delay. Thanks for following up on this issue.  So, 
it sounds like you're again having success with your backup operation--good.

I will do something about providing more information when XD3_INVALID_INPUT 
happens.  Due to several features of the implementation and the standard file 
format used, it's difficult to provide an error message sooner.  Practically 
speaking, it requires an extra pass over the data to ensure it's correct, and 
it is typically easier for the controlling process to do this, e.g. use an 
MD5sum in the filename and verify it before calling xdelta3.  Thanks.

(for the 3rd commenter, linyizsh, I think this is a separate Windows issue and 
I'm going to take up testing this next)

Original comment by josh.mac...@gmail.com on 18 Jun 2012 at 12:32

GoogleCodeExporter commented 9 years ago
The improved error reporting for XD3_INVALID_INPUT is released in 3.0.2.

Original comment by josh.mac...@gmail.com on 30 Jun 2012 at 7:33

GoogleCodeExporter commented 9 years ago

Original comment by josh.mac...@gmail.com on 30 Jun 2012 at 7:33