Serialization: how to port binary archives containing NAN created with version 1.43 to version 1.47?
Hi everyone, I am encountering a particularly gnarly version of the backward-compatibility problem with binary archives that others have discovered (here: http://groups.google.com/group/boost-list/browse_thread/thread/f4e3287f6925f..., for example). Specifically, I have a number of binary archives created with version 1.43 of the library that are unreadable using version 1.47. I'd like to "port" them forward, so my initial plan was to compile a simple translator program against the 1.43 library that would read the binary archives and save them as (1.43) text archives. Then, a second program compiled against the 1.47 library would read the text archives and save them as (1.47) binary. Easy peasy. Except: the archives contain NAN values, which work fine when everything is binary but fail to deserialize for any version of the library when the archive is text (or xml, apparently), for reasons I don't quite understand. So my question is: how can I take my (1.43) binary archives containing NAN values and get them into a format readable by the current (1.47) version of the library? Is it possible? Thanks, Terry (An aside: it seems strange that I'm allowed to serialize a NAN to text, but it breaks when I try to deserialize it... why not prevent the creation of un-deserializable archives at the point of serialization?).
Hi Terry, you might want to check out our eos portable archives from: https://github.com/boost-vault/serialization Because of a user request we support serialization of nan and inf. The official boost archives don't, as you already found out. Regards, -- Christian Pfligersdorffer Software Engineering www.eos.info
Pfligersdorffer, Christian wrote:
Hi Terry, you might want to check out our eos portable archives from: https://github.com/boost-vault/serialization
Because of a user request we support serialization of nan and inf. The official boost archives don't, as you already found out.
I just looked at the page. It looks very interesting to me. When I have some time, I will be investigating which of these might be included in the boost distribution of the serialization library. Note that serialization of individual libraries such as tuple bitset etc. is not part of the serialization library itself but rather part of the particular library. (Obviously it's not scalable for me or anyone else to implement serialization for every other possible type.) So these should be pitched to the the maintainers of these other packages. Robert Ramey
Regards,
Thanks, Christian, this looks interesting. Do you know if they are compatible with 1.43, or if there are any special tricks I need to use to get them to work? Currently, I am able to compile with them, but I get a segmentation fault the first time I try to deserialize from a binary_iarchive (i.e., not even a portable_archive). The exact same code compiles and runs fine when I just comment out the portable_iarchive and portable_oarchive #include lines, so I'm a little puzzled as to what is going on. Thanks, Terry On Fri, Aug 19, 2011 at 8:00 AM, Pfligersdorffer, Christian < Christian.Pfligersdorffer@eos.info> wrote:
Hi Terry, you might want to check out our eos portable archives from: https://github.com/boost-vault/serialization
Because of a user request we support serialization of nan and inf. The official boost archives don't, as you already found out.
Regards,
-- Christian Pfligersdorffer Software Engineering www.eos.info _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi Terry, this is weird. Could you send me a code snippet where this segmentation fault happens? PS: The archives can be used with boost 1.33 to boost 1.47. Regards, -- Christian Pfligersdorffer Software Engineering www.eos.info
participants (3)
-
Pfligersdorffer, Christian
-
Robert Ramey
-
Terry McLendive