This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug lto/43581] exception handling broken across shared libraries with -fuse-linker-plugin


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43581

--- Comment #8 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-06-18 12:29:44 UTC ---
I get a segfault if I add -Wl,--icf=all (for gold)

c++ -Wl,-v -g -fno-omit-frame-pointer -pthread -O2 lib.cpp -flto
-ffunction-sections -fPIC -fvisibility-inlines-hidden -shared -Wl,-rpath ./ -o
liblib.so -Wl,-E -Wl,--icf=all
c++ -g -fno-omit-frame-pointer -pthread -O2 main.cpp  -flto -ffunction-sections
-fPIC -fvisibility-inlines-hidden  -Wl,-rpath ./ -Wl,-E  -L ./ -llib
-Wl,--icf=all

Program received signal SIGABRT, Aborted.
0x0000003a4f630285 in raise () from /lib64/libc.so.6
(gdb) where
#0  0x0000003a4f630285 in raise () from /lib64/libc.so.6
#1  0x0000003a4f631d30 in abort () from /lib64/libc.so.6
#2  0x00002aaaaabcd0f0 in read_encoded_value_with_base (encoding=15 '\017',
base=<optimized out>, p=<optimized out>, val=0x7fffffff99b8)
    at ../../../gcc-4.7/libgcc/unwind-pe.h:257
#3  0x00002aaaaabce4c1 in _Unwind_IteratePhdrCallback (info=<optimized out>,
size=<optimized out>, ptr=0x7fffffff9ae0) at
../../../gcc-4.7/libgcc/unwind-dw2-fde-dip.c:402
#4  0x0000003a4f707c77 in dl_iterate_phdr () from /lib64/libc.so.6
#5  0x00002aaaaabce9d2 in _Unwind_Find_FDE (pc=0x2aaaaaab1209,
bases=0x7fffffff9d38) at ../../../gcc-4.7/libgcc/unwind-dw2-fde-dip.c:451
#6  0x00002aaaaabcbeeb in uw_frame_state_for (context=0x7fffffff9c90,
fs=0x7fffffff9d80) at ../../../gcc-4.7/libgcc/unwind-dw2.c:1179
#7  0x00002aaaaabcc9fb in _Unwind_RaiseException (exc=0x403070) at
../../../gcc-4.7/libgcc/unwind.inc:99
#8  0x00002aaaaab17961 in __cxxabiv1::__cxa_throw (obj=0x403090,
tinfo=<optimized out>, dest=<optimized out>) at
../../../../gcc-4.7/libstdc++-v3/libsupc++/eh_throw.cc:78
#9  0x00002aaaaaab120a in libbar () at lib.cpp:6
#10 0x00007fffffffa108 in ?? ()
#11 0x00000000004030c8 in ?? ()
#12 0x0000003a4f952350 in initial () from /lib64/libc.so.6
#13 0x0000003a4f41cbc0 in ?? () from /lib64/ld-linux-x86-64.so.2
#14 0x0000000000000000 in ?? ()

with

c++ -v
Using built-in specs.
COLLECT_GCC=c++
COLLECT_LTO_WRAPPER=/afs/cern.ch/user/i/innocent/w3/gcc47slc5/libexec/gcc/x86_64-unknown-linux-gnu/4.7.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.7/configure --enable-languages=c,c++,lto
--disable-multilib --enable-gold=yes --disable-nls --enable-lto
--with-mpc=/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0
--with-gmp=/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0
--with-mpfr=/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0
--prefix=/afs/cern.ch/user/i/innocent/w3/gcc47slc5
--with-build-time-tools=/build/ge/new-binutils/a/slc5_amd64_gcc470/external/gcc/4.7.0-cms/bin
--with-build-config=bootstrap-lto
Thread model: posix
gcc version 4.7.2 20120615 (prerelease) [gcc-4_7-branch revision 188650] (GCC) 
[vocms123] ~/public/ctest/bugs48/ex43581 $ ld -v
GNU gold (GNU Binutils 2.22.52.20120515) 1.11

same of "vanilla" fedora17
(gdb) run
Starting program: /home/innocent/ctest/bugs48/ex43581/a.out 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGABRT, Aborted.
0x0000003a45635965 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.15-37.fc17.x86_64
libgcc-4.7.0-5.fc17.x86_64 libstdc++-4.7.0-5.fc17.x86_64
(gdb) where
#0  0x0000003a45635965 in raise () from /lib64/libc.so.6
#1  0x0000003a45637118 in abort () from /lib64/libc.so.6
#2  0x0000003a49a101f0 in ?? () from /lib64/libgcc_s.so.1
#3  0x0000003a49a115c1 in ?? () from /lib64/libgcc_s.so.1
#4  0x0000003a4572cf46 in dl_iterate_phdr () from /lib64/libc.so.6
#5  0x0000003a49a11ad2 in _Unwind_Find_FDE () from /lib64/libgcc_s.so.1
#6  0x0000003a49a0efeb in ?? () from /lib64/libgcc_s.so.1
#7  0x0000003a49a0fafb in _Unwind_RaiseException () from /lib64/libgcc_s.so.1
#8  0x0000003a52e5ef41 in __cxa_throw () from /lib64/libstdc++.so.6
#9  0x00007ffff7ffb25a in libbar () at lib.cpp:6
#10 0x00007fffffffe3e8 in ?? ()
#11 0x00000000004030c8 in ?? ()
#12 0x0000003a459b1f40 in ?? () from /lib64/libc.so.6
#13 0x0000000000000000 in ?? ()
(gdb) q
A debugging session is active.

    Inferior 1 [process 6370] will be killed.

Quit anyway? (y or n) y
[innocent@pcphsftkepler ex43581]$ c++ -v
Using built-in specs.
COLLECT_GCC=/bin/c++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.7.0/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --disable-build-with-cxx
--disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin
--enable-initfini-array --enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-ppl --with-cloog --with-tune=generic --with-arch_32=i686
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.7.0 20120507 (Red Hat 4.7.0-5) (GCC) 
[innocent@pcphsftkepler ex43581]$ ld -v
GNU gold (version 2.22.52.0.1-10.fc17 20120131) 1.11


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]