[Boost-bugs] [Boost C++ Libraries] #5567: boost serialization 1_46_1 incompatible with prior versions due to backwards comparison

Subject: [Boost-bugs] [Boost C++ Libraries] #5567: boost serialization 1_46_1 incompatible with prior versions due to backwards comparison
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-05-26 11:33:42


#5567: boost serialization 1_46_1 incompatible with prior versions due to
backwards comparison
-------------------------------------------------------+--------------------
 Reporter: Phil Hartmann <phil.hartmann82@…> | Owner: ramey
     Type: Bugs | Status: new
Milestone: Boost 1.47.0 | Component: serialization
  Version: Boost 1.46.1 | Severity: Showstopper
 Keywords: serialization compatability |
-------------------------------------------------------+--------------------
 Archive's writing class_id_type between 1_41 <and prior> and being read
 back in 1_46 will fail.

 basic_binary_iarchive.hpp line 104 in 1_46 is
 "if(boost::archive::library_version_type(6) < lvt){"

 Or 6 < lvt which is lvt >= 7, and because the if before it is 7 < lvt, its
 essentially lvt == 7.

 So if the version is 7 serialize in a 16 bit integer, else versions 1
 through 6 serialize in a 32 bit integer.

 The problem here is this is backwards. Version 1-6 are 16 bit, 7 might
 have been 32bit (because of issues in 1_42/1_43).

 The code needs to be swapped (assuming consistency throughout the file is
 to remain).


 tracking_type also appears to have the same issue (although it seems to be
 ok)

 version_type I don't get at all, going back through the
 basic_binary_iarchive.hpp's I don't see how the code is right at all.
 Anything less than version 7 should be serializing a 8 bit int from what I
 can tell.


 Prior versions can be viewed at:
 http://www.boost.org/doc/libs/1_44_0/libs/serialization/src/basic_archive.cpp
 http://www.boost.org/doc/libs/1_41_0/libs/serialization/src/basic_archive.cpp
 http://www.boost.org/doc/libs/1_40_0/libs/serialization/src/basic_archive.cpp
 ...

 Library versions can be viewed at:
 http://www.boost.org/doc/libs/1_44_0/boost/archive/basic_binary_iarchive.hpp
 http://www.boost.org/doc/libs/1_41_0/boost/archive/basic_binary_iarchive.hpp
 http://www.boost.org/doc/libs/1_40_0/boost/archive/basic_binary_iarchive.hpp
 ...

 Side Note:
 IMHO writing code such as 6 < lvt is extremely unintuitive and backwards
 of how most people think.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5567>
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