Re: ROOT 5.06 segfaults

From: Andrei Gheata <Andrei.Gheata_at_cern.ch>
Date: Sun, 20 Nov 2005 16:38:00 +0100


Hi Michal,

Indeed, the geometry have to be closed and the path must be valid for this to work. On the other hand, it should not produce a segv, but issue an error. I will add the protection.
Thanks for reporting this,
Andrei

MichaƂ DwuĆŒnik wrote:

> Hello Rooters,
>
> running sucha a small macro:
>
> {
> gSystem->Load("libGeom.so");
> if (gGeoManager) delete gGeoManager;
> gROOT->GetListOfCanvases()->Delete();
> //materials and media defs
> TGeoManager *geometry = new TGeoManager("ID viewer","ID");
> Int_t idx=0; //index of main modules chain
> Int_t irot=0 ; // rot matrix index (0-8)
>
> TGeoMaterial *vac_mat = new TGeoMaterial("Vacuum",0,0,0);
> TGeoMaterial *si_mat = new
> TGeoMaterial("Silicon",geometry->GetElementTable()->FindElement("silicon"),2.3);
>
> //si_mat->SetTransparency(30); //translucent silicon
> si_mat->SetTransparency(0); //opaque silicon
>
> TGeoMedium *vac = new TGeoMedium("Vacuum",1,vac_mat);
> TGeoMedium *si = new TGeoMedium("Silicon",1,si_mat);
> TGeoVolume *id_box = geometry->MakeBox("TopBox",vac,600,600,3000);
> geometry->SetTopVolume(id_box);
> TGeoTranslation *trans = new TGeoTranslation(20,30,50);
> TGeoTranslation *corr = new TGeoTranslation(1,5,10);
> TGeoRotation *rot = new TGeoRotation();
> trans->SetTranslation(2,3,5);
> rot->SetAngles(0,90,0);
> TGeoCombiTrans *combi = new TGeoCombiTrans(*trans,*rot);
>
> TGeoVolume *testbox = geometry->MakeBox("test1",si,5,10,15);
> TGeoVolume *testbox2 = geometry->MakeBox("test2",si,5,10,15);
> testbox2->SetLineColor(2);
> id_box->AddNode(testbox,1);
> id_box->AddNode(testbox2,2,combi);
> //geometry->GetNode(2)->SetLineColor(1);
> //geometry->CloseGeometry();
> //id_box->Draw("ogl");
> }
>
> followed by :
> gGeoManager->MakePhysicalNode("/TopBox_1/test1_1")
>
> yields->
> *** Break *** segmentation violation
> Generating stack trace...
> 0xb5be94fb in TGeoManager::CdTop() + 0x45 from
> /home/mdwuznik/root/lib/libGeom.so
> 0xb5beca1c in TGeoManager::cd(char const*) + 0x32 from
> /home/mdwuznik/root/lib/libGeom.so
> 0xb5c1dc2f in TGeoPhysicalNode::SetPath(char const*) + 0x2b from
> /home/mdwuznik/root/lib/libGeom.so
> 0xb5c1e041 in TGeoPhysicalNode::TGeoPhysicalNode(char const*) + 0xe1
> from /home/mdwuznik/root/lib/libGeom.so
> 0xb5beaac2 in TGeoManager::MakePhysicalNode(char const*) + 0x32 from
> /home/mdwuznik/root/lib/libGeom.so
> 0xb5c8a191 in <unknown> from /home/mdwuznik/root/lib/libGeom.so
> 0xb75ee6e3 in G__ExceptionWrapper + 0x45 from
> /home/mdwuznik/root/lib/libCint.so
> 0xb768a238 in G__call_cppfunc + 0x2cc from /home/mdwuznik/root/lib/libCint.so
> 0xb76755a9 in G__interpret_func + 0x781 from /home/mdwuznik/root/lib/libCint.so
> 0xb766b0b3 in G__getfunction at v6_func.cxx:0 from
> /home/mdwuznik/root/lib/libCint.so
> 0xb76f585a in G__getstructmem + 0x9da from /home/mdwuznik/root/lib/libCint.so
> 0xb76ed621 in G__getvariable at v6_var.cxx:0 from
> /home/mdwuznik/root/lib/libCint.so
> 0xb764beb6 in G__getitem at v6_expr.cxx:0 from
> /home/mdwuznik/root/lib/libCint.so
> 0xb7656962 in G__getexpr at v6_expr.cxx:0 from
> /home/mdwuznik/root/lib/libCint.so
> 0xb76a40a2 in G__exec_function + 0xc6 from /home/mdwuznik/root/lib/libCint.so
> 0xb76a99bb in G__exec_statement at v6_parse.cxx:0 from
> /home/mdwuznik/root/lib/libCint.so
> 0xb7639bfd in G__exec_tempfile_core + 0x2f9 from
> /home/mdwuznik/root/lib/libCint.so
> 0xb7639dd7 in G__exec_tempfile_fp + 0x23 from
> /home/mdwuznik/root/lib/libCint.so
> 0xb76b5240 in G__process_cmd + 0x4fda from /home/mdwuznik/root/lib/libCint.so
> 0xb79fbf16 in TCint::ProcessLine(char const*,
> TInterpreter::EErrorCode*) + 0x126 from
> /home/mdwuznik/root/lib/libCore.so
> 0xb793ae01 in TApplication::ProcessLine(char const*, bool, int*) +
> 0x63f from /home/mdwuznik/root/lib/libCore.so
> 0xb6c342c9 in TRint::HandleTermInput() + 0x20d from
> /home/mdwuznik/root/lib/libRint.so
> 0xb6c33a12 in TTermInputHandler::Notify() + 0x24 from
> /home/mdwuznik/root/lib/libRint.so
> 0xb6c3553c in TTermInputHandler::ReadNotify() + 0x12 from
> /home/mdwuznik/root/lib/libRint.so
> 0xb7a8f707 in TUnixSystem::CheckDescriptors() + 0x12d from
> /home/mdwuznik/root/lib/libCore.so
> 0xb7a8fe32 in TUnixSystem::DispatchOneEvent(bool) + 0x142 from
> /home/mdwuznik/root/lib/libCore.so
> 0xb79b3a54 in TSystem::InnerLoop() + 0x18 from
> /home/mdwuznik/root/lib/libCore.so
> 0xb79b39fa in TSystem::Run() + 0x6e from /home/mdwuznik/root/lib/libCore.so
> 0xb793a1c3 in TApplication::Run(bool) + 0x37 from
> /home/mdwuznik/root/lib/libCore.so
> 0xb6c3475f in TRint::Run(bool) + 0x37b from /home/mdwuznik/root/lib/libRint.so
> 0x08048e30 in main + 0x68 from /home/mdwuznik/root/bin/root.exe
> 0xb69d4ea2 in __libc_start_main + 0xd2 from /lib/tls/i686/cmov/libc.so.6
> 0x08048d31 in TApplicationImp::ShowMembers(TMemberInspector&, char*)
> + 0x31 from /home/mdwuznik/root/bin/root.exe
> .
>
>
> If one closes the geometry before adding a physical node adding a physical node
> is succesful, but trying to add a physical node with incorrect path
> followed by listing of physical node results in roughly the same
> error.
>
> Shall it happen ?
>
>
> Regards
> Michal Dwuznik
>
Received on Sun Nov 20 2005 - 16:38:11 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:13 MET