public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/53746] New: [lto] segfault in  std::vector::__base_ctor
@ 2012-06-21 16:57 vincenzo.innocente at cern dot ch
  2012-06-21 17:13 ` [Bug lto/53746] " markus at trippelsdorf dot de
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-06-21 16:57 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53746
           Summary: [lto] segfault in  std::vector::__base_ctor
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vincenzo.innocente@cern.ch


this is a place holder pending the production of a "reasonable size" test-case

I have a library (just one out of 2000!) in which I get a segfault at runtime
in constructing a vector (data member of class).
the library is made out of 10 compilation units

from the stack trace below it seems that a "0" pointer is passed as "target" of
a memmove

the code involved (main + "host"-constructor) is few lines long BUT
the difficulty in reducing the whole library in a test-case is that it works
with -flto-partition=1to1
if I "cat" all 10 compilation units in a single one
if I delete 5 of the compilation units (almost at random, besides the one
containing the code where the crash occurs)
if I ADD the following trivial compilation unit (not sure the content
matters...)
cat a1.cc 
#include <vector>
std::vector<int> a1(std::vector<int> v, int a) {
  v.push_back(a); return v;
}

so to reproduce the crash a "lot" of other code need to be present and in a
given configuration 
I'll try at least to reduce the dependencies from external libraries, still it
will take time.

any suggesting on how to proceed in the debug process (or involve any of you)
is appreciated

"segfault"

Breakpoint 2, 0x0000003a4f679580 in memmove () from /lib64/libc.so.6
#0  0x0000003a4f679580 in memmove () from /lib64/libc.so.6
#1  0x00002aaaaaac3b89 in __copy_m (__result=0x0, __last=<optimized out>,
__first=0xfbc000)
    at
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/stl_algobase.h:366
#2  std::vector::__base_ctor (this=0xfbc238, __x=<optimized out>)
    at
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/stl_algobase.h:384
#3  0x00002aaaaaad619a in HybridClusterAlgo::HybridClusterAlgo (this=0xfbc100,
eb_str=<optimized out>, step=<optimized out>, ethres=<optimized out>,
eseed=<optimized out>, xi=<optimized out>, 
    useEtForXi=<optimized out>, ewing=<optimized out>, v_chstatus=<optimized
out>, posCalculator=..., dynamicEThres=<optimized out>, eThresA=<optimized
out>, eThresB=<optimized out>, 
    severityToExclude=..., excludeFromCluster=false) at
/build/vin/bug/CMSSW_6_0_0_pre7/src/RecoEcal/EgammaClusterAlgos/src/HybridClusterAlgo.cc:38
#4  0x0000000000404f8b in main (s=<optimized out>) at
/build/vin/bug/CMSSW_6_0_0_pre7/src/RecoEcal/EgammaClusterAlgos/test/HybridClusterTest.cpp:63

"runs"

Breakpoint 2, 0x0000003a4f679580 in memmove () from /lib64/libc.so.6
#0  0x0000003a4f679580 in memmove () from /lib64/libc.so.6
#1  0x00002aaaaaabe0e5 in std::__copy_move<false, true,
std::random_access_iterator_tag>::__copy_m<int> (__first=<optimized out>,
__last=<optimized out>, __result=0xfbc2b0)
    at
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/stl_algobase.h:366
#2  0x00002aaaaaac699c in std::vector::__base_ctor (this=0xfbc238, __x=...)
    at
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/stl_algobase.h:384
#3  0x00002aaaaaad740a in HybridClusterAlgo::HybridClusterAlgo (this=0xfbc100,
eb_str=<optimized out>, step=<optimized out>, ethres=<optimized out>,
eseed=<optimized out>, xi=<optimized out>, 
    useEtForXi=<optimized out>, ewing=<optimized out>, v_chstatus=<optimized
out>, posCalculator=..., dynamicEThres=<optimized out>, eThresA=<optimized
out>, eThresB=<optimized out>, severityToExclude=..., 
    excludeFromCluster=false) at
/build/vin/bug/CMSSW_6_0_0_pre7/src/RecoEcal/EgammaClusterAlgos/src/HybridClusterAlgo.cc:38
#4  0x0000000000404f8b in main (s=<optimized out>) at
/build/vin/bug/CMSSW_6_0_0_pre7/src/RecoEcal/EgammaClusterAlgos/test/HybridClusterTest.cpp:63


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug lto/53746] [lto] segfault in  std::vector::__base_ctor
  2012-06-21 16:57 [Bug lto/53746] New: [lto] segfault in std::vector::__base_ctor vincenzo.innocente at cern dot ch
@ 2012-06-21 17:13 ` markus at trippelsdorf dot de
  2012-06-23  9:06 ` [Bug lto/53746] [lto] segfault in std::vector::__base_ctor (with -fno-math-errno -fipa-pta) vincenzo.innocente at cern dot ch
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: markus at trippelsdorf dot de @ 2012-06-21 17:13 UTC (permalink / raw)
  To: gcc-bugs

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

Markus Trippelsdorf <markus at trippelsdorf dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markus at trippelsdorf dot
                   |                            |de

--- Comment #1 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-06-21 17:12:52 UTC ---
Just in case you haven't read it already.
 http://gcc.gnu.org/wiki/A_guide_to_testcase_reduction#Reducing_LTO_bugs
might be helpful.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug lto/53746] [lto] segfault in  std::vector::__base_ctor (with -fno-math-errno -fipa-pta)
  2012-06-21 16:57 [Bug lto/53746] New: [lto] segfault in std::vector::__base_ctor vincenzo.innocente at cern dot ch
  2012-06-21 17:13 ` [Bug lto/53746] " markus at trippelsdorf dot de
