Boost serialization w/gcc 3.2.3 on CentOS 4.4?

We've got an in-house infrastructure that uses the boost::serialization library (from boost 1.33). Thus far, all our development has been done using gcc 3.4.5 and 3.4.6 on CentOS 4.3 and 4.4 (respectively). (Note that CentOS is practically the same as Red Hat Enterprise Linux.) Now we are forced to integrate with a 3rd party proprietary library that was built with gcc 3.2. So I installed the gcc32 package: % gcc32 --version gcc32 (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-47.3) Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. If I build my program with gcc 3.2 and link against boost built with gcc 3.4, my program segfaults as soon as the first boot::serialization method is called. So I tried to rebuild boost using gcc 3.2. I did this by running the configure script, then modifying the "BJAM_CONFIG" variable of the top-level Makefile: BJAM_CONFIG= -sPYTHON_ROOT=/usr -sPYTHON_VERSION=2.3 \ -sGXX=g++32 -sGCC=gcc32 Then I ran make. First thing I noticed is that there were a *lot* of warnings, although the library did build. Same thing when building my own program: lots of warnings surrounding the boost stuff, but it does build. Also, when linking, I get this warning: /usr/bin/ld: warning: libstdc++.so.6, needed by /usr/local/lib/libboost_serialization-gcc.so, may conflict with libstdc++.so.5 Unfortunately, the program still crashes when it gets to the boost::serialization stuff. I looked at the Boost compatibility matrix, and as far as I can tell, gcc 3.2 is supported (though I definitely could have misread something!). So my hunch is that I've got a problem with my build process... but I'm not sure where. I know I've left out some details; please let me know what other info I need to provide. Suggestions or general "things to try" are welcome as well! Thanks, Matt

This warning means you have some code built with gcc 3.4+ and some
code built with gcc earlier than gcc 3.4. This will invariably cause
your code to crash:
/usr/bin/ld: warning: libstdc++.so.6, needed by
/usr/local/lib/libboost_serialization-gcc.so, may conflict with
libstdc++.so.5
You need to rebuild all of your code to link against the same libstdc++ library.
Chris
On 4/26/07, matthew.garman@gmail.com
We've got an in-house infrastructure that uses the boost::serialization library (from boost 1.33). Thus far, all our development has been done using gcc 3.4.5 and 3.4.6 on CentOS 4.3 and 4.4 (respectively). (Note that CentOS is practically the same as Red Hat Enterprise Linux.)
Now we are forced to integrate with a 3rd party proprietary library that was built with gcc 3.2. So I installed the gcc32 package:
% gcc32 --version gcc32 (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-47.3) Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If I build my program with gcc 3.2 and link against boost built with gcc 3.4, my program segfaults as soon as the first boot::serialization method is called.
So I tried to rebuild boost using gcc 3.2. I did this by running the configure script, then modifying the "BJAM_CONFIG" variable of the top-level Makefile:
BJAM_CONFIG= -sPYTHON_ROOT=/usr -sPYTHON_VERSION=2.3 \ -sGXX=g++32 -sGCC=gcc32
Then I ran make. First thing I noticed is that there were a *lot* of warnings, although the library did build. Same thing when building my own program: lots of warnings surrounding the boost stuff, but it does build. Also, when linking, I get this warning:
/usr/bin/ld: warning: libstdc++.so.6, needed by /usr/local/lib/libboost_serialization-gcc.so, may conflict with libstdc++.so.5
Unfortunately, the program still crashes when it gets to the boost::serialization stuff.
I looked at the Boost compatibility matrix, and as far as I can tell, gcc 3.2 is supported (though I definitely could have misread something!). So my hunch is that I've got a problem with my build process... but I'm not sure where.
I know I've left out some details; please let me know what other info I need to provide. Suggestions or general "things to try" are welcome as well!
Thanks, Matt
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

On Thu, Apr 26, 2007 at 05:30:26PM -0400, Chris Weed wrote:
This warning means you have some code built with gcc 3.4+ and some code built with gcc earlier than gcc 3.4. This will invariably cause your code to crash:
/usr/bin/ld: warning: libstdc++.so.6, needed by /usr/local/lib/libboost_serialization-gcc.so, may conflict with libstdc++.so.5
You need to rebuild all of your code to link against the same libstdc++ library.
Hi,
I fixed the above problem (I was still pulling in the 3.4 build of
boost). Now I'm correctly pulling in only stuff built with gcc32
(ldd confirmed this).
But the program still segfaults. Here's an excerpt from the gdb
back trace after a crash. Basically, everything prior to #32 is our
own code, and #32 is where the boost serialization code is first
referenced. (I can certainly post the whole backtrace, just trying
to be concise.) Note "MyClass" is the name of our custom class that
uses boost::serialization:
[ ... ]
#27 0x08089912 in boost::archive::detail::load_non_pointer_type

I am not a serialization guru, but I think someone could help you if
you can you post a simple example of your code that can reproduce the
crash with the full stack trace?
Chris
On 4/26/07, matthew.garman@gmail.com
On Thu, Apr 26, 2007 at 05:30:26PM -0400, Chris Weed wrote:
This warning means you have some code built with gcc 3.4+ and some code built with gcc earlier than gcc 3.4. This will invariably cause your code to crash:
/usr/bin/ld: warning: libstdc++.so.6, needed by /usr/local/lib/libboost_serialization-gcc.so, may conflict with libstdc++.so.5
You need to rebuild all of your code to link against the same libstdc++ library.
Hi,
I fixed the above problem (I was still pulling in the 3.4 build of boost). Now I'm correctly pulling in only stuff built with gcc32 (ldd confirmed this).
But the program still segfaults. Here's an excerpt from the gdb back trace after a crash. Basically, everything prior to #32 is our own code, and #32 is where the boost serialization code is first referenced. (I can certainly post the whole backtrace, just trying to be concise.) Note "MyClass" is the name of our custom class that uses boost::serialization:
[ ... ] #27 0x08089912 in boost::archive::detail::load_non_pointer_type
::load_standard::invoke (ar=@0xf5bd6140, t=@0x81459f0) at /.../include/boost-1_33_1/boost/archive/detail/iserializer.hpp:375 #28 0x08089776 in boost::archive::detail::load_non_pointer_type ::invoke (ar=@0xf5bd6140, t=@0x81459f0) at /.../include/boost-1_33_1/boost/archive/detail/iserializer.hpp:425 #29 0x0808960a in load (ar=@0xf5bd6140, t=@0x81459f0) at /.../include/boost-1_33_1/boost/archive/detail/iserializer.hpp:572 #30 0x0808944f in load_override<MyClass> (this=0xf5bd6140, t=@0x81459f0) at /.../include/boost-1_33_1/boost/archive/basic_binary_iarchive.hpp:70 #31 0x08089092 in load_override<MyClass> (this=0xf5bd6140, t=@0x81459f0) at /.../include/boost-1_33_1/boost/archive/binary_iarchive.hpp:47 #32 0x0808899d in operator>><MyClass> (this=0xf5bd6140, t=@0x81459f0) at /.../include/boost-1_33_1/boost/archive/detail/interface_iarchive.hpp:76 [ ... ] Thanks again, Matt
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

On Thu, Apr 26, 2007 at 10:55:08PM -0400, Chris Weed wrote:
I am not a serialization guru, but I think someone could help you if you can you post a simple example of your code that can reproduce the crash with the full stack trace?
Wouldn't ya know it... when I pull the code out and create a test program, it doesn't crash! I guess I'll just keep plugging away at it for now, unless anyone has any other suggestions. Thanks again, Matt

On Thu, Apr 26, 2007 at 10:55:08PM -0400, Chris Weed wrote:
I am not a serialization guru, but I think someone could help you if you can you post a simple example of your code that can reproduce the crash with the full stack trace?
I dug a little deeper and found that the crash was due to an unhandled exception. The exception comes during the restoring of serialized data. The exception.what() is "integer cannot be represented". Anyone have any ideas what would cause this exception to be thrown? Or an idea of where I can look to start to diagnose the problem? Thanks again, matt

2007/4/27, matthew.garman@gmail.com
The exception comes during the restoring of serialized data. The exception.what() is "integer cannot be represented".
Anyone have any ideas what would cause this exception to be thrown? Or an idea of where I can look to start to diagnose the problem?
Usually the debuggers (eg. GDB) have options to break at every exception generation, this way is really simple to see line of code where exception was generated and program status. -- Alberto Ingenito

Re: having troubles with boost serialization/archive with gcc 3.2. On Sun, Apr 29, 2007 at 09:28:11AM +0200, Alberto wrote:
Usually the debuggers (eg. GDB) have options to break at every exception generation, this way is really simple to see line of code where exception was generated and program status.
Well, I have found one problem: gcc has a bug with its ostringstream::tellp() function in versions prior to 3.4: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10975 We were using that function, and it was definitely causing problems. But with a workaround in place, we're still seeing the crashes. The real problem is that boost is generating an exception. We are using portable_binary_[io]archive.hpp from the libs/serialization/example directory (in the boost 1.33 distribution). Near line 67 of portable_binary_iarchive.cpp, there's a check. If the check fails, then it throws the portable_binary_archive_exception(). I don't really understand the code at this point, particularly how istream::get() is used. Thanks again, Matt

matthew.garman@gmail.com wrote:
Re: having troubles with boost serialization/archive with gcc 3.2.
On Sun, Apr 29, 2007 at 09:28:11AM +0200, Alberto wrote:
Usually the debuggers (eg. GDB) have options to break at every exception generation, this way is really simple to see line of code where exception was generated and program status.
Well, I have found one problem: gcc has a bug with its ostringstream::tellp() function in versions prior to 3.4:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10975
We were using that function, and it was definitely causing problems. But with a workaround in place, we're still seeing the crashes.
The real problem is that boost is generating an exception. We are using portable_binary_[io]archive.hpp from the libs/serialization/example directory (in the boost 1.33 distribution).
Near line 67 of portable_binary_iarchive.cpp, there's a check. If the check fails, then it throws the portable_binary_archive_exception().
I don't really understand the code at this point, particularly how istream::get() is used.
Thanks again, Matt

Hey, just a heads up that gcc 3.2 is a no-go with boost serialization. The distributed tests pass but seemingly regular code just doesn't work (but works in vc7/8, gcc 3.4+ and SunCC 11 (with stlport4) ) -----Original Message----- From: boost-users-bounces@lists.boost.org on behalf of Robert Ramey Sent: Thu 5/3/2007 6:56 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Boost serialization w/gcc 3.2.3 on CentOS 4.4? matthew.garman@gmail.com wrote:
Re: having troubles with boost serialization/archive with gcc 3.2.
On Sun, Apr 29, 2007 at 09:28:11AM +0200, Alberto wrote:
Usually the debuggers (eg. GDB) have options to break at every exception generation, this way is really simple to see line of code where exception was generated and program status.
Well, I have found one problem: gcc has a bug with its ostringstream::tellp() function in versions prior to 3.4:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10975
We were using that function, and it was definitely causing problems. But with a workaround in place, we're still seeing the crashes.
The real problem is that boost is generating an exception. We are using portable_binary_[io]archive.hpp from the libs/serialization/example directory (in the boost 1.33 distribution).
Near line 67 of portable_binary_iarchive.cpp, there's a check. If the check fails, then it throws the portable_binary_archive_exception().
I don't really understand the code at this point, particularly how istream::get() is used.
Thanks again, Matt
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

On Thu, May 03, 2007 at 07:21:05PM -0700, Sohail Somani wrote:
Hey, just a heads up that gcc 3.2 is a no-go with boost serialization. The distributed tests pass but seemingly regular code just doesn't work (but works in vc7/8, gcc 3.4+ and SunCC 11 (with stlport4) )
Do you have any more detailed information regarding this? Of course I have googled on this, but couldn't find such specific information. Thanks again, Matt

Not any official of course, http://tinyurl.com/yrynkk doesn't work. I had no requirement to stick with that compiler so I didn't. If you figure out the issue with it, let me know :-) I compared that file to the serialization tests and they looked similar so I was pretty lost. -----Original Message----- From: boost-users-bounces@lists.boost.org on behalf of matthew.garman@gmail.com Sent: Fri 5/4/2007 5:26 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Boost serialization w/gcc 3.2.3 on CentOS 4.4? On Thu, May 03, 2007 at 07:21:05PM -0700, Sohail Somani wrote:
Hey, just a heads up that gcc 3.2 is a no-go with boost serialization. The distributed tests pass but seemingly regular code just doesn't work (but works in vc7/8, gcc 3.4+ and SunCC 11 (with stlport4) )
Do you have any more detailed information regarding this? Of course I have googled on this, but couldn't find such specific information. Thanks again, Matt _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Note that I test hear with gcc 3.3. Also, if you've determined that stream i/o has some issue with gcc 3.2 - that could/would cause a ripple into boost serialization. Robert Ramey matthew.garman@gmail.com wrote:
On Thu, May 03, 2007 at 07:21:05PM -0700, Sohail Somani wrote:
Hey, just a heads up that gcc 3.2 is a no-go with boost serialization. The distributed tests pass but seemingly regular code just doesn't work (but works in vc7/8, gcc 3.4+ and SunCC 11 (with stlport4) )
Do you have any more detailed information regarding this?
Of course I have googled on this, but couldn't find such specific information.
Thanks again, Matt
participants (5)
-
Alberto
-
Chris Weed
-
matthew.garman@gmail.com
-
Robert Ramey
-
Sohail Somani