Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

ZipBlockWriter seems to corrupt data

Moderators: kris

Posted: 07/06/11 19:03:29

I've run into what seems to be bug quite hard to track down. I have an array of strings containing paths of files to put into an archive. This array original comes from a Ruby script my application is running. I'm looping through the array and putting the files in to the archive using "putFile". Just before that I'm printing the strings to make sure the paths are correct. Quite often (in average, probably, 50% of the times I run the application) one (or several) of the strings in the array somehow gets corrupted when putting the file in the archive. The paths I'm trying to put into an archive is basically all D files from the repository (see below).

This is what I've tried and found out:

  • I've tried duping the array and the strings in the array, same result
  • The corruption always happens at the same place in the array
  • The corruption only happens when the data originates from Ruby
  • The corruption seems to happen somewhere in ZipBlockWriter.put_compressed
  • If I run the exact same code but comment out "putFile" the array never gets corrupted

All code is available here:
The relevant files are:

Other relevant info:

  • Tango trunk (don't know the exact revision)
  • DMD version 1.067
  • Mac OS X
  • Ruby is embedded in the application, ruby-1.9.2-p136 (installed via rvm), statically linked

There are no responses to display.