Error: Symbol G__exception at tree->GetEvent(iev) ;

Hello,

In a very simple piece of code, where I read out the entries of a tree:


TChain* tree = new TChain(“eventTree”);
tree->Add(“trigtau.ntuple.root.1”);
tree->Add(“trigtau.ntuple.root.2”);
TrigTauEvent* event = new TrigTauEvent();

tree->SetBranchAddress(“EventBranch”,&event) ;
tree->SetBranchStatus("*",1) ;

for(int iev = 0; iev<nev; ++iev)
{
event->reset() ;
tree->GetEvent(iev) ;
}


I get this error:


Error: Symbol G__exception is not defined in current scope testRun.cxx:93:
Error: type G__exception not defined FILE:/afs/cern.ch/user/s/sfyrla/WTauNu/WORK_AREA/15.5.4/run/./testRun.cxx LINE:93
*** Interpreter error recovered ***


at the line:
tree->GetEvent(iev) ;

In fact, I get this error in very large number of events, iev, and not exactly at the same iev always. It seems to be given by a segmentation fault given by some memory leak (with a “top” even, I see the memory usage increasing exponentially), but I don’t understand what it can be caused by. Is there any reason why this could happen?

Thank you!

Best regards,
– Anna.

I suggest to replace your code with:

[code]TChain* tree = new TChain(“eventTree”);
tree->Add(“trigtau.ntuple.root.1”);
tree->Add(“trigtau.ntuple.root.2”);
TrigTauEvent* event = 0;

tree->SetBranchAddress(“EventBranch”,&event) ;

for(int iev = 0; iev<nev; ++iev)
{
tree->GetEvent(iev) ;
} [/code]

If you cannot solve your problem post the file in a public area and let us know.

Rene

One possibility that you do no set (or reset) properly the content of your even object. You may want to run your example using valgrind (valgrind.org) to get more information of what the memory over-write might be.

Cheers,
Philippe.