Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9601: Unable to load archives with pointer instances which contain self reference cycles in 1.55
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-01-30 00:22:03
#9601: Unable to load archives with pointer instances which contain self reference
cycles in 1.55
-------------------------------+---------------------------
Reporter: brandon.kohn | Owner: ramey
Type: Bugs | Status: assigned
Milestone: To Be Determined | Component: serialization
Version: Boost 1.55.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+---------------------------
Comment (by ramey):
I've spent a fair amount of time investigating this.
I think that this is a problem which as always existed in the library.
Note that the following fails
{{{
PointerHolder *pph = new PointerHolder;
pph->m_ph = pph;
test_ostream os(testfile, TEST_STREAM_FLAGS);
test_oarchive oa(os, TEST_ARCHIVE_FLAGS);
//oa << BOOST_SERIALIZATION_NVP(pph);
oa << pph;
}}}
While this passes:
{{{
PointerHolder ph;
pph.m_ph = ph;
test_ostream os(testfile, TEST_STREAM_FLAGS);
test_oarchive oa(os, TEST_ARCHIVE_FLAGS);
//oa << BOOST_SERIALIZATION_NVP(pph);
oa << pph;
}}}
That is, this issue is the usage of a recursive data structure at the
"top" level.
Actually I believe that this could occur whenever ALL the pointers are
allocated with "new" so I think your fix is too specific. On the other
hand, looking at the internals, it's not obvious how to fix this. It's
sort of a chicken and egg issue. That is it's hard to assign the address
of an object which we are still creating.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9601#comment:7> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:15 UTC