@ 2012-06-23  9:06 ` vincenzo.innocente at cern dot ch
  2012-06-23  9:37 ` [Bug lto/53746] [lto] segfault in std::vector::__base_ctor (with -fno-math-errno -fipa-pta) and ICE with trunk revision 188906 vincenzo.innocente at cern dot ch
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-06-23  9:06 UTC (permalink / raw)
  To: gcc-bugs

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

vincenzo Innocente <vincenzo.innocente at cern dot ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[lto] segfault in           |[lto] segfault in
                   |std::vector::__base_ctor    |std::vector::__base_ctor
                   |                            |(with -fno-math-errno
                   |                            |-fipa-pta)

--- Comment #2 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-06-23 09:06:30 UTC ---
to reproduce the crash 
get the preprocessed files 

wget http://innocent.home.cern.ch/innocent/bugAlgo.tgz
tar -xzf bugAlgo.tgz 
cd bugAlgo/
and run
export CXXGO="c++  -g -fPIC -fno-fat-lto-objects -flto -ffunction-sections -O2
-pipe -std=gnu++11 -msse3 -fvisibility-inlines-hidden -fno-math-errno
-fipa-pta"
echo $CXXGO

for f in *.ii
do
$CXXGO -c $f
done

$CXXGO -Wl,-v stubs.o -shared -o libstubs.so -Wl,-rpath=./ 
$CXXGO -Wl,-v CosmicClusterAlgo.o EndcapPiZeroDiscriminatorAlgo.o
HybridClusterAlgo.o Multi5x5BremRecoveryClusterAlgo.o PreshowerClusterAlgo.o
a1.o  -shared -o libAlgo.so -Wl,-rpath=./ -L./ -lstubs 

$CXXGO -Wl,-v HybridClusterTest.o -Wl,-rpath=./ -L./ -lAlgo -lstubs 
./a.out 1 2

it will instead end correctly if one removed either  -fno-math-errno or
-fipa-pta
or linking just 
$CXXGO -Wl,-v CosmicClusterAlgo.o EndcapPiZeroDiscriminatorAlgo.o
HybridClusterAlgo.o Multi5x5BremRecoveryClusterAlgo.o -shared -o libAlgo.so
-Wl,-rpath=./ -L./ -lstubs 

the main is just invoking a constructor contained in HybridClusterAlgo

the behavior is the same
on vanilla fedora 17,
with 4.7.1, 
with gcc version 4.8.0 20120608


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug lto/53746] [lto] segfault in  std::vector::__base_ctor (with -fno-math-errno -fipa-pta) and ICE with trunk revision 188906
  2012-06-21 16:57 [Bug lto/53746] New: [lto] segfault in std::vector::__base_ctor vincenzo.innocente at cern dot ch
  2012-06-21 17:13 ` [Bug lto/53746] " markus at trippelsdorf dot de
  2012-06-23  9:06 ` [Bug lto/53746] [lto] segfault in std::vector::__base_ctor (with -fno-math-errno -fipa-pta) vincenzo.innocente at cern dot ch
@ 2012-06-23  9:37 ` vincenzo.innocente at cern dot ch
  2012-06-23 10:00 ` [Bug lto/53746] [lto] segfault in std::vector::__base_ctor (with -fipa-pta) vincenzo.innocente at cern dot ch
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-06-23  9:37 UTC (permalink / raw)
  To: gcc-bugs

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

vincenzo Innocente <vincenzo.innocente at cern dot ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[lto] segfault in           |[lto] segfault in
                   |std::vector::__base_ctor    |std::vector::__base_ctor
                   |(with -fno-math-errno       |(with -fno-math-errno
                   |-fipa-pta)                  |-fipa-pta) and ICE with
                   |                            |trunk revision 188906

--- Comment #3 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-06-23 09:37:33 UTC ---
just updated to latest trunk and

$CXXGO -Wl,-v stubs.o -shared -o libstubs.so -Wl,-rpath=./ 
collect2 version 4.8.0 20120623 (experimental) [trunk revision 188906]
/home/innocent/gccDir/bin/ld -plugin
/home/innocent/gccDir/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/liblto_plugin.so
-plugin-opt=/home/innocent/gccDir/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccvCCsbR.res -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s --eh-frame-hdr
-m elf_x86_64 -shared -o libstubs.so /lib/../lib64/crti.o
/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/crtbeginS.o
-L/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0
-L/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64
-L/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../.. -v
stubs.o -rpath=./ -lstdc++ -lm -lgcc_s -lc -lgcc_s
/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/crtendS.o
/lib/../lib64/crtn.o
GNU gold (version 2.22.52.0.1-10.fc17 20120131) 1.11
lto1: internal compiler error: in lhd_decl_printable_name, at langhooks.c:222
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
/home/innocent/gccDir/bin/ld: fatal error: lto-wrapper failed
collect2: error: ld returned 1 exit status


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug lto/53746] [lto] segfault in  std::vector::__base_ctor (with -fipa-pta)
  2012-06-21 16:57 [Bug lto/53746] New: [lto] segfault in std::vector::__base_ctor vincenzo.innocente at cern dot ch
                   ` (2 preceding siblings ...)
  2012-06-23  9:37 ` [Bug lto/53746] [lto] segfault in std::vector::__base_ctor (with -fno-math-errno -fipa-pta) and ICE with trunk revision 188906 vincenzo.innocente at cern dot ch
@ 2012-06-23 10:00 ` vincenzo.innocente at cern dot ch
  2012-11-01  7:17 ` vincenzo.innocente at cern dot ch
  2021-09-12  7:52 ` [Bug ipa/53746] " pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-06-23 10:00 UTC (permalink / raw)
  To: gcc-bugs

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

vincenzo Innocente <vincenzo.innocente at cern dot ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[lto] segfault in           |[lto] segfault in
                   |std::vector::__base_ctor    |std::vector::__base_ctor
                   |(with -fno-math-errno       |(with -fipa-pta)
                   |-fipa-pta) and ICE with     |
                   |trunk revision 188906       |

--- Comment #4 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-06-23 09:59:58 UTC ---
w/o -g  (which seems to be the cause of the ICE) 
segfault reproduces also with latest trunk revision 188906
with this minimal set of options

export CXXGO="c++ -fPIC -fno-fat-lto-objects -flto -ffunction-sections -O2
-pipe -std=gnu++11 -msse3 -fvisibility-inlines-hidden -fipa-pta"


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug lto/53746] [lto] segfault in  std::vector::__base_ctor (with -fipa-pta)
  2012-06-21 16:57 [Bug lto/53746] New: [lto] segfault in std::vector::__base_ctor vincenzo.innocente at cern dot ch
                   ` (3 preceding siblings ...)
  2012-06-23 10:00 ` [Bug lto/53746] [lto] segfault in std::vector::__base_ctor (with -fipa-pta) vincenzo.innocente at cern dot ch
@ 2012-11-01  7:17 ` vincenzo.innocente at cern dot ch
  2021-09-12  7:52 ` [Bug ipa/53746] " pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-11-01  7:17 UTC (permalink / raw)
  To: gcc-bugs


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

vincenzo Innocente <vincenzo.innocente at cern dot ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.8.0
      Known to fail|                            |4.7.2

--- Comment #5 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-11-01 07:17:01 UTC ---
the problem still persist in 4.7.2
does not happen in 4.8 20121028 (experimental) [trunk revision 192889]
(too many things have changed though)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ipa/53746] [lto] segfault in  std::vector::__base_ctor (with -fipa-pta)
  2012-06-21 16:57 [Bug lto/53746] New: [lto] segfault in std::vector::__base_ctor vincenzo.innocente at cern dot ch
                   ` (4 preceding siblings ...)
  2012-11-01  7:17 ` vincenzo.innocente at cern dot ch
@ 2021-09-12  7:52 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-12  7:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53746

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |lto, wrong-code
          Component|lto                         |ipa
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
IIRC -fipa-pta still needs some fixing for working with LTO.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-12  7:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-21 16:57 [Bug lto/53746] New: [lto] segfault in std::vector::__base_ctor vincenzo.innocente at cern dot ch
2012-06-21 17:13 ` [Bug lto/53746] " markus at trippelsdorf dot de
2012-06-23  9:06 ` [Bug lto/53746] [lto] segfault in std::vector::__base_ctor (with -fno-math-errno -fipa-pta) vincenzo.innocente at cern dot ch
2012-06-23  9:37 ` [Bug lto/53746] [lto] segfault in std::vector::__base_ctor (with -fno-math-errno -fipa-pta) and ICE with trunk revision 188906 vincenzo.innocente at cern dot ch
2012-06-23 10:00 ` [Bug lto/53746] [lto] segfault in std::vector::__base_ctor (with -fipa-pta) vincenzo.innocente at cern dot ch
2012-11-01  7:17 ` vincenzo.innocente at cern dot ch
2021-09-12  7:52 ` [Bug ipa/53746] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).