[serialization] gcc 3.4.3 / ld / serialization issue?

Hi, this post belongs to the thread <url:http://lists.boost.org/MailArchives/boost/msg76063.php> but I don't have that thread in my local archive anymore. I face the same problem as Curtis Spencer did. Linking an application built with g++ 3.4.3 against boost_serialization-gcc-mt produces warnings from the linker: g++ -pthread -g -O2 -pthread -o testsuite-LaRed testsuite-LaRed.o ReductionTestdata.o testcase-Testdata.o testcase-Matrix.o testcase-GS.o testcase-LLL.o testcase-BKZ.o testcase-RSR.o -L/home/cludwig/Cxx/gcc3.4/LaRed-0.1-BUILD/src /home/cludwig/Cxx/gcc3.4/LaRed-0.1-BUILD/src/.libs/liblared_ntl.a /home/cludwig/Cxx/gcc3.4/LaRed-0.1-BUILD/src/.libs/liblared.a -lboost_unit_test_framework-gcc-mt -lboost_serialization-gcc-mt -lboost_filesystem-gcc-mt -L/home/cludwig/Cxx/gcc3.4/usr/lib/ -lntl /usr/lib/libgmp.a `.gnu.linkonce.t._ZNK5boost7archive17archive_exception4whatEv' referenced in section `.rodata' of /home/cludwig/Cxx/gcc3.4/usr/lib//libboost_serialization-gcc-mt.a(basic_iarchive.o): defined in discarded section `.gnu.linkonce.t._ZNK5boost7archive17archive_exception4whatEv' of /home/cludwig/Cxx/gcc3.4/usr/lib//libboost_serialization-gcc-mt.a(basic_iarchive.o) (There are similar warnings from basic_text_iprimitive.o and xml_grammar.o. The compiler / Boost configuration are reported at the bottom of this post.) The linker generates an executable anyway and it _seems_ to work. However, I observe infrequent crashes of the application that I don't observe on a machine where I built Boost and the application (without any warnings) with gcc 3.4.2 / ld 2.14.90.0.5. Thus I suspect that the warning is there for a reason and points to the problem causing the crashes. Has anyone an idea what to do about this? I am not sure the problem is caused by the serialization library, but Googling araound I found that it is often exposed by boost_serialization-gcc-mt. There is already a gcc bugreport (PR #16625) w.r.t a similar problem but it seems neither specific to gcc 3.4.3 nor do I see a resolution. Thanks Christoph I built both Boost and my application with gcc 3.4.3: cludwig@cdcNT56:~/Cxx/gcc3.4/LaRed-0.1-BUILD> LC_ALL=C g++ -v Reading specs from /opt/gcc/gcc-3.4.3/lib/gcc/i686-pc-linux-gnu/3.4.3/specs Configured with: ../gcc-3.4.3/configure --prefix=/opt/gcc/gcc-3.4.3 --enable-threads=posix --enable-version-specific-runtime-libs --enable-languages=c,c++ --enable-__cxa_atexit --enable-c-mbchar --enable-libstdcxx-debug --enable-c99 --enable-libstdcxx-pch Thread model: posix gcc version 3.4.3 The linker is: cludwig@cdcNT56:~/Cxx/gcc3.4/LaRed-0.1-BUILD> ld -v GNU ld version 2.15.91.0.2 20040727 (SuSE Linux) Boost was built using the following script: cludwig@cdcNT56:~/Cxx/gcc3.4/LaRed-0.1-BUILD> cat ~/Cxx/boost_1_32_0/build-boost_gcc34.sh #!/bin/bash bjam -d2 --with-pydebug \ --prefix=$HOME/Cxx/gcc3.4/usr \ --builddir=$HOME/Cxx/gcc3.4/boost-1.32.0-build \ -sTOOLS=gcc \ -sBUILD="debug release <threading>multi" \ install bjam -d2 --without-python \ --prefix=$HOME/Cxx/gcc3.4/usr \ --builddir=$HOME/Cxx/gcc3.4/boost-1.32.0-build \ -sTOOLS=gcc \ -sBUILD="debug release <define>BOOST_DISABLE_THREADS <threading>single" \ install -- http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/cludwig.html LiDIA: http://www.informatik.tu-darmstadt.de/TI/LiDIA/Welcome.html

On 5/10/05, Christoph Ludwig <cludwig@cdc.informatik.tu-darmstadt.de> wrote:
The linker generates an executable anyway and it _seems_ to work. However, I observe infrequent crashes of the application that I don't observe on a machine where I built Boost and the application (without any warnings) with gcc 3.4.2 / ld 2.14.90.0.5. Thus I suspect that the warning is there for a reason and points to the problem causing the crashes.
What version of the binutils are you using on the machine where things behave badly? If its not at least as new as 2.14.90.0.5, can you upgrade? Problems like this often stem from binutils bugs in my experience. -- Caleb Epstein caleb dot epstein at gmail dot com

On Tue, May 10, 2005 at 03:54:01PM -0400, Caleb Epstein wrote:
On 5/10/05, Christoph Ludwig <cludwig@cdc.informatik.tu-darmstadt.de> wrote:
The linker generates an executable anyway and it _seems_ to work. However, I observe infrequent crashes of the application that I don't observe on a machine where I built Boost and the application (without any warnings) with gcc 3.4.2 / ld 2.14.90.0.5. Thus I suspect that the warning is there for a reason and points to the problem causing the crashes.
What version of the binutils are you using on the machine where things behave badly?
GNU ld version 2.15.91.0.2 20040727 (SuSE Linux)
If its not at least as new as 2.14.90.0.5, can you upgrade? Problems like this often stem from binutils bugs in my experience.
In the meantime I found that the crashes were not related to the linker warning; I eventually found that I miscalculated some index into a vector which caused the crash. Once I realized that I was able to reproduce the crash on both machines. Nevertheless, the linker warning makes me uneasy... Will the application crash as soon Boost.Serialization needs to throw? If I read the warning correctly then the reference to boost::archive::archive_exception::what() points to nowhere because the linker discarded the corresponding code section. Regards Christoph -- http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/cludwig.html LiDIA: http://www.informatik.tu-darmstadt.de/TI/LiDIA/Welcome.html
participants (2)
-
Caleb Epstein
-
Christoph Ludwig