Boost logo

Boost :

Subject: [boost] [serialization] polymorphic archives runtime failure (was: polymorphic archives ... generates linker errors)
From: Christoph Heindl (christoph.heindl_at_[hidden])
Date: 2009-12-01 14:50:18


Hi,

thanks to Roberts help I managed to get the polymorphic archives
issue, discussed earlier at
http://article.gmane.org/gmane.comp.lib.boost.devel/196984), resolved.

However there remains a runtime issue I can't resolve: Based on
demo_polymorphic.cpp I've re-created minimal test example, which I
think is correct, that fails with the runtime assertion

it != m_map.end(), file libs\serialization\src\basic_serializer_map.cpp, line 72

on load. The demo consists of 5 files that create the following
scenario: class B inherits from polymorphic base class A. An object of
B is allocated on the heap and serialized through a base pointer A
using a polymorphic xml archive. Saving runs without problems. Next, B
is loaded from the stream through a base pointer to A. This fails with
the mentioned assertion.

What makes me wonder is that changing the from
polymorphic_xml_iarchive to xml_iarchive and from
polymorphic_xml_oarchive to xml_oarchive will not produce the named
assertion.

As mentioned in my previous post, I tested this with boost 1.40.0 and msvc 9.0.

I would be really, really, grateful if you could give the demo a try.
I've prepared everything so that it is just a matter of copying the
files to libs/serialization/example and adding

[ demo_bsl_run demo_polymorphic_cheind : cheind_a cheind_b ]

The files can be found attached to my lost post at

http://article.gmane.org/gmane.comp.lib.boost.devel/197061

Best regards,
Christoph


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk