Re: RE:Re: [ROOT] RE:2.25.03: STL vector broken

From: Matthew D. Langston (langston@SLAC.stanford.edu)
Date: Tue Nov 28 2000 - 18:00:58 MET


Hi Masaharu,

Thank you for helping me track down this problem.

All of the headers that you told me to look at all appear fine.  I looked at
$ROOOTSYS/cint/stl/vector, $ROOOTSYS/cint/stl/_vector and
$ROOOTSYS/cint/stl/_vector.h.  I have also verified that __MAKECINT__ is not
defined when I experience the problem.

For completeness, I have attached the three headers that I mentioned above
so that you can verify that these are indeed the correct headers for ROOT
2.25.03.  I have also attached the small script called root_vector_bug.C
which demonstrates the error.

Regards, Matt

----- Original Message -----
From: "Masaharu Goto" <MXJ02154@nifty.ne.jp>
To: <langston@SLAC.Stanford.EDU>
Cc: <roottalk@pcroot.cern.ch>
Sent: Monday, November 27, 2000 4:04 AM
Subject: RE:Re: [ROOT] RE:2.25.03: STL vector broken


> Hello Matt,
>
> I am still unable to reproduce the problem, however, I noticed an
> interesting thing.
>
> Error: Can't call vector<const TKey*,__malloc_alloc_template<0> >::size()
>
> If we look carefully, 2nd argument of vector templte is
> __malloc_alloc_template<0>.  This only happens if you include
> $CINTSYSDIR/lib/prec_stl/vector. This header must only be used
> when compiling STL precompiled library. Something is wrong if you
> include this file when you are running ROOT.  You should include
> $ROOTSYS/cint/stl/_vector.h  or  $CINTSYSDIR/stl/_vector.h. Please
> look into $ROOOTSYS/cint/stl/vector or $CINTSYSDIR/stl/vector.
> Macro __MAKECINT__ must not be defined when you interpret macros.
>
> And it is strange that you can instantiate those template. If you
> include $CINTSYSDIR/lib/prec_stl/vector, you shouldn't be able to
> instantiate vector object because default constructor definition
> is missing. It is really strange that , at least, you can instantiate
> it.
>
> I recommend you to check if correct version of STL headers are included.
>
>
> Thank you
> Masaharu Goto
>
>
> >Hi Masaharu,
> >
> >Philippe asked me for the same details.  I have attached the emails hat I
> >sent him, which includes all of the details that reproduce the problem.
> >FYI, I first encountered the problem using ROOT 2.25.03.  However, the
> >problem disappeared in ROOT 2.26.01.
> >
> >Thank you for your help.
> >
> >Regards, Matt
> >
> >> >Hi Masa and ROOT Team,
> >> >
> >> >It appears that std::vector<T> is broken when T is a pointer to a
> >> >non-builtin type.  Here is the output from ROOT 2.25.03 which
> >demonstrates
> >> >the problem:
> >> >
> >> >root [0] #include <vector>
> >> >root [1] vector< const int* > int_cp_list
> >> >root [2] cout << int_cp_list.size();
> >> >root [3] #include <TKey.h>
> >> >root [4] vector< const TKey* > key_cp_list
> >> >root [5] cout << key_cp_list.size();
> >> >Error: Can't call vector<const TKey*,__malloc_alloc_template<0>
>::size()
> >in
>








This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:38 MET