Re: [ROOT] shared libs

From: Margar SIMONYAN (simonyan@mail.cern.ch)
Date: Wed Oct 06 2004 - 13:34:49 MEST


Dear Rene Brun

yes I get the crash after removing gROOT->Reset()
Bellow you can find traceback and simple macro (test.cpp) resulting to the 
problem

Thanks,
         Margar

{
//gROOT->Reset();
TileInfo info(2100033);
Tile04 tile(info.GetTree());
//gROOT->Reset();
gROOT->ProcessLine(".q");


}

gdb root.exe
GNU gdb Red Hat Linux (5.2-2)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you 
are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for 
details.
This GDB was configured as "i386-redhat-linux"...
(gdb)
(gdb) run
Starting program: 
/afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/bin/root.exe
[New Thread 1024 (LWP 10817)]
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   4.00/08       9 July 2004   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

FreeType Engine v2.1.3 used to render TrueType fonts.
Compiled for linux with thread support.

CINT/ROOT C/C++ Interpreter version 5.15.138, May 23 2004
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.

Welcome to ROOT 

Loading Int2TString_cpp.so     ...  succeed
Loading FindMaximum_cpp.so     ...  succeed
Loading TCell_cpp.so           ...  succeed
Loading TileInfo_cpp.so        ...  succeed
Loading TileFile_cpp.so        ...  succeed
Loading Tile23_cpp.so          ...  succeed
Loading Tile02_cpp.so          ...  succeed
Loading Tile03_cpp.so          ...  succeed
Loading Tile04_cpp.so          ...  succeed
Loading TileEnergy_cpp.so      ...  succeed

root [0] .x test.cpp

This is the end of ROOT -- Goodbye 


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 10817)]
0x4207ad9e in chunk_free () from /lib/i686/libc.so.6
(gdb) bt
#0  0x4207ad9e in chunk_free () from /lib/i686/libc.so.6
#1  0x4207ad24 in free () from /lib/i686/libc.so.6
#2  0x4127f4b6 in __builtin_delete (ptr=0x95f8e34) at 
../../gcc/cp/new2.cc:-1
#3  0x4015eb1b in TAttLine::~TAttLine ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#4  0x40f84a33 in TFriendElement::DisConnect ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libTree.so
#5  0x40f84981 in TFriendElement::~TFriendElement ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libTree.so
#6  0x401e05cc in TCollection::GarbageCollect ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#7  0x401e63dc in TList::Delete ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#8  0x40f8d3ca in TTree::~TTree ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libTree.so
#9  0x401e05cc in TCollection::GarbageCollect ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#10 0x401e63dc in TList::Delete ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#11 0x401e440c in THashList::Delete ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#12 0x4016c6f0 in TDirectory::~TDirectory ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
---Type <return> to continue, or q <return> to quit---
#13 0x401eaab7 in TObjectTable::Delete ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#14 0x401e04b1 in TCollection::EmptyGarbageCollection ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#15 0x401771c2 in TFile::Close ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#16 0x40175bce in TFile::~TFile ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#17 0x401e05cc in TCollection::GarbageCollect ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#18 0x401e635c in TList::Delete ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#19 0x401a5740 in TROOT::~TROOT ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#20 0x401aacc0 in __tcf_0 ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#21 0x4202bf1c in __cxa_finalize () from /lib/i686/libc.so.6
#22 0x40155d19 in __do_global_dtors_aux ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#23 0x40535609 in _fini ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#24 0x4000bb52 in _dl_fini () from /lib/ld-linux.so.2
#25 0x4202bc5b in exit () from /lib/i686/libc.so.6
---Type <return> to continue, or q <return> to quit---
#26 0x40264ebd in TUnixSystem::Exit ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#27 0x4121228d in TRint::Terminate ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libRint.so
#28 0x4015ad76 in TApplication::ProcessLine ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#29 0x401a9f8f in TROOT::ProcessLine ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#30 0x4035e708 in G__G__Base2_174_8_8 ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#31 0x407f01c4 in G__call_cppfunc ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCint.so
#32 0x407de7a4 in G__interpret_func ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCint.so
#33 0x407c34f9 in G__getfunction ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCint.so
#34 0x408591ef in G__getstructmem ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCint.so
#35 0x40851f2a in G__getvariable ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCint.so
#36 0x407b84e1 in G__getitem ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCint.so
#37 0x407b6a69 in G__getexpr ()
---Type <return> to continue, or q <return> to quit---
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCint.so
#38 0x40808542 in G__exec_function ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCint.so
#39 0x40810288 in G__exec_statement ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCint.so
#40 0x4079cedd in G__exec_tempfile_core ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCint.so
#41 0x4079d0ee in G__exec_tempfile ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCint.so
#42 0x40818f44 in G__process_cmd ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCint.so
#43 0x401efea4 in TCint::ProcessLine ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#44 0x401effb4 in TCint::ProcessLineSynch ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#45 0x4015baba in TApplication::ProcessFile ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#46 0x4015b200 in TApplication::ProcessLine ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#47 0x41212047 in TRint::HandleTermInput ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libRint.so
#48 0x412112ac in TTermInputHandler::Notify ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libRint.so
---Type <return> to continue, or q <return> to quit---
#49 0x4121281f in TTermInputHandler::ReadNotify ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libRint.so
#50 0x4026385b in TUnixSystem::CheckDescriptors ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#51 0x40262d55 in TUnixSystem::DispatchOneEvent ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#52 0x401b9e8a in TSystem::InnerLoop ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#53 0x401b9e2e in TSystem::Run ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#54 0x4015becb in TApplication::Run ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libCore.so
#55 0x41211aa8 in TRint::Run ()
   from /afs/cern.ch/sw/root/v4.00.08/rh73_gcc296/root/lib/libRint.so
#56 0x08048835 in main ()
#57 0x42017589 in __libc_start_main () from /lib/i686/libc.so.6
(gdb)
(gdb)






On Wed, 6 Oct 2004, Rene Brun wrote:

> Why do you call gROOT->Reset() ?
> Do you still get the crash when removing this statement?
> If yes, could you send the traceback as explained at:
>       http://root.cern.ch/root/roottalk/RoottalkRules.html
> 
> Rene Brun
> 
>  Margar SIMONYAN wrote:
> > 
> > Dear Rene Brun
> > 
> > I have several shared libs which I am loading from rootlogon.C and to
> > reproduce the problem one need all this libs. Bellow you can find few
> > lines making CINT crash
> > 
> >   *******************************************
> >   *                                         *
> >   *        W E L C O M E  to  R O O T       *
> >   *                                         *
> >   *   Version   4.00/08       9 July 2004   *
> >   *                                         *
> >   *  You are welcome to visit our Web site  *
> >   *          http://root.cern.ch            *
> >   *                                         *
> >   *******************************************
> > 
> > FreeType Engine v2.1.3 used to render TrueType fonts.
> > Compiled for linux with thread support.
> > 
> > CINT/ROOT C/C++ Interpreter version 5.15.138, May 23 2004
> > Type ? for help. Commands must be C++ statements.
> > Enclose multiple statements between { }.
> > 
> > Welcome to ROOT
> > 
> > Loading Int2TString_cpp.so     ...  succeed
> > Loading FindMaximum_cpp.so     ...  succeed
> > Loading TCell_cpp.so           ...  succeed
> > Loading TileInfo_cpp.so        ...  succeed
> > Loading TileFile_cpp.so        ...  succeed
> > Loading Tile23_cpp.so          ...  succeed
> > Loading Tile02_cpp.so          ...  succeed
> > Loading Tile03_cpp.so          ...  succeed
> > Loading Tile04_cpp.so          ...  succeed
> > Loading TileEnergy_cpp.so      ...  succeed
> > 
> > root [0] TileInfo info(2100033)
> > root [1] Tile04 tile(info.GetTree())
> > root [2] gROOT->Reset()
> > root [3] .q
> > 
> > This is the end of ROOT -- Goodbye
> > 
> >  *** Break *** segmentation violation
> >  Generating stack trace...
> > 
> > 
> > I would like to know why CINT crashes after .q when gROOT->Reset() was
> > passed without problems.
> > 
> > Thanks,
> >          Margar Simonyan
> > 
> > On Wed, 6 Oct 2004, Rene Brun wrote:
> > 
> > > I cannot tell you what is going wrong without knowing what you are doing.
> > > I need the shortest possible running script reproducing your problem.
> > > Note that gROOT->Reset should only be used inside an unnamed macro.
> > >
> > > Rene brun
> > >
> > > Margar SIMONYAN wrote:
> > > >
> > > > Dear Rene Brun
> > > >
> > > > sorry I forgot to mention, I am using ROOT 4.00/08.
> > > > Unfortunately I can't send you short file reproducing the problem, but
> > > > base class destructor does nothing, so in case of Tile04 there should not
> > > > be double delete problem. I verified that all pointers are not 0 before
> > > > delete in ~Tile04() . Sometimes CINT  crashes after gROOT->Reset(),
> > > > sometimes after .q .  Even commenting all delete operators in the
> > > > destructor of Tile04 doesn't help.
> > > > I know that without looking inside code it is hard to find a bug, but
> > > > could you say what can make CINT crash ?
> > > >
> > > > Best regards,
> > > >               Margar
> > > >
> > > > On Tue, 5 Oct 2004, Rene Brun wrote:
> > > >
> > > > > This looks like a typical double delete problem.
> > > > > Could you send the shortest possible running file or set of files
> > > > > reproducing the problem?
> > > > > Since you do not indicate which version of ROOT you are using, I assume
> > > > > that you use 4.00/08 or newer.
> > > > > If you use an older version, please try first with a more recent version.
> > > > >
> > > > > Rene Brun
> > > > >
> > > > > On Tue,
> > > > > 5 Oct 2004, Margar
> > > > > SIMONYAN wrote:
> > > > >
> > > > > > Dear users of ROOT
> > > > > >
> > > > > > I have several classes which I am compiling from CINT and loading the
> > > > > > shared libraries from rootlogon.C The class dependency is the following
> > > > > >
> > > > > > class TileFile{ ... //abstract base class}
> > > > > > class Tile23 :public TileFile {...}
> > > > > > class Tile02 :public Tile23{...}
> > > > > > class Tile03 :public Tile23{...}
> > > > > > class Tile04 :public TileFile{...}
> > > > > > class TileInfo {...//some useful thinks}
> > > > > > class TileAlg { TileFile * t; //polymorphic
> > > > > >                 TileInfo i; ...}
> > > > > >
> > > > > > If I change something local in Tile04 then is it necessary to re-compile
> > > > > > and re-load TileFile and TileAlg ?
> > > > > > In Tile04 I am adding friend to fChain using TTree::AddFriend().
> > > > > > All classes in the hierarchy have virtual destructors with the
> > > > > > following implementation (Tile23, Tile02, Tile03, Tile04)
> > > > > >
> > > > > > if (!fChain) return;
> > > > > >  delete fChain->GetCurrentFile();
> > > > > >
> > > > > > but Tile04::~Tile04() makes CINT crash. I suppose it depends on
> > > > > > TTree::AddFriend(), any idea ?
> > > > > >
> > > > > > Best regards,
> > > > > >                Margar
> > > > > >
> > > > >
> > > > >
> > >
> 



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET