Disk corruption in Mac OS X 10.4.2 Tiger?

[ Apparently this problem is believed fixed in the “spotted cat” release of Mac OS X ]

I’ve noticed some files being copied incorrectly under Tiger. Here’s the bugreport I’m going to file with Apple, let me know if you have any suggestions.

Summary:
Copying or duplicating files > 1Gb on external FireWire drives frequently results in files that are not identical to the original.

Steps to Reproduce:
Choose a file (in this case a 167Gb Retrospect archive, or a 5Gb Retrospect archive).
1. Either duplicate the file in the Finder (via “Duplicate”) or using cp on the commandline. The file can be duplicated to the same drive, or a different FireWire drive.
2. Use the unix ‘cmp’ command to compare the two files. Alternatively generate a checksum of each file using md5 and compare the checksums.

Expected Results:
Expect cmp to return no result (ie files are identical). md5 should return identical checksums.

Actual Results:
cmp (or md5) returns that the files differ

Regression:
This has occured both with an AGP G4 Mac and a Mac Mini, on two different FireWire drives from two different manufacturers in two different Firewire enclosures, a Sarotech HardBox Firewire 400, and a Pleiades Icecube 1394A+B+USB2 enclosure (see below for System Profiler info).

The hard drives pass SMART tests (where supported) and DiskWarrior. The RAM in both machines has been checked usign memtestosx.

The problem has not been examined under 10.3. (ie I’m not sure if it’s confined to Tiger).

FireWire Bus:

  Maximum Speed:	Up to 400 Mb/sec

OXFORD IDE Device 1:

  Manufacturer:	Macpower
  Model:	0x0
  GUID:	0x1D202E02009B9
  Maximum Speed:	Up to 800 Mb/sec
  Connection Speed:	Up to 400 Mb/sec
  Sub-units:
OXFORD IDE Device 1 Unit:
  Unit Software Version:	0x10483
  Unit Spec ID:	0x609E
  Firmware Revision:	0x107
  Product Revision Level:	3.01
  Sub-units:
OXFORD IDE Device 1 SBP-LUN:
  Capacity:	372.61 GB
  Removable Media:	Yes
  BSD Name:	disk2
  OS9 Drivers:	Yes
  S.M.A.R.T. status:	Not Supported
  Volumes:
400G:
  Capacity:	372.49 GB
  Available:	27.38 GB
  Writable:	Yes
  File System:	Journaled HFS+
  BSD Name:	disk2s10
  Mount Point:	/Volumes/400G

FLEX HDD:

  Manufacturer:	Sarotech Co., Ltd.
  Model:	0x1
  GUID:	0x30E000000001A4
  Maximum Speed:	Up to 400 Mb/sec
  Connection Speed:	Up to 400 Mb/sec
  Sub-units:
FLEX HDD Unit:
  Unit Software Version:	0x10483
  Unit Spec ID:	0x609E
  Firmware Revision:	0x37
  Product Revision Level:	
  Sub-units:
FLEX HDD SBP-LUN:
  Capacity:	149.05 GB
  Removable Media:	Yes
  BSD Name:	disk1
  OS9 Drivers:	Yes
  S.M.A.R.T. status:	Not Supported
  Volumes:
TV3:
  Capacity:	148.92 GB
  Available:	1.49 GB
  Writable:	Yes
  File System:	Journaled HFS+
  BSD Name:	disk1s10
  Mount Point:	/Volumes/TV3

FLEX:

  Manufacturer:	Sarotech Co., Ltd.
  Model:	0x1
  GUID:	0x30E000E0000098
  Maximum Speed:	Up to 400 Mb/sec
  Connection Speed:	Up to 400 Mb/sec
  Sub-units:
FLEX Unit:
  Unit Software Version:	0x10483
  Unit Spec ID:	0x609E
  Firmware Revision:	0x38
  Product Revision Level:	08.0
  Sub-units:
FLEX SBP-LUN:
  Capacity:	232.89 GB
  Removable Media:	Yes
  BSD Name:	disk3
  OS9 Drivers:	Yes
  S.M.A.R.T. status:	Not Supported
  Volumes:
250Gb:
  Capacity:	232.76 GB
  Available:	11.27 GB
  Writable:	Yes
  File System:	Journaled HFS+
  BSD Name:	disk3s10
  Mount Point:	/

After copying the file from one drive (/) to the other (/Volumes/400G) we compare them:

$cmp /retrocats/Backup Set E /Volumes/400G/Retro backups/Backup Set E

The results:

/retrocats/Backup Set E /Volumes/400G/Retro backups/Backup Set E differ: char 134320594945, line 529732970

We dump the file contents near the difference for the source file:

$hexdump -s 134320594940 -n 32 /retrocats/Backup Set E
1f46219ffc 9100 d2fb 0e83 c0ee f7d5 d36c bafe ea8e
1f4621a00c adbf 1393 adf0 e048 4c7b 6815 6d13 c089
1f4621a01c

We dump the file contents near the difference for the copied file:

$hexdump -s 134320594940 -n 32 /Volumes/400G/Retro backups/Backup Set E

1f46219ffc 9100 d2fb 0e83 c0ee f7d5 d36c bafe ea8e
1f4621a00c adbf 1393 adf0 e048 4c7b 6815 6d13 c089
1f4621a01c

Hmm… The files appear to be identical at this point, despite cmp reporting a difference!

We try the same thing again

$cmp /retrocats/Backup Set E /Volumes/400G/Retro backups/Backup Set E

/retrocats/Backup Set E /Volumes/400G/Retro backups/Backup Set E differ: char 134320619521, line 529733079

Now the files differ, but at a different position in the file (and we haven’t changed anything)! The positions seem to be roughly the same sort of depth into the file though…

Compare the hex dumps of the two files again:

$ hexdump -s 134320619515 -n 32 /Volumes/400G/Retro backups/Backup Set E
1f4621fffb 05e2 4856 5e00 0000 0000 0000 0000 0000
1f4622000b 0000 0000 0000 0000 0000 0000 0000 0000
1f4622001b

$hexdump -s 134320619515 -n 32 /retrocats/Backup Set E
1f4621fffb 05e2 4856 5ea1 e5ac 5185 0f27 a7c7 96c2
1f4622000b 7f1d adb9 3656 7ded d87e ba69 3cca 9af2                              
1f4622001b

We see some pretty obvious differences this time around!