id summary reporter owner description type status milestone component version severity resolution keywords cc 8150 gzip_compressor produces corrupt data when used with filtering_ostream matt@… Jonathan Turkanis "In some cases, the USE_CORRUPTING_OSTREAM path in the following program will produce corrupt gzip output (fails CRC and the de-gzipped file differs slightly from the original input). This does not occur for all data, so I will attach an input data file that triggers the error. This bug only affects gzip_stream when used with filtering_ostream. It does not affect filtering_istream usage. Bug reproduced on Mac 10.8.2, 64-bit, Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn), zlib 1.2.5 (dylib as shipped with Mac OS X), boost 1.53.0. Bug does not appear to be affected by compiler optimizations (-O0 and -Os tested). {{{ #include #include #include #include #include #include #include #include #include #include int main(int argc, char *argv[]) { std::vector input; std::vector output; boost::iostreams::file_descriptor_source source(""inputdata""); boost::iostreams::copy(source, boost::iostreams::back_inserter(input)); #define USE_CORRUPTING_OSTREAM 1 #if USE_CORRUPTING_OSTREAM boost::iostreams::filtering_ostream gzip_stream; gzip_stream.push(boost::iostreams::gzip_compressor()); gzip_stream.push(boost::iostreams::back_inserter(output)); gzip_stream.write(&input[0], input.size()); boost::iostreams::close(gzip_stream); #else boost::iostreams::filtering_istream gzip_stream; boost::iostreams::stream input_array(&input[0], input.size()); gzip_stream.push(boost::iostreams::gzip_compressor()); gzip_stream.push(input_array); boost::iostreams::copy(gzip_stream, boost::iostreams::back_inserter(output)); #endif boost::iostreams::file_descriptor_sink destination(""inputdata.gz""); destination.write(&output[0], output.size()); } }}} " Bugs new To Be Determined iostreams Boost 1.53.0 Regression