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

             Bug #: 53214
           Summary: [lto]: ICE: munmap_chunk(): invalid pointer
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: lto
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: vincenzo.innoce...@cern.ch
            Target: x86_64-unknown-linux-gnu


when __attribute__ added to function

example reduced from real life code

cat ltoCrash.cc
#include<cmath>
struct A {  
double  a(double r, int ) const  __attribute__ ((optimize(3, "fast-math")));
double b;
};

double A::a(double r, int c) const { 
   if (c<0) r = -r; 
   return b/std::sqrt(r);
}
[vocms123] /build/vin/CMSSW_6_0_X_2012-05-03-0200 $ c++ -O2 -flto -fPIC -shared
-o bha.so ltoCrash.cc
*** glibc detected ***
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto1:
munmap_chunk(): invalid pointer: 0x00002b0a9558b308 ***
======= Backtrace: =========
/lib64/libc.so.6(cfree+0x166)[0x3a4f6712f6]
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto1[0x4c263c]
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto1(_Z8lto_mainv+0xeeb)[0x4c544b]
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto1(_Z11toplev_mainiPPc+0xa10)[0x7f9d40]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x3a4f61d994]
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto1[0x4a5f19]
======= Memory map: ========
00400000-01116000 r-xp 00000000 00:15 305728764                         
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto1
01116000-01121000 rw-p 00d16000 00:15 305728764                         
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto1
01121000-0127f000 rw-p 01121000 00:00 0 
06570000-06631000 rw-p 06570000 00:00 0                                  [heap]
3a4f200000-3a4f21c000 r-xp 00000000 08:02 1501774                       
/lib64/ld-2.5.so
3a4f41c000-3a4f41d000 r--p 0001c000 08:02 1501774                       
/lib64/ld-2.5.so
3a4f41d000-3a4f41e000 rw-p 0001d000 08:02 1501774                       
/lib64/ld-2.5.so
3a4f600000-3a4f74d000 r-xp 00000000 08:02 1501777                       
/lib64/libc-2.5.so
3a4f74d000-3a4f94d000 ---p 0014d000 08:02 1501777                       
/lib64/libc-2.5.so
3a4f94d000-3a4f951000 r--p 0014d000 08:02 1501777                       
/lib64/libc-2.5.so
3a4f951000-3a4f952000 rw-p 00151000 08:02 1501777                       
/lib64/libc-2.5.so
3a4f952000-3a4f957000 rw-p 3a4f952000 00:00 0 
3a4fa00000-3a4fa02000 r-xp 00000000 08:02 1501779                       
/lib64/libdl-2.5.so
3a4fa02000-3a4fc02000 ---p 00002000 08:02 1501779                       
/lib64/libdl-2.5.so
3a4fc02000-3a4fc03000 r--p 00002000 08:02 1501779                       
/lib64/libdl-2.5.so
3a4fc03000-3a4fc04000 rw-p 00003000 08:02 1501779                       
/lib64/libdl-2.5.so
3a50200000-3a50282000 r-xp 00000000 08:02 1501780                       
/lib64/libm-2.5.so
3a50282000-3a50481000 ---p 00082000 08:02 1501780                       
/lib64/libm-2.5.so
3a50481000-3a50482000 r--p 00081000 08:02 1501780                       
/lib64/libm-2.5.so
3a50482000-3a50483000 rw-p 00082000 08:02 1501780                       
/lib64/libm-2.5.so
2b0a9414d000-2b0a9414f000 rw-p 2b0a9414d000 00:00 0 
2b0a9414f000-2b0a945b2000 r-xp 00000000 00:15 1062144158                
/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0/lib/libppl_c.so.4.0.0
2b0a945b2000-2b0a947b1000 ---p 00463000 00:15 1062144158                
/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0/lib/libppl_c.so.4.0.0
2b0a947b1000-2b0a947b7000 rw-p 00462000 00:15 1062144158                
/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0/lib/libppl_c.so.4.0.0
2b0a947b7000-2b0a948db000 r-xp 00000000 00:15 1062144152                
/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0/lib/libppl.so.10.0.0
2b0a948db000-2b0a94adb000 ---p 00124000 00:15 1062144152                
/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0/lib/libppl.so.10.0.0
2b0a94adb000-2b0a94ade000 rw-p 00124000 00:15 1062144152                
/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0/lib/libppl.so.10.0.0
2b0a94ade000-2b0a94ae3000 rw-p 2b0a94ade000 00:00 0 
2b0a94ae3000-2b0a94ae7000 r-xp 00000000 00:15 1062144128                
/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0/lib/libgmpxx.so.4.2.2
2b0a94ae7000-2b0a94ce6000 ---p 00004000 00:15 1062144128                
/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0/lib/libgmpxx.so.4.2.2
2b0a94ce6000-2b0a94ce7000 rw-p 00003000 00:15 1062144128                
/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0/lib/libgmpxx.so.4.2.2
2b0a94ce7000-2b0a94d37000 r-xp 00000000 00:15 1062144144                
/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0/lib/libmpfr.so.4.0.1
2b0a94d37000-2b0a94f37000 ---p 00050000 00:15 1062144144                
/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0/lib/libmpfr.so.4.0.1
2b0a94f37000-2b0a94f39000 rw-p 00050000 00:15 1062144144                
/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0/lib/libmpfr.so.4.0.1
2b0a94f39000-2b0a94f9c000 r-xp 00000000 00:15 1062144122                
/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0/lib/libgmp.so.10.0.2
2b0a94f9c000-2b0a9519b000 ---p 00063000 00:15 1062144122                
/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0/lib/libgmp.so.10.0.2
2b0a9519b000-2b0a951a4000 rw-p 00062000 00:15 1062144122                
/afs/cern.ch/cms/slc5_amd64_gcc470/external/gcc/4.7.0/lib/libgmp.so.10.0.2
2b0a951a4000-2b0a951a6000 rw-p 2b0a951a4000 00:00 0 
2b0a951a6000-2b0a95294000 r-xp 00000000 00:15 305729518                 
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/lib64/libstdc++.so.6.0.17
2b0a95294000-2b0a95295000 ---p 000ee000 00:15 305729518                 
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/lib64/libstdc++.so.6.0.17
2b0a95295000-2b0a9529d000 r--p 000ee000 00:15 305729518                 
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/lib64/libstdc++.so.6.0.17
2b0a9529d000-2b0a952a0000 rw-p 000f6000 00:15 305729518                 
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/lib64/libstdc++.so.6.0.17
2b0a952a0000-2b0a952b5000 rw-p 2b0a952a0000 00:00 0 
2b0a952b5000-2b0a952ca000 r-xp 00000000 00:15 305727650                 
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/lib64/libgcc_s.so.1
2b0a952ca000-2b0a952cb000 rw-p 00015000 00:15 305727650                 
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/lib64/libgcc_s.so.1
2b0a952cb000-2b0a95526000 rw-p 2b0a952cb000 00:00 0 
2b0a95526000-2b0a95527000 r--p 00000000 08:03 47644683                  
/tmp/innocent/cc6SeNpx.ltrans0.o
2b0a95527000-2b0a9558b000 rw-p 2b0a95527000 00:00 0 
2b0a9558b000-2b0a9558c000 r--p 00000000 08:03 47644683                  
/tmp/innocent/cc6SeNpx.ltrans0.o
7fff47884000-7fff4789d000 rw-p 7ffffffe5000 00:00 0                     
[stack]
7fff478b2000-7fff478b5000 r-xp 7fff478b2000 00:00 0                      [vdso]
ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0                 
[vsyscall]
In member function 'a':
lto1: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: c++ returned 1 exit status
collect2: error: lto-wrapper returned 1 exit status


 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.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --enable-languages=c,c++,fortran
--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
Thread model: posix
gcc version 4.8.0 20120501 (experimental) [trunk revision 187020] (GCC)

Reply via email to