Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization] Sometimes Fails Reading Binary File
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-06-15 20:40:43


AMDG

Robert McCullough wrote:
> Answers to your questions:
> a) it yields different behavior for the same archive.
> b) See attached source LegacyMonitorPersistentData.h
> c) See attached source PersistentData.h
> d) I have not tried that. I will give this a try.
> This is what I am testing.
> I have this archive file ^Press.dat. that was created once by our customer.
> I try to de-serializing using the loadPersistentData() function and it works
> sometimes, but about
> every third try it throw one of the exceptions.
>

Okay. What version of Boost are you using? Can you step through
basic_binary_iarchive<Archive>::init() in a debugger? It's at
boost/archive/impl/basic_binary_archive.ipp line 50.
What you ought to see is:
l is set to 22.
file_signature is set to "serialization::archive"
input_library_version is set to 5

"invalid signature" indicates that file_signature is wrong.

Some info about the archive that you might want to verify:
The platform is big-endian
sizeof(size_t) == 4
sizeof(library_version_type) == 1.
sizeof(int) == 4
sizeof(long) == 4
sizeof(float) == 4
sizeof(double) == 8

In Christ,
Steven Watanabe


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