I’ve made a branch in a root file with a variable-length array class (with Int_t, Float_t, UInt_t). Now I’ve run my code and for the specific branch I don’t have any entries for any events (i.e. the length N = 0 for all events). I’ve noticed that if I use the browser to check on the leaves, I get a crash.
If I use gdb, it gives me a segmentation fault at :
0x4015e0a4 in GetValue__13TStreamerInfoCFPciN22 (this=0x89d9840,
__19152_40_pointer=0x95a3be0 “”, __19152_55_i=9, __19152_64_j=0,
__19152_73_len=-1) at meta/src/TStreamerInfo.cxx:1128
1128 meta/src/TStreamerInfo.cxx: No such file or directory.
in meta/src/TStreamerInfo.cxx
Current language: auto; currently c++
How do I go about debugging this?
Thanks.
–Christos
PS Using /D0/ups/root/Linux-2-4/v3_05_00bKCC_4_0-exception-opt-thread/bin/root
Found the problem. The code was actually making use of an inherited class, and I made the mistake of using the array length of the base class (A::N) as the dimension of a member of the derived class (B::b1). That caused trouble…
Now, I’m wondering: is it possible to see (some Dump() method?) that the created root-tuple has some pathology like that (ie. making it easier to track down the problem)?
Cheers,
–Christos
const int N_MAX = 10;
class A : public TObject {
public:
Int_t _N_;
Float_t * a1; //[_N_]
Float_t * a2; //[_N_]
A(void){
_N_ = 0; a1 = new Float_t[N_MAX]; a2 = new Float_t[N_MAX];}
~A(void){delete [] a1; delete [] a2;}
ClassDef(A, 1)
};
class B : public A {
public:
Int_t _N;
Float_t * b1; //[_N_] *** should be //[_N] ***
Float_t * b2; //[_N]
B(void): A() {
b1 = new Float_t[N_MAX]; b2 = new Float_t[N_MAX];
}
~B(void){delete [] b1; delete [] b2;}
ClassDef(B, 1)
};