Boost logo

Boost :

Subject: Re: [boost] Boost 1_41 Binary archive exceptions
From: Yuriy Zubritsky (mt.wizard_at_[hidden])
Date: 2011-12-29 05:23:04


Is any of your fields (A, B, C) have type [unsigned] long or size_t ?
These types are 32-bit in 32-bit gcc and 64-bit in 64-bit one, so it reads
completely different values

If you are reading with 64-bit application files that are created in 32-bit
one then that's the problem.

2011/12/29 KARAN <msree80_at_[hidden]>

> I am porting from Linux 32 bit to 64 Bit(x86_64)(Boost Version :1_41). I am
> facing an Binary archive exceptions mainly
> (std::bad_alloc,St12length_error-basic_string::resize).
>
> There are no exception during the file saving, but when I do a restore I am
> facing the above exceptions.
> The same works very well if I change it to text archives. How can I make it
> work with binary files?
>
> The exception is happening in the below code block .Any comments please
> template<class Archive>
> void Serialise (Archive & aArchive, const unsigned int aVersion=0)
> {
>
> aArchive & this->A;
> aArchive & this->B;
> aArchive & this->C
> this->p.Serialise(aArchive, aVersion);
>
> }
>
> --
> View this message in context:
> http://boost.2283326.n4.nabble.com/Boost-1-41-Binary-archive-exceptions-tp4242318p4242318.html
> Sent from the Boost - Dev mailing list archive at Nabble.com.
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk