Error in TObject constructor for derived classes

I’m using Qt and ROOT in my app.
I have a class, that is derived from TObject:

class myBaseClass: public QObject, public TObject

now I have several classes that are derived from myBaseClass:

class myClass1: public myBaseClass
class myClass2: public myBaseClass

the code that breaks is the following:

myBaseClass **myClasses=new myBaseClass[nObjs];//nObjs>10
myClasses[0]=new myClass1();
myClasses[1]=new myClass2();
myClasses[2]=new myClass3();
myClasses[3]=new myClass4();
myClasses[4]=new myClass5();//breaks in TObject call of TStorage
myClasses[5]=new myClass6();

myClass5 has a lot of member-variables, but that should not be a problem.

Thanks in advance for any suggestions.

specs:
system: suse linux 10.2
compiler: gcc 4.1.2
root-version: 5.14.00
qt: 3.4

Hi,

could you post a) a short complete example, and b) the error messages (backtrace etc) you see?

Cheers, Axel.

sorry for replying so lately.

a) is very difficult to solve, since it is a large project and if I take just 4 classes this problem doesn’t occur,
but nevertheless, I can give you the error messages that appear in the terminal, and the backtrace.
################################
error messages in attachment
################################
(gdb) bt
#0 0x00002b36882df535 in raise () from /lib64/libc.so.6
#1 0x00002b36882e0990 in abort () from /lib64/libc.so.6
#2 0x00002b36883166db in __libc_message () from /lib64/libc.so.6
#3 0x00002b368831b8fe in malloc_printerr () from /lib64/libc.so.6
#4 0x00002b368831d787 in _int_malloc () from /lib64/libc.so.6
#5 0x00002b368831f386 in malloc () from /lib64/libc.so.6
#6 0x00002b3687c06fcd in operator new () from /usr/lib64/libstdc++.so.6
#7 0x00002b36831bb939 in TStorage::ObjectAlloc ()
from /usr/local/root-5.14.00/lib/root/libCore.so
#8 0x00000000004ea436 in tofAnalysis::initAlgorithms (this=0x7fff27d38d60,
p=, beamParam=@0x11e6810, runParam=@0x16dbf60)
at /usr/local/root-5.14.00/include/root/TObject.h:155
#9 0x00000000004e8254 in tofAnalysis::initStep (this=0x7fff27d38d60,
p=@0x7fff27d3ad80, beamParam=@0x7fff27d3ad60, runParam=@0x7fff27d3ad40,
dets=@0x7fff27d3ad20, mats=@0x7fff27d3ad00, col=@0x7fff27d3a9a0)
at analyser/tofAnalysis_t.cpp:337
#10 0x0000000000481501 in main (argc=,
argv=0x7fff27d3b128) at analysis.cpp:328
#########################################
If you really want to go into the depth of code (which is a lot), you can get it on my homepage (www.pit.physik.uni-tuebingen.de/~ehrhardt/).
err.txt (5.81 KB)

Hi,
you should run your program with valgrind.
Axel.