TClonesArray out of bounds and segmentation faults

Maarten Bruinsma (t26@nikhef.nl)
Fri, 6 Mar 1998 17:47:07 +0100 (MET)


Dear Fons et al.,

I have been trying for some days now to implement a TClonesArray of
my own class. Still I keep getting error messages
1:
Error in <TClonesArray::At>: index 16 out of bounds (size: 16, this:
0x10458db0)

2:
Clusters->Delete();

Fatal in <operator delete>: storage area overwritten
aborting
Abort (core dumped)

When I make these everything seems to be fine, I create them like
Clusters = new TClonesArray("EcalCluster");
Clusters->Expand(100);

TGammaData->Branch("BClusters",&Clusters,65536,0);

(Somewhere is written that, in my case, EcalCluster should exist of
'basic' types. Are these only ROOT types, or can they be normal int,
double etc. ? )

Somewhere else they are filled and everything seems to be fine
(>=16 also stored) until
I try to load them. Then I get 1: (above)

One other thing is that
Clusters->GetLast()

always return the maximum value, regardless if the next has less entries.

Do you have an idea about these problems?

Thanks,

Maarten.