
Steven, I was able to compile and run my app on Windows 7. Debugging using Visual Studio 2008 and using Boost 1.43.0 with the patch from https://svn.boost.org/trac/boost/ticket/4257 The value of l at line 56 of boost/archive/impl/basic_binary_archive.ipp is I = 369098752; file_signature = "" Line 56: if(l == std::strlen(BOOST_ARCHIVE_SIGNATURE())) { Fails! Line 70: if(file_signature != BOOST_ARCHIVE_SIGNATURE()) is true so, the archive_exception::invalid_signature is thrown on line 73. On my Window 7 PC, sizeof(size_t) == 4 sizeof(library_version_type) could not find definition of library_version_type sizeof(int) == 4 sizeof(long) == 4 sizeof(float) == 4 sizeof(double) == 8 Thanks, Robert
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Steven Watanabe Sent: Tuesday, June 15, 2010 8:41 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] [Serialization] Sometimes Fails Reading Binary File
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 mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users