Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization] assert in void_caster
From: Markus Henschel (markus.henschel_at_[hidden])
Date: 2010-06-29 05:36:18


> This static library is linked to two dynamic libraries. For example,
> dll_a.dll and dll_b.dll. When I try to load those dlls in my
> application
> (via LoadLibrary), I get assert in void_cast.cpp (225):
>
> std::pair<void_cast_detail::set_type::const_iterator, bool>
> result;
> result = s.insert(this);
> assert(result.second);
>
> Is it by design? Or I missed something?
>
> I am using boost v1.43 and VS 10 on Windows 7.
>
> Thank you in advance.
>
> Alex
>

The same assert fired here too but for a slightly different reason. For some classes the base derived relationship is registered by calling void_cast_register directly and at the same time by calling the serialize member function of the base class from the serialize member function of the derived class. This never caused any problems for us in boost 1.34.1.

As far as I understand the assert fires because the base derived relationship is registered multiple times. But is this really a problem? We placed the void_cast_register call in a macro that exists in the implementation of every class anyway to be sure the base derived relationship was registered. Now we have to solve this differently because otherwise classes that have a serialize function (most don't) will trigger the assert at startup. Is it save to uncomment the assert? Are there real world scenarios when this assert is helpful?

Thanks


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net