Boost logo

Boost-Build :

Subject: [Boost-build] Peculiar bug in Boost Serialization
From: Ven Tadipatri (ven.tadipatri_at_[hidden])
Date: 2011-01-20 16:42:45

    I'm hoping someone on this list will be able to help with the
problem I'm having with boost serialization and virtual inheritance.
Below is the class that I'm working on.I followed the guide:,
but the serialization methods don't seem to work for just this
particular class. A "pure virtual method called" error is thrown. There
are subclasses of ByteDataObject that have no problem, and other
subclasses of the BaseDataObject that also work just fine. It's just
this class, and I just can't seem to figure out what the error could be
due to.
    Other people seem to be having similar issues:
I too feel that this is due to some upgrade in Boost that triggered the
error, since the last version I used: Boost 1.38 worked just fine with
this code. Also, commenting out the line makes the code work just fine.
Of course, that means calling the superclass's save and load methods,
which is precisely what the guide says not to do.

Here is the actual error:
pure virtual method called
terminate called without an active exception

However any attempt to debug it or output anything at that line fails,
which from what I understand may be due to some stack corruption or some
problem unrelated to the line of the code that actually seems to be failing.


class ByteDataObject : public virtual BaseDataObject {


       friend class boost::serialization::access;
       template <class Archive>
       void save (Archive & ar, const unsigned int version) const {

             // invoke base class serialization
           BaseDataObject::save(ar, version);
              //this fails
             //ar << boost::serialization::base_object<const


       template <class Archive>
       void load (Archive & ar, const unsigned int version) {

             // invoke base class serialization
              //this fails
             //ar >>



Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at