Forum Navigation
ZipBlockWriter seems to corrupt data
Posted: 07/06/11 19:03:29I'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: https://github.com/jacob-carlborg/orbit
The relevant files are:
- Archiver, where I'm calling "putFile": https://github.com/jacob-carlborg/orbit/blob/b02da71871e7bfe4605e7662687d0d1a4886fa31/orbit/orbit/Archiver.d#L32
- Where the Ruby array is converted to a D array: https://github.com/jacob-carlborg/orbit/blob/b02da71871e7bfe4605e7662687d0d1a4886fa31/orbit/dsl/ruby/SpecificationEnviroment.d#L42
- Where the Ruby string is converted to a D string: https://github.com/jacob-carlborg/orbit/blob/b02da71871e7bfe4605e7662687d0d1a4886fa31/ruby/core/String.d#L68
- Where the opApply is implemented for Ruby arrays: https://github.com/jacob-carlborg/orbit/blob/b02da71871e7bfe4605e7662687d0d1a4886fa31/ruby/core/Array.d#L75
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.