Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2266 closed Bugs (fixed)

destructors of basic_binary_[io]primitive throw exceptions

Reported by: Igor Nazarenko Owned by: Robert Ramey
Milestone: Component: serialization
Version: Boost 1.35.0 Severity: Showstopper
Keywords: Cc:

Description

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.


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)

);

}

}

Change History (3)

comment:1 by Robert Ramey, 14 years ago

Status: newassigned

comment:2 by Robert Ramey, 14 years ago

Resolution: fixed
Status: assignedclosed

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.

comment:3 by (none), 14 years ago

Milestone: Boost 1.35.1

Milestone Boost 1.35.1 deleted

Note: See TracTickets for help on using tickets.