Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5579: 1_40_0 serialization break.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-05-30 04:36:59
#5579: 1_40_0 serialization break.
--------------------------------------------------------+-------------------
Reporter: Phil Hartmann <phil.hartmann82@â¦> | Owner: ramey
Type: Bugs | Status: new
Milestone: To Be Determined | Component: serialization
Version: Boost 1.46.1 | Severity: Showstopper
Resolution: | Keywords: serialization object cross dll
--------------------------------------------------------+-------------------
Comment (by Phil Hartmann <phil.hartmann82@â¦>):
Sorry Ramey, didn't mean to imply that the fix itself was incorrect. The
change makes sense, the problem arises from archives which are written in
1.37-1.39 and 1.40 because they are all version 5.
DLL1: archive & <type_a>;[[BR]]
DLL2: archive & <type_a>;[[BR]]
In 1.37-1.39 it'll write[[BR]]
<type_a_info><data><type_a_info><data>[[BR]]
in 1.40 and above it'll write[[BR]]
<type_a_info><data><data>[[BR]]
So in 1.40 if I attempt to read in the above to read a 1.39 archive it
attempts to read:[[BR]]
<type_a_info><data><data>[[BR]]
Which obviously blows up as its the length of <type_a_info> off on the
second read.
What i've added at the moment is a boolean flag to cobject, which if its
set it uses the older incorrect comparison, and for newer archives can use
the new comparison.
I also added a global constant that I just temporarily set to 'true'
called boost_archive_ver_5_is_pre140, i'm not sure what the real solution
here is because both of them are version 5. We need some user way to
specify via config file to specify if version 5 was 1.39 or 1.40, and if
you had archives in both 1.39/1.40 I think we're just kind of hosed in
that case, luckily for me I am not, hopefully most others can make the
same assumption that they are either 1.40 or 1.39.
{{{
const bool boost_archive_ver_5_is_pre_140 = true;
inline class_id_type basic_iarchive_impl::register_type(const
basic_iserializer & bis)
{
// if we are serializing in an old archive (before version 5, or
version 5 and the user specified that
// archive revision 5 is actually 1_39 not 1_40 [ as this is ambigous
]
bool old_cid_lookup = (m_archive_library_version < 5 || (5 ==
m_archive_library_version && boost_archive_ver_5_is_pre_140));
class_id_type cid(cobject_info_set.size());
cobject_type co(cid, bis, old_cid_lookup);
std::pair<cobject_info_set_type::const_iterator, bool> result =
cobject_info_set.insert(co);
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5579#comment:3> 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:06 UTC