TChain problem

Hi all,

I’m having issues using the TChain object (root 5.28 on opensuse 11.3). Well, it’s more of an annoyance. From a macro I initialize the TChain, add files to it, read the tree, all is ok (I mean I can do everything with the data), but when the macro finishes, root doesn’t exit normally, but with an error message:

*** glibc detected *** /usr/local/root5.28-gcc/bin/root.exe: free(): invalid next size (fast): 0x0000000000b267e0 ***

and the backtrace pointing to libCint and libCore. Here is my script:

{ Double_t en; const char fname[50]; TChain tree("results"); for(Int_t m=0;m<=2;m++){ sprintf(fname,"gresults/polar/scattering/cold/107in_%i.root",m); tree.Add(fname); } tree.SetBranchAddress("detector",&en); Int_t nentries = (Int_t)tree.GetEntries(); cout << "Total number of events: "<<nentries << endl; }

If I don’t use TChain, but manually loop over the files, reading the trees and so on, everything is ok. Anyone has some ideas what could be the problem?

Gergely

p.s. I just tried this script on my virtual machine with SciLinux5.5 (root 5.27) and it’s working… The main machine is maintained by our IT support, and ROOT passes the official tests

Hi,

To work around this problem use:TChain *tree = new TChain("results");

Cheers,
Philippe.

Thank you for the suggestion but it didn’t solve the problem. It is not crucial so I’ll just leave it like that.

cheers,
Gergely