Hi,
I have a class MRayTracer , derived from TNamed. This class has 2 TH2Poly pointers, which get dynamically allocated in constructor. Now in main() i have
TFile *froot = new TFile("testMRT.root","RECREATE") ;
MRayTracer A ;
MRayTracer *B = new MRayTracer(A) ;
A.Write() ;
B->Write() ;
froot->Close() ;
This is causing memory crash. If I do file declaration after declaration of B then I dont get memory crash.
So it hass something to do with froot deleting objects owned by it. But I dont understand what ? output is as follows:
[img]
There was a crash.
This is the entire stack trace of all threads:
#0 0x0000003156abaf3a in waitpid () from /lib64/libc.so.6
#1 0x0000003156a4175e in do_system () from /lib64/libc.so.6
#2 0x00007fabe37b1466 in TUnixSystem::StackTrace() () from /home/chinmay/ROOTv5.34/root/lib/libCore.so
#3 0x00007fabe37b3ca3 in TUnixSystem::DispatchSignals(ESignals) () from /home/chinmay/ROOTv5.34/root/lib/libCore.so
#4
#5 0x0000000000d70640 in ?? ()
#6 0x00007fabe1df80f9 in TH2Poly::~TH2Poly() () from /home/chinmay/ROOTv5.34/root/lib/libHist.so
#7 0x00007fabe1df81c9 in TH2Poly::~TH2Poly() () from /home/chinmay/ROOTv5.34/root/lib/libHist.so
#8 0x000000000040dd90 in MRayTracer::~MRayTracer (this=0x7fffe33c9890, __in_chrg=) at MRayTracer.cxx:182
#9 0x0000000000407c36 in main ()
The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at
root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
#5 0x0000000000d70640 in ?? ()
#6 0x00007fabe1df80f9 in TH2Poly::~TH2Poly() () from /home/chinmay/ROOTv5.34/root/lib/libHist.so
#7 0x00007fabe1df81c9 in TH2Poly::~TH2Poly() () from /home/chinmay/ROOTv5.34/root/lib/libHist.so
#8 0x000000000040dd90 in MRayTracer::~MRayTracer (this=0x7fffe33c9890, __in_chrg=) at MRayTracer.cxx:182
#9 0x0000000000407c36 in main ()
[/img]