ROOFIT AND TApplication::Terminate() crashes the program!

Dear root experts,
I’m running on a Mac OS Lion a C++ compiled code with root.
In the main I do:
TApplication* theApp = new TApplication(“Applications”, &argc, argv);
.
.
.
at the end of the main I do:
theApp->Terminate(0);
return 0;

One more piece of information: I’m also using ROOFIT in my program !

At the instruction theApp->Terminate(0); the program crashes !!!
Can you please help me to make the program ending without crashing ?

I already posted this message in the “ROOT Support” forum and they say that the problem seems to be related to ROOFIT

  • my ROOT version is: 5.32/01
  • my compiler version is: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
  • my MAC OS X version is: 10.7.5

Thanks,

  • Mauro.

The output of the crashing:

*** Break *** segmentation violation

There was a crash.
This is the entire stack trace of all threads:

Thread 1 (process 57725):
#0 0x00007fff8b397168 in wait4 ()
#1 0x00007fff903935f5 in system ()
#2 0x000000010f196b16 in TUnixSystem::StackTrace ()
#3 0x000000010f1948a7 in TUnixSystem::DispatchSignals ()
#4
#5 0x000000010f14eaf5 in TList::Delete ()
#6 0x0000000111ed25d7 in RooPlot::~RooPlot ()
#7 0x0000000111ed24f2 in RooPlot::~RooPlot ()
#8 0x000000010f14b0b4 in TCollection::GarbageCollect ()
#9 0x000000010f14c951 in THashList::Delete ()
#10 0x00000001100b20d4 in TDirectoryFile::Close ()
#11 0x00000001100bd1e2 in TFile::Close ()
#12 0x00000001100bbc96 in TFile::~TFile ()
#13 0x00000001100bbc32 in TFile::~TFile ()
#14 0x000000010f14b0b4 in TCollection::GarbageCollect ()
#15 0x000000010f14e9cd in TList::Delete ()
#16 0x000000010f10385e in TROOT::~TROOT ()
#17 0x00007fff903d07c8 in __cxa_finalize ()
#18 0x00007fff903d0652 in exit ()
#19 0x000000010e6aaaab in start ()

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 0x000000010f14eaf5 in TList::Delete ()
#6 0x0000000111ed25d7 in RooPlot::~RooPlot ()
#7 0x0000000111ed24f2 in RooPlot::~RooPlot ()
#8 0x000000010f14b0b4 in TCollection::GarbageCollect ()
#9 0x000000010f14c951 in THashList::Delete ()
#10 0x00000001100b20d4 in TDirectoryFile::Close ()
#11 0x00000001100bd1e2 in TFile::Close ()
#12 0x00000001100bbc96 in TFile::~TFile ()
#13 0x00000001100bbc32 in TFile::~TFile ()
#14 0x000000010f14b0b4 in TCollection::GarbageCollect ()
#15 0x000000010f14e9cd in TList::Delete ()
#16 0x000000010f10385e in TROOT::~TROOT ()
#17 0x00007fff903d07c8 in __cxa_finalize ()
#18 0x00007fff903d0652 in exit ()
#19 0x000000010e6aaaab in start ()