Core dump when calling the fit panel


Root crashes when I open the fit panel and this
happens when I try fitting an histogram on one of the pad
in a TRootEmbededCanvas :

The message reads:
Nfit: gui/fitpanel/src/TFitEditor.cxx:1872: virtual void TFitEditor::DoDataSet(Int_t): Assertion `objSelected’ failed.
Abort (core dumped)

My method reads:
void Load_Data_Files::DrawPolFile()
// Plot polarisation file;
// Create one pad/polar

Int_t w = 100;
Int_t h = 100;
Int_t wid = fEcanvas->GetCanvasWindowId();
TCanvas *c1 = new TCanvas(“c”, w, h,wid);
int nr_col_pads = (int)hist_stack_channels.size()/2 + (int)fmod(hist_stack_channels.size(),2);

for (int i = 0; i < (int)hist_stack_channels.size(); ++i)
// use TGraphErrors class to Draw
gr_err[i] = new TGraphErrors(hist_stack_channels[i]);
TAxis *tmpaxis = gr_err[i]->GetXaxis();


The problem does not seem to happen if there is only one pad on the canvas so I suspect that the
crash is due to


which are defined as :

std::vector<TH1F*> hist_stack_channels;

in the header file.

I have root5.26. I can attach the core file if it helps.

Thank You,

Bertrand Roessli

Sorry it is NOT with Root5.26 but 5.22.00

Could you provide a very small setup (script, data file) reproducing your problem?



I attached the program as I do not know how to extract the part that causes the trouble quickly. I hope
it will be easy to install it. There is a Makefile. Please do first make NFitDict.cxx (the Makefile
does not compile the dictionary itself…). You should get a program called Nfit in the …/bin directory.

If you run it you will have in tab bar a “file” menu. The first item is “LoadFile”, with which you should be
able to load the data file ‘tasp2010n004629.dat’. Please select it and then click on the “Load File” button.
Then 6 histograms should be plotted on 6 pads. Trying to open the fit panel will make the program
crash. I think this does not happen with Root5.26.

Thank You,

Bertrand Roessli
nfit.tgz (135 KB)

Hi Bertrand,

I’ll try to debug it as soon as I manage to compile it (there are plenty of errors)…
And BTW, how did you manage to get a Makefile of more than 2000 lines?

Cheers, Bertrand.

Strange it compiles fine on my computer. May-be you should recreate the dictionary (delete
NFitDict.cxx, NFitDict.h)?

the 2000 lines in the Makefile com from

makedepend – $(CFLAGS) – $(SRC)

that appends a lot off stuff.



OK, it works now. Could yo post the data file, please? (it is not in the tar file)

Sorry I forgot, it is attached now


sorry, but I could upload the file, somehow ***.dat is not allowed…

tasp2010n004629.C (15.4 KB)

OK thanks. So I confirm that it works with the svn trunk version of ROOT. Can you switch to another version of ROOT, or do you have to use 5.22.00? Since 5.22.00 is quite old (there were quite some changes) and debugging this kind of problem could take some time…
Cheers, Bertrand.

No problem, I will upgrade.

Thanks for the work,


You’re welcome.And if you still have problems, just let us know (now I have the code :wink:)

Cheers, Bertrand.