[serialization 1_36_0] : Binary Archive portability between 32 and 64 bits platforms...
Now i'm even more sure the issue come from the 32 bits 64 bit point... See attached the HEX view of the same object kind serialized on a binary archive under a 32 bits and a 64 bits platform... (resp Vista and Ubuntu 8.04) Anything that i can configure to avoid that behaviour ? Any work arounds ? regards, Mathieu -- http://www.incub.net/
Mathieu Peyréga [mathieu.peyrega@orange.fr] wrote:
I'm wondering if a binary archive generated on a 32 bits platform would be readable on a 64 bits one... My guess is no... because i am facing an issue i strongly suspect to come from there...
Any clues ?
I got a basic_string::resize exception evene before trying to call the serialize method... just doing :
std::ifstream fichier(filename.c_str(),std::ios::binary); boost::archive::binary_iarchive archive(fichier);
the second line causes the exception...
Now i'm even more sure the issue come from the 32 bits 64 bit point... See attached the HEX view of the same object kind serialized on a binary archive under a 32 bits and a 64 bits platform... (resp Vista and Ubuntu 8.04)
Anything that i can configure to avoid that behaviour ? Any work arounds ?
Hello Mathieu, binary archives are platform dependent by design so your application _must_ fail. Either you use xml or text archives from boost::serialization or you grab one of the portable binary archives that are around. Currently there are two implementations I know of: one to be included in some future version of boost::serialization and one that was written by me. The first you can get from the trunk or the authors website I guess, the latter you can download from the boost vault (http://www.boostpro.com/vault/). If you're willing to experiment a bit, I'd be happy to provide help in testing my implementation on your platform. It has been tested for different endianness and boost versions 1.33 to 1.34. Regards, -- Christian Pfligersdorffer Software Engineering http://www.eos.info
Hello, thank you for your answer... I've dowloaded the portable binary archive on the link you provided, I did not found the other impementation you are talking about... any links or sources ? I check on the SVN, and tried a little googling with no success to a download link... I'll try your implementation soon and let you know. Regards, Mathieu -- http://www.incub.net/ I'll try it soon and let you know !
Hello Mathieu,
binary archives are platform dependent by design so your application _must_ fail. Either you use xml or text archives from boost::serialization or you grab one of the portable binary archives that are around. Currently there are two implementations I know of: one to be included in some future version of boost::serialization and one that was written by me. The first you can get from the trunk or the authors website I guess, the latter you can download from the boost vault (http://www.boostpro.com/vault/).
If you're willing to experiment a bit, I'd be happy to provide help in testing my implementation on your platform. It has been tested for different endianness and boost versions 1.33 to 1.34.
Regards,
participants (2)
-
Mathieu Peyréga
-
Pfligersdorffer, Christian