Boost logo

Boost Users :

From: Bill Lear (rael_at_[hidden])
Date: 2006-05-02 21:09:33


I would assume that simply changing the following from xml_oarchive:

    ofstream ofs(filename.c_str(), ios::binary);
    boost::archive::xml_oarchive oa(ofs);
    oa << BOOST_SERIALIZATION_NVP(my_object);

to text_oarchive (with, of course, appropriate changes to include the
appropriate headers):

    ofstream ofs(filename.c_str(), ios::binary);
    boost::archive::text_oarchive oa(ofs);
    oa << BOOST_SERIALIZATION_NVP(my_object);

should, a priori, not result in a core dump in the text_oarchive
version?

I am running under gcc 3.4.3, and and the Intel C++ compiler version
9.0, boost version 1.33.1. The text_oarchive fails with a
segmentation violation on both compilers, and the xml_oarchive works
with both. Cursory inspection of the xml output shows the xml to be
well-formed, etc.

Before I try to narrow this down further and provide a clear test that
shows this error (which, given the complexity of the code and the size
of the datasets, will be a considerable effort), I would like to know
if my above assumption is correct, or if it is possible I have made a
mistake somehow in writing my serialization methods.

BTW, I am the same guy who has posted several (confirmed) bugs to this
list: I am not a beginner, I have been using boost serialization for
the better part of a year or so, so in general, I know what I'm doing.
I say this simply because I don't want to waste a ton of time with
this if I need not --- in short, to my mind, this looks like a clear
example of a bug in the boost text_oarchive, but I perhaps may be
wrong.

Thank you.

Bill


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