[Serialization] creating an archive fails under GCC-4.6.0

Hi -- I have some code that runs when compiled with GCC-4.2 (on OSX Snow Leopard), but that throws the following error with my fresh compile of 4.6.0: run_features(2872) malloc: *** error for object 0x100502060: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug The line that creates this error is here, on line 24: https://gist.github.com/923262 (Apologies for any egregious code abuses in there, I'm just learning!) In the debugger, it lets me step from that line to the constructor of xml_oarchive (line 114 of xml_oarchive.hpp), and when I try to step any further, I get this: run_features(2885) malloc: *** error for object 0x100501b00: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug Program received signal SIGABRT, Aborted. 0x00007fff871a95d6 in __kill () Could anyone advise me on what I could do to fix this? I really want to be working with GCC 4.6.0 and the boost serialisation libraries. Incidentally, I reinstalled boost after I installed the latest GCC (with homebrew), and I'd set cc, gcc, and g++ symlinks to GCC-4.6.0 before I did that, so boost should be compiled with the latest. Thanks very much for any & all assistance. Doug.

typedef std::vector<char> buffer_type; buffer_type buffer; // the target buffer for serialization { buffer.reserve (1000); // ensure some minimal capacity depending of
Hi doug,
I don't kwow how to use a string (and a stringstream
as the target of serialization). I use plain std::vector<char>
as memory buffer, both for text/XML archives and binary archives.
Here are typical bits I use :
the expected size of the archive
// Archiving is redirected to the buffer:
namespace io = boost::iostreams;
io::stream
Hi -- I have some code that runs when compiled with GCC-4.2 (on OSX Snow Leopard), but that throws the following error with my fresh compile of 4.6.0: run_features(2872) malloc: *** error for object 0x100502060: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug
The line that creates this error is here, on line 24: https://gist.github.com/923262 (Apologies for any egregious code abuses in there, I'm just learning!) In the debugger, it lets me step from that line to the constructor of xml_oarchive (line 114 of xml_oarchive.hpp), and when I try to step any further, I get this: run_features(2885) malloc: *** error for object 0x100501b00: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug
Program received signal SIGABRT, Aborted. 0x00007fff871a95d6 in __kill ()
Could anyone advise me on what I could do to fix this? I really want to be working with GCC 4.6.0 and the boost serialisation libraries. Incidentally, I reinstalled boost after I installed the latest GCC (with homebrew), and I'd set cc, gcc, and g++ symlinks to GCC-4.6.0 before I did that, so boost should be compiled with the latest. Thanks very much for any & all assistance. Doug. ------------------------------------------------------------------------
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- François Mauger Groupe "Interactions Fondamentales et Nature du Neutrino" NEMO-3/SuperNEMO Collaboration LPC Caen-CNRS/IN2P3-UCBN-ENSICAEN Département de Physique -- Université de Caen Basse-Normandie Adresse/address: Laboratoire de Physique Corpusculaire de Caen (UMR 6534) ENSICAEN 6, Boulevard du Marechal Juin 14050 CAEN Cedex FRANCE Courriel/e-mail: mauger@lpccaen.in2p3.fr Tél./phone: 02 31 45 25 12 / (+33) 2 31 45 25 12 Fax: 02 31 45 25 49 / (+33) 2 31 45 25 49

There's a hint that maybe I should have compiled GCC with
--enable-fully-dynamic-string from the GCC forum.
Looks like a recompile and reinstall could be in my future! :(
Thanks very much for your replies -- I'll star this message & remember
to update it when I know whether it worked or not.
On 18 April 2011 17:16, Robert Ramey
François Mauger wrote:
Hi doug,
I don't kwow how to use a string (and a stringstream as the target of serialization).
I believe that some of the examples and tests do this. Youmight want to look there.
Robert Ramey
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
doug livesey
-
François Mauger
-
Robert Ramey