|
Boost Users : |
Subject: Re: [Boost-users] [OT] Problem with boost archive. Cannot solve in anyway.
From: Christopher Jefferson (chris_at_[hidden])
Date: 2010-09-22 13:30:31
On 22 Sep 2010, at 15:25, Robert Ramey wrote:
>
> Paul Graphov wrote:
>> I had a problem with 1.44 binary archive thowing bad_allocs and
>> stream_errors:
>>
>> http://groups.google.com/group/boost-list/browse_thread/thread/8a871c336554c317/228acd2bf0c7e9eb?pli=1
>>
>> The same code worked fine if I switched to boost-1.43 or to
>> text_archive or just compiled on Fedora box instead of Ubuntu one...
>>
>
> Note: I have another project which is hung up on a bug with the gcc
> compiler on Ubuntu.
> (Ubuntu bug # 629092). I've been unable to get anyone to take it seriously
> though.
> The bug is sufficiently fundamental that I wouldn't expect the serialization
> library to work on that platform.
There is no bug in the compiler, your program is faulty. The problem is that you are including <stdio.h>, which includes <sys/types.h> in main.c before defining #define _FILE_OFFSET_BITS 64. The second include in TESTRIO is then ignored. This leads to inconsistent definitions of structures in the two different files and a seg fault.
You can either:
1) put #define _FILE_OFFSET_BITS 64 at the top of main.c
2) include "testrio.h" before <stdio.h> in main.c
either of these fix your problem.
Chris
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