Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost][iostreams] Crash when using bzip2 codec
From: Roland Bock (rbock_at_[hidden])
Date: 2009-01-17 15:04:06


Hi

some months ago, I filed two tickets for 1.36 which are related to this,
I think. They are not solved yet (but at least I found ways to work
around them).

https://svn.boost.org/trac/boost/ticket/2411
https://svn.boost.org/trac/boost/ticket/2415

If you could verify that my problems were no problems in 1.34, maybe you
could add some comments. It would probably help to find and fix the
source of the problem.

Regards,

Roland

Marc Viala wrote:
> Hi,
>
> During our migration from Boost 1.34.1 to Boost 1.37.0 we are facing a bug
> in bzip2 codec (boost::iostreams::bzip2_compressor &
> boost::iostreams::bzip2_compressor).
>
> To demonstrate it, you will find hereafter a code snippet:
>
> #include <fstream>
>
> #include <boost/iostreams/filtering_stream.hpp>
> #include <boost/iostreams/combine.hpp>
> #include <boost/iostreams/filter/bzip2.hpp>
> #include <boost/iostreams/filter/gzip.hpp>
> #include <boost/iostreams/filter/zlib.hpp>
>
> void main()
> {
> using namespace boost::iostreams ;
>
> // Run smoothly
> {
> filtering_stream<bidirectional> chain ;
> chain.push(combine(gzip_decompressor(), gzip_compressor())) ;
> chain.push(std::fstream("test.gz", std::ios::binary|std::ios::out)) ;
> chain << "test" ;
> }
>
> // Run smoothly
> {
> filtering_stream<bidirectional> chain ;
> chain.push(combine(zlib_decompressor(), zlib_compressor())) ;
> chain.push(std::fstream("test.zip", std::ios::binary|std::ios::out)) ;
> chain << "test" ;
> }
>
> // Crash in bzip2_decompressor_impl::close
> {
> filtering_stream<bidirectional> chain ;
> chain.push(combine(bzip2_decompressor(), bzip2_compressor())) ;
> chain.push(std::fstream("test.bz2", std::ios::binary|std::ios::out)) ;
> chain << "test" ;
> }
> }
>
> The crash in bzip2_decompressor_impl::close is due to an access violation @
> line 359 in boost/iostreams/filter/bzip2.hpp. For the other codec, zlib &
> gzip, everything runs smoothly.
>
> Set-up:
> Boost 1.37.0
> Windows XP SP3
> Visual C++ 7.1
> Bzip2 Library 1.0.5
>
> With Boost 1.34.1 the bzip2 codec seems to run smoothly. Is there any work
> around for this codec w/ Boost 1.37.0?
>
> Thanks in advance.
>
> Best regards,
>
> Marc Viala
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net