Incorrect assertion in Boost.Exception?

Hello,
we want to use Boost.Exception (1.47.0) with MS Visual Studio 2010 in a project that consists of several DLLs and a main executable.
We have situations where we store an error_info into an exception from inside a DLL and access it again from another DLL/the EXE, e.g.:
dll.cpp:
void func()
{
BOOST_THROW_EXCEPTION(my_exception() << my_info(42));
}
exe.cpp:
try
{
func();
}
catch (boost::exception& e)
{
std::cout << *boost::get_error_info

On Fri, Nov 30, 2012 at 7:26 AM, Thorsten Dahlheimer
Now at runtime, when the error info is accessed, the following assertion in boost::exception_detail::error_info_container_impl::get() fails: BOOST_ASSERT( BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==ti.type_ ); As far as we can see, this happens because MSVC++ uses seperate type_info objects in each dll/exe, and the above assertion compares pointers to type_infos instead of the objects themselves. We believe this is a bug on the Boost side, since type_info objects for the same type are generally not guaranteed to be unique. Are we correct with that?
Reading the sources from the latest release and trunk branch, the assertion looks like this: BOOST_ASSERT( *BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==*ti.type_ ); Which seems correct, so it seems this was a bug that is already fixed. Can you use a newer Boost release? Thanks, Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode

Am Sat, 1 Dec 2012 19:05:43 -0800
schrieb Emil Dotchevski
Reading the sources from the latest release and trunk branch, the assertion looks like this:
BOOST_ASSERT( *BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==*ti.type_ );
Which seems correct, so it seems this was a bug that is already fixed. Can you use a newer Boost release?
Great, that should work. (We assumed that Exceptions hadn't changed since 1.47 because it wasn't listed in the release notes as an "updated library"...) Thanks, Thorsten
participants (2)
-
Emil Dotchevski
-
Thorsten Dahlheimer