[Boost-bugs] [Boost C++ Libraries] #2266: destructors of basic_binary_[io]primitive throw exceptions

Subject: [Boost-bugs] [Boost C++ Libraries] #2266: destructors of basic_binary_[io]primitive throw exceptions
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-08-28 00:49:17


#2266: destructors of basic_binary_[io]primitive throw exceptions
----------------------------+-----------------------------------------------
 Reporter: Igor Nazarenko | Owner: ramey
     Type: Bugs | Status: new
Milestone: Boost 1.35.1 | Component: serialization
  Version: Boost 1.35.0 | Severity: Showstopper
 Keywords: |
----------------------------+-----------------------------------------------
 See:
 boost/archive/impl/basic_binary_oprimitive.ipp,
 boost/archive/impl/basic_binary_iprimitive.ipp

 Destructors of both basic_binary_oprimitive and basic_binary_iprimitive
 throw exceptions, see the code snippet below.

 I'm trying to use binary archives to send data over a pipe. Assume one of
 the pipe ends is closed unexpectedly. On the other end of the pipe the
 archive gets an exception, runtime tries to unroll the stack, calls this
 destructor, the destructor throws again and my program terminates without
 warning.

 --------------------- code excerpt ---------------------

 basic_binary_iprimitive<Archive, Elem, Tr>::~basic_binary_iprimitive(){
     // push back unread characters
     int result = static_cast<detail::input_streambuf_access<Elem, Tr> &>(
         m_sb
     ).sync();
     if(0 != result){
         boost::throw_exception(
             archive_exception(archive_exception::stream_error)
         );
     }
 }

-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/2266>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:58 UTC