Boost logo

Boost Users :

Subject: Re: [Boost-users] Stability of serialization across boost versions
From: Sohail Somani (sohail_at_[hidden])
Date: 2014-05-18 10:32:25


On 18/05/2014 4:34 AM, John Maddock wrote:
>> A program I wrote using the Boost serialization library trips up when
>> communicating with instances of itself on hosts with different
>> versions of
>> the library.
>>
>> terminate called after throwing an instance of
>> 'boost::archive::archive_exception'
>> what(): unsupported version
>>
>>
>> It's not reasonable to require that users of my software upgrade their
>> hosts in lock step with each other, all at once or not at all. But
>> library
>> skew on the order of a bit over two years at least (consider users of
>> Ubuntu LTS) arises naturally and quite often. I think the solution would
>> be for boost serialize to offer an API point that says "write with binary
>> protocol n", which leaves the library free to read with any protocol it
>> knows. When I feel that n+1 has existed for long enough, I can tell my
>> program to use n+1. Unfortunately, and I'd like to be shown wrong, I
>> don't
>> think the library provides such an API point.
>>
>> Any feedback or suggestions other than not using boost for serialization?
>
> It was my understanding that stuff like that should be supported, if you
> have a test case then filing a bug report would seem to be in order?

Based on the error, it seems like what is happening is that a newer
version of Boost is attempting to communicate with an older version of
Boost. The actual exception is from the archive itself, IIUC. The
library has explicitly said this is not supported, unfortunately.

To the OP, I'd suggest not upgrading Boost serialization or requiring
upgrading in lockstep. Upgrading multiple hosts in random order means
new communicating with old. This is an unsupported use case.

Sohail


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