How to debug a class?

Hello,
My problem is with root 4.02/00 on cygwin.
I wrote a class which run on a chain of data: I have many idenical root tree on different files (each file has 250 entry and I use 40 files for a total of 10000 events). I make a chain:

for (Int_t jfile=0; jfile<40;jfile++) {
sprintf(CORR1,“tth120_had/tth120_had_100%02d.root/h100”,jfile);
chain->Add(CORR1);

tree = chain;

Init(tree);

and then I loop on all the event with my class booking and filling many histos. At the begining the class was quite simple and everything worked perfectly. I started to makes more complex things and at a certain moment I started to get this error:

*** Break *** segmentation violation
Root > Function LoadTree() busy flag cleared
Function Loop() busy flag cleared

I tried to investigated where the problems was and I found that kind of infos:

  1. the problem appears after the closing of the 32th file in the chain but before the opening of the 33th
  2. if I comment few lines in my loop() routine the problem disappers
  3. there are no memeory leak (the program keep is memory consumption very stable over 20 minutes of running before crashing)
  4. I can comment different part of the program and get rid of the crash, each part works perfectly alone but when I put all together the crash appears
  5. If a try to run the full program on a reduced chain (but including the 32th and the 33th file) again no problem

I don’t know now what to do because I don’t know how to proceed: what can I do to go deeper in the debug process? What can I do? And because I’d like to increase the number of file used (I have more than 100 files like this and I’d like to use them all to have a bigger statistics) this is really a major problems for me.

Any suggestion?
Thank you

Attilio

It looks like you are using a code skeleton generated by TTree::MakeClass.
If this is the case your class may have arrays with dimensions declared
on the maximum dimensions for this (these) array(s).
Increase the dimensions in the type declarations.

Rene