Wrong/ inconsistent responses from diff

Fergus fergus@bonhard.uklinux.net
Mon Aug 23 14:07:00 GMT 2010


(Very sorry if this arrives twice: one sent 3H ago seems not to have 
made it and I think maybe a AV induced signature was the cause: not 
provided with this despatch.)

Ouch, this is weird and inexplicable.

Somehow diff identifies differences in two identical binary files. In 
the following example two duplicate files are located (i) in my home 
directory (/m/home/user) and (ii) at the root of a different drive (D:).

But this is just an example. The spurious differences are identified for 
all binary files. (As I found when comparing two identical trees, 
containing many binaries, using diff -rqs.)

First, confirm they are identical. Notice the 5 different ways I may use 
to identify the file in my home directory. Using md5sum confirms they 
are identical (so does cmp -bl, say).

~> md5sum INTERVAL.pdf /d/INTERVAL.pdf
5f6ac8c4882f4804805ff41291a665bf *INTERVAL.pdf
5f6ac8c4882f4804805ff41291a665bf */d/INTERVAL.pdf
~> md5sum ./INTERVAL.pdf /d/INTERVAL.pdf
5f6ac8c4882f4804805ff41291a665bf *./INTERVAL.pdf
5f6ac8c4882f4804805ff41291a665bf */d/INTERVAL.pdf
~> md5sum ~/INTERVAL.pdf /d/INTERVAL.pdf
5f6ac8c4882f4804805ff41291a665bf */home/user/INTERVAL.pdf
5f6ac8c4882f4804805ff41291a665bf */d/INTERVAL.pdf
~> md5sum /home/user/INTERVAL.pdf /d/INTERVAL.pdf
5f6ac8c4882f4804805ff41291a665bf */home/user/INTERVAL.pdf
5f6ac8c4882f4804805ff41291a665bf */d/INTERVAL.pdf
~> md5sum /m/home/user/INTERVAL.pdf /d/INTERVAL.pdf
5f6ac8c4882f4804805ff41291a665bf */m/home/user/INTERVAL.pdf
5f6ac8c4882f4804805ff41291a665bf */d/INTERVAL.pdf

Now test for differences in the files (there are none, of course). Only 
the 5th of the 5 different ways by which I may identify the file in my 
home directory demonstrates that the two files are the same. Otherwise 
they are reported as being different.

~> diff -s INTERVAL.pdf /d/INTERVAL.pdf
Files INTERVAL.pdf and /d/INTERVAL.pdf differ
~> diff -s ./INTERVAL.pdf /d/INTERVAL.pdf
Files ./INTERVAL.pdf and /d/INTERVAL.pdf differ
~> diff -s ~/INTERVAL.pdf /d/INTERVAL.pdf
Files /home/user/INTERVAL.pdf and /d/INTERVAL.pdf differ
~> diff -s /home/user/INTERVAL.pdf /d/INTERVAL.pdf
Files /home/user/INTERVAL.pdf and /d/INTERVAL.pdf differ
~> diff -s /m/home/user/INTERVAL.pdf /d/INTERVAL.pdf
Files /m/home/user/INTERVAL.pdf and /d/INTERVAL.pdf are identical

Using XP Pro SP3. This happens with the current cygwin1.dll and the 
snapshot dated 20100822.

Attached, cygcheck.out.

Fergus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out.bz2
Type: application/octet-stream
Size: 21231 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20100823/ecfaaf46/attachment.obj>
-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list