Boost C++ Libraries: Ticket #2266: destructors of basic_binary_[io]primitive throw exceptions https://svn.boost.org/trac10/ticket/2266 <p> See: boost/archive/impl/basic_binary_oprimitive.ipp, boost/archive/impl/basic_binary_iprimitive.ipp </p> <p> Destructors of both basic_binary_oprimitive and basic_binary_iprimitive throw exceptions, see the code snippet below. </p> <p> 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. </p> <hr /> <p> basic_binary_iprimitive&lt;Archive, Elem, Tr&gt;::~basic_binary_iprimitive(){ </p> <blockquote> <p> <em> push back unread characters int result = static_cast&lt;detail::input_streambuf_access&lt;Elem, Tr&gt; &amp;&gt;( </em></p> <blockquote> <p> m_sb </p> </blockquote> <p> ).sync(); if(0 != result){ </p> <blockquote> <p> boost::throw_exception( </p> <blockquote> <p> archive_exception(archive_exception::stream_error) </p> </blockquote> <p> ); </p> </blockquote> <p> } </p> </blockquote> <p> } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2266 Trac 1.4.3 Robert Ramey Thu, 28 Aug 2008 20:51:58 GMT status changed https://svn.boost.org/trac10/ticket/2266#comment:1 https://svn.boost.org/trac10/ticket/2266#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Robert Ramey Fri, 05 Sep 2008 22:39:50 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2266#comment:2 https://svn.boost.org/trac10/ticket/2266#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> I've "fixed" this by commenting out the destructor call in extended_type_info. As far as I know, extended_type_info is only used by the serialization library which doesn't invoke this function. Should the this "sub" library be used by another application or other library, this will have to be addressed. </p> Ticket Mon, 03 Nov 2008 14:20:34 GMT milestone deleted https://svn.boost.org/trac10/ticket/2266#comment:3 https://svn.boost.org/trac10/ticket/2266#comment:3 <ul> <li><strong>milestone</strong> <span class="trac-field-deleted">Boost 1.35.1</span> </li> </ul> <p> Milestone Boost 1.35.1 deleted </p> Ticket