[ROOT] RE:[Fwd: CINT Problems with STL and rootcin

From: Masaharu Goto (MXJ02154@nifty.ne.jp)
Date: Tue Oct 16 2001 - 13:37:05 MEST


Hello Walter,

Sorry for late reply. 

I did't have a chance to fully identify your problem.
However, it looks like this is a problem of global object
initialization order.  .L works because the library is loaded
after all Cint internal variables are initalized. When you 
link the library to ROOT, there can be something wrong with
initialization order.  Please consult Rene and Fons about 
linking your library to ROOT.  I hope they can give you some
hint. 

Thank you
Masaharu Goto



>Date: Mon, 08 Oct 2001 06:46:58 +0000
>From: Rene Brun <Rene.Brun@cern.ch>
>To: rootdev@pcroot.cern.ch
>Subject: [Fwd: CINT Problems with STL and rootcint]
>
>Hi Masa,
>
>Could you investigate this problem? There is a second mail that I will forwar
d
>too.
>
>Rene
>-----------------------------------------------------------------------------
-
--
>Date: Fri, 05 Oct 2001 11:40:55 +0200
>From: "Walter F.J. Mueller" <W.F.J.Mueller@gsi.de>
>To: "Brun, Rene" <Rene.Brun@cern.ch>
>Subject: Problems with STL and rootcint
>
>Dear Rene,
>
>I'm observing a nasty problem when I use STL vector. Situation:
>
> a. I use vector<Int_t> in class foo
> b. I have an argument of type foo* in class foobar.
> c. a .so lib is build under Linux, using root 3.01-06 or 3.02
> d. all works fine if I start the default root and `.L' the libs
> e. if I link a root application against the .so libs, the program
>    hangs in the initialization in G__cpp_setupfoobar(). There seems
>    to be a bad call of G__search_typename2("const_reverse_iterator",...)
>
>I don't understand why foobar has to mess with all the types associated
>with a vector used in foo. And I don't understand why this works after .L
>but fails when the program is linked to the .so libs.
>
>Attached are the headers of
>
>       foo (here TAGmbsEvent)
>       foobar (here TAGmbsIStream)
>       the .cint.cxx files of both.
>
>When I inspect the looping program with gdb I get
>
>#0  0x4057e3c0 in G__isenclosingclass ()
>   from /usr/local/pub/root/301-06/lib/libCint.so.3.01
>#1  0x4057e8c0 in G__defined_tagname ()
>   from /usr/local/pub/root/301-06/lib/libCint.so.3.01
>#2  0x4057ec83 in G__search_tagname ()
>   from /usr/local/pub/root/301-06/lib/libCint.so.3.01
>#3  0x40542dfe in G__get_linked_tagnum ()
>   from /usr/local/pub/root/301-06/lib/libCint.so.3.01
>#4  0x40c78d2b in G__cpp_setup_typetableTAGmbsIStream ()
>    at TAGmbsIStream.cint.cxx:449
>#5  0x40c7947f in G__cpp_setupTAGmbsIStream () at TAGmbsIStream.cint.cxx:588
>#6  0x405341f8 in G__call_setup_funcs ()
>   from /usr/local/pub/root/301-06/lib/libCint.so.3.01
>#7  0x40c79500 in __static_initialization_and_destruction_0 (__initialize_p=1
,
>    __priority=65535) at TAGmbsIStream.cint.cxx:601
>#8  0x40c7954a in global constructors keyed to operator>> ()
>    at TAGmbsEvent.hxx:55
>#9  0x40c83067 in __do_global_ctors_aux () at TAGmbsEvent.hxx:55
>#10 0x40c716ca in _init () from /u/mueller/s254/anal/lib/libTAGbase.so.1  
>
>where TAGmbsIStream.cint.cxx:449 reads
>  
>G__search_typename2("const_reverse_iterator",117,G__get_linked_tagnum(&G__TAG
m
bsIStreamLN_vectorlEintcO__malloc_alloc_templatelE0gRsPgRcLcLreverse_iterator)
,
0,G__get_linked_tagnum(&G__TAGmbsIStreamLN_vectorlEintcO__malloc_alloc_templat
e
lE0gRsPgR));
>
>
>                       With best regards,
>
>                               Walter
>
>--
>Walter F.J. Mueller   Mail:  W.F.J.Mueller@gsi.de
>GSI,  Abteilung KP3   Phone: +49-6159-71-2766
>D-64291 Darmstadt     FAX:   +49-6159-71-2989
>WWW:   http://www-kp3.gsi.de/www/kp3/people/mueller.html



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:03 MET