Hi, in on skimming program I do TFile * f = TFile::Open("myhisto.root","recreate"); TTree * QuickDump= new TTree("dump","dump tree"); Dump * gototree= new Dump(); const Int_t bufsize = 32000; QuickDump->Branch("dumpbranch","Dump",&gototree,bufsize,2); then among a lot of code that does not explicitly interact with the previous varirables I do gototree->field=variable; QuickDump->Fill(); and at the end f->cd(); QuickDump->Write(); f->Close(); this gives me a rootuple with the correct information in it. and I have no problem interactivly. However, there is a segfault when I do that in an other program TFile * f = TFile::Open("myhisto.root"); TTree * t= (TTree *)f->Get("dump"); TBranchElement* tb = (TBranchElement*)t->GetBranch("dumpbranch"); Dump * gototree= new Dump(); t->SetBranchAddress("dumpbranch",&gototree); t->SetBranchStatus("dumpbranch",1); t->GetEntry(1);//crashes here gdb catch the crash in Program received signal SIGSEGV, Segmentation fault. 0x4149d4e2 in TBranchElement::ReadLeaves(TBuffer&) () from /d0usr/products/root/Linux-2-4/v3_05_04b_rh71_lockedGCC_3_1-exception-opt-thread/lib/libTree.so WHILE and this is the interesting point, if I a try with an different rootfile and the corresponding object class I get no crash and the correct values out of the tree. What could be wrong in my rootfile or the way I create it ? cheers Jean-Roch -- ------- ----------------- VLIMANT Jean-Roch LPNHE : CNRS - IN2P3 - University of Paris 6 France : 33 1 44 27 23 28 USA : 00 1 630 840 87 40 ----------------- ------- --
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET