Crash when filling tree with TClonesArray

so I have a class that has an class that has a TClonesArray. I followed the methodolgy used in the examples given in (Event.h/cxx) mentioned in the root document on trees. But when I ran this I get a crash with this stack trace:

#0 0x0000003ab70bd3be in waitpid () from /lib64/
#1 0x0000003ab704210e in do_system () from /lib64/
#2 0x000000310ea4848d in TUnixSystem::StackTrace() () from /usr/lib64/root/
#3 0x000000310ea4ad03 in TUnixSystem::DispatchSignals(ESignals) () from /usr/lib64/root/
#5 0x000000310ea35509 in TClass::GetStreamerInfo(int) const () from /usr/lib64/root/
#6 0x00000031124c83bc in TBufferFile::ForceWriteInfoClones(TClonesArray*) () from /usr/lib64/root/
#7 0x000000310ea07f04 in TClonesArray::Streamer(TBuffer&) () from /usr/lib64/root/
#8 0x00000031124cc192 in TBufferFile::WriteObjectClass(void const*, TClass const*) () from /usr/lib64/root/
#9 0x00000031124c9f8f in TBufferFile::WriteObjectAny(void const*, TClass const*) () from /usr/lib64/root/
#10 0x00000031124cbb80 in TBufferFile::WriteFastArray(void**, TClass const*, int, bool, TMemberStreamer*) () from /usr/lib64/root/
#11 0x00000031124ba286 in int TStreamerInfo::WriteBufferAux<char**>(TBuffer&, char** const&, int, int, int, int) () from /usr/lib64/root/
#12 0x00000031124aa1fe in TStreamerInfo::WriteBufferClones(TBuffer&, TClonesArray*, int, int, int) () from /usr/lib64/root/
#13 0x00000031108cc9dd in TBranchElement::FillLeaves(TBuffer&) () from /usr/lib64/root/
#14 0x00000031108bf883 in TBranch::Fill() () from /usr/lib64/root/
#15 0x00000031108c8f50 in TBranchElement::Fill() () from /usr/lib64/root/
#16 0x00000031108c8d1a in TBranchElement::Fill() () from /usr/lib64/root/
#17 0x00000031108c8d1a in TBranchElement::Fill() () from /usr/lib64/root/
#18 0x00000031108a0da5 in TTree::Fill() () from /usr/lib64/root/
#19 0x000000000040b015 in main (argc=1, argv=0x7fff73912fb8) at FillEvents.cpp:114

Would anyone know what am I doing wrong if the stack trace looks familiar? I tried to step into the debugger but crashes, just when I “step into” the function TTree::Fill(). I would have expected at least to walk down in the above stack track, but for reasons I dont’ understand, it just crashes.

OK, solved my problem. The class name passed in, when allocating TClonesArray was misspelled. Wish that could have been a compilation error rather than a run time error … :confused: