serialization of a complex object

Dear list,
I have tried many ways but could not figure out how to boost::serialize
the following object:
Basically, to maintain a big chunk of small objects, I use a memory pool
to allocate a big trunk of memory and return the pointers to small
objects.
struct small
{
int size;
int * ptr;
init(int s, int* p){ size = s; ptr = p; }
}
struct All
{
vector<int> data;
vector<small> objs;
All(int num_obj, int size_obj)
{
data.resize( num_obj * size_obj);
for(int i=0; i

On Sun, Jul 18, 2004 at 09:28:47PM -0500, Bo Peng wrote: It turns out that the library is buggy. I change ar & vector_of_small_objs to for(....) ar & vector_of_small_objs[i] and it works now. Is this the reason why serialization is not yet part of boost distribution? -- Bo Peng

On Sun, Jul 18, 2004 at 11:44:12PM -0500, Bo Peng wrote:
On Sun, Jul 18, 2004 at 09:28:47PM -0500, Bo Peng wrote: and it works now.
No. I still get core dump from time to time. I also notice that many serializaton examples core dump (I tried three) on my system. Can anyone confirm this? I am using redhat 9 with kernel 2.4.20-31.9, gcc-3.2.2-5, boost-1.31-0, serialization20.zip . Some error messages are: # demo original schedule 6:24 bob 0x0x814b400 34135'52.56" 13422'78.3" 24th Street and 10th Avenue 0x0x814b428 35137'23.456" 13335'54.12" State street and Cathedral Vista Lane 0x0x814b998 35136'15.456" 13332'15.3" White House 9:57 bob 0x0x814b400 34135'52.56" 13422'78.3" 24th Street and 10th Avenue 0x0x814b428 35137'23.456" 13335'54.12" State street and Cathedral Vista Lane 0x0x814b998 35136'15.456" 13332'15.3" White House 11:2 alice 0x0x814b400 34135'52.56" 13422'78.3" 24th Street and 10th Avenue 0x0x814b428 35137'23.456" 13335'54.12" State street and Cathedral Vista Lane 0x0x814b998 35136'15.456" 13332'15.3" White House 7:17 ted 0x0x814b9c0 35134'48.789" 13332'16.23" Lincoln Memorial 0x0x814b998 35136'15.456" 13332'15.3" White House 0x0x814b428 35137'23.456" 13335'54.12" State street and Cathedral Vista Lane 9:38 ted 0x0x814b9c0 35134'48.789" 13332'16.23" Lincoln Memorial 0x0x814b998 35136'15.456" 13332'15.3" White House 0x0x814b428 35137'23.456" 13335'54.12" State street and Cathedral Vista Lane 11:47 alice 0x0x814b9c0 35134'48.789" 13332'16.23" Lincoln Memorial 0x0x814b998 35136'15.456" 13332'15.3" White House 0x0x814b428 35137'23.456" 13335'54.12" State street and Cathedral Vista LaneAborted (core dumped) # demo_xml original schedule 6:24 bob 0x0x8175260 34135'52.56" 13422'78.3" 24th Street and 10th Avenue 0x0x8175288 35137'23.456" 13335'54.12" State street and Cathedral Vista Lane 0x0x81757f8 35136'15.456" 13332'15.3" White House 9:57 bob 0x0x8175260 34135'52.56" 13422'78.3" 24th Street and 10th Avenue 0x0x8175288 35137'23.456" 13335'54.12" State street and Cathedral Vista Lane 0x0x81757f8 35136'15.456" 13332'15.3" White House 11:2 alice 0x0x8175260 34135'52.56" 13422'78.3" 24th Street and 10th Avenue 0x0x8175288 35137'23.456" 13335'54.12" State street and Cathedral Vista Lane 0x0x81757f8 35136'15.456" 13332'15.3" White House 7:17 ted 0x0x8175820 35134'48.789" 13332'16.23" Lincoln Memorial 0x0x81757f8 35136'15.456" 13332'15.3" White House 0x0x8175288 35137'23.456" 13335'54.12" State street and Cathedral Vista Lane 9:38 ted 0x0x8175820 35134'48.789" 13332'16.23" Lincoln Memorial 0x0x81757f8 35136'15.456" 13332'15.3" White House 0x0x8175288 35137'23.456" 13335'54.12" State street and Cathedral Vista Lane 11:47 alice 0x0x8175820 35134'48.789" 13332'16.23" Lincoln Memorial 0x0x81757f8 35136'15.456" 13332'15.3" White House demo_xml: ../../../libs/serialization/example/demo_xml.cpp:21: void save_schedule(const bus_schedule&): Assertion `ofs.good()' failed. 0x0x8175288 35137'23.456" 13335'54.12" State street and Cathedral Vista LaneAborted (core dumped) -- Bo Peng

On Mon, 19 Jul 2004 02:10:03 -0500, Bo Peng wrote
On Sun, Jul 18, 2004 at 11:44:12PM -0500, Bo Peng wrote:
On Sun, Jul 18, 2004 at 09:28:47PM -0500, Bo Peng wrote: and it works now.
No. I still get core dump from time to time. I also notice that many serializaton examples core dump (I tried three) on my system. Can anyone confirm this? I am using redhat 9 with kernel 2.4.20-31.9, gcc-3.2.2-5, boost-1.31-0, serialization20.zip .
There are still some open issues with getting all the serialization tests working. As of yesterday this exact same failure was occuring with the latest CVS in the regression reports: http://boost.sourceforge.net/regression-logs/cs-LinuxMandrake-links.html#ser... You can find more of these at: http://boost.sourceforge.net/regression-logs/ http://www.boost.org/status/compiler_status.html HTH, Jeff
participants (2)
-
Bo Peng
-
Jeff Garland