#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 , 14 years ago
Status: | new → assigned |
---|
comment:2 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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.