Re: [Boost-users] [Serialization] a coupla crashes fromhiearchycomplexity

Robert,
I would need permission to send you the exact library code. I am
reluctant to do this primarily because recreating my exact build
environment would be a hassle (we are using gnumake on the PC). I also
would need to do this directly to you, as I could not post this code
into a public forum.
Having said that, any recursive descent parser has complexity limits
based on stack size. It would be pretty easy to create test cases that
probe these complexity limits for the various archive types. I would
like to see how much (approximately) stack space is allocated in the
runtime for each level of xml hierarchy, and also for the text archives.
The main complexity seems to be because I am using shared_ptr's
extensively at all levels of the hierarchy. Thus, I have 2 levels
nested for each class, the <px> data </px> and the actual data, which is
in turn being represented by a collection of shared_ptr's, etc. I am
also using std::map of shared pointers, and std::set of shared_ptr's. I
also use enable_shared_from_this<T> for my base classes, then statically
cast the resultant shared pointers internally for the derived classes.
This is to get around a Linux problem which I can describe more fully if
you like (would take a few pages of explanation).
So for example:
class Base : public boost:enable_shared_from_this<Base>
{
virtual boost::shared_ptr<Base> GetSharedFromThis()
{
return shared_from_this();
}
};
class Derived1 : public Base
{
public:
virtual boost::shared_ptr<Derived1> GetSharedFromThis()
{
return static_pointer_cast<Derived1>( shared_from_this() );
}
};
class Derived2 : public Base
{
public:
virtual boost::shared_ptr<Derived2> GetSharedFromThis()
{
return static_pointer_cast<Derived2>( shared_from_this() );
}
};
I am assuming that I do not need to call
boost::serialization::base_object ( *this ); When I serialize the base class. Could that be the problem?
I think what I am going to do is go back into the program and simply
eliminate all of the shared_ptr serializations. I can serialize to raw
pointers, and then just create the shared_ptr's from those pointers
explicitly in my case. I simply do not ever have any shared_ptr's with
multiple reference counts to worry about.
I will let you know what happens.
________________________________
From: Robert Ramey [mailto:ramey@rrsd.com]
Sent: Monday, November 13, 2006 8:30 AM
To: boost-users@lists.boost.org
Subject: Re: [Boost-users] [Serialization] a coupla crashes
fromhiearchycomplexity
I would be curious to see your particular case. The fact that different
archives give problems that seem related to nesting depth suggest along
with the fact that this hasn't been reported suggests that there is some
sort of use case or error which hasn't been considered.
Robert Ramey
"Reusser, Edward"

it would seem to me that a stack trace would be interesting to see. I'm wondering if its just a stack that is too short (I would have expected to see this sooner if it was) or some error somewhere which creates an unterminated recurssion. With VC its easy to see the stack trace. With the Gnu Debuger, one has to back trace from the right point.
Robert Ramey
"Reusser, Edward"
participants (2)
-
Reusser, Edward
-
Robert Ramey