Boost logo

Boost Users :

Subject: [Boost-users] crash in boost serialization (1.44)
From: rico.cadetg_at_[hidden]
Date: 2010-12-08 11:20:18


Hello,

I’ve noticed a crash (accessing a null pointer) inside the boost serialization (version 1.44). I use visual studio 2005, the code to serialize is in a Dll. I have a small visual studio solution that reproduces the crash, I guess it is a bug and should cause a crash in other environments as well.

I have the following classes

INode (Interface)
Node (Abstract, derived from INode)
LeafNode(derived from Node)
TableNode(derived from Node)

The TableNode has a list of INode*, the children. A TableNode itself can be a child of a TableNode.

All classes are inside a Dll and correctly exported (I have no “unregistered class” exceptions).

If I create a TableNode with some entries including another TableNode and serialize it as an object, I get the crash when trying to deserialize later. If I do the same, but serialize the parent TableNode as a pointer, it works.

I guess the serialization framework does not recognize that a TableNode gets serialized through a pointer and therefore the object tracking does not work correctly.

I can send the example solution if needed.

The crash is in the basic_iarchive.cpp, line 456 (bpis_ptr is null):
if(! tracking){
    bpis_ptr->load_object_ptr(ar, t, co.file_version);
}

Best regards,
Rico


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