Incorrect checksum for freed object while using "fitTo"

Dear Experts,
I’m running a RooFit code in root 6 and while making a fit with the function:
fitResult = (*TotalPDF)->fitTo(*dataSet,Extended(true),ExternalConstraints(*vecConstr),Save(true),Minos(a
toi(Utility->GetGenericParam(“UseMINOS”).c_str())),Minimizer(MINIMIZER));

I get the error message:

ExtractYield(79610,0x7fff75e6d000) malloc: *** error for object 0x7f92deb0cd78: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

As you can see it seems to me a problem related to wrong memory handling.
I must add that the same exact code was working fine in root 5.34, without any problem at all.

In order to help you to debug this issue I’m attaching the “dump” of the workspace made right before the fitTo, with the commands:

RooWorkspace w(“w”);
w.import(**TotalPDF);
w.importClassCode();
w.import(*dataSet);
w.writeToFile(“Dinardo.root”);

Please let me know if you have any idea on what’s going on.
Many thanks for your help.
Kind regards,

Hi Mauro,

I cannot read your workspace because you cannot save in a file your pdf RooFunctorPdfBinding::AngleMisTag since it is based a functor object which cannot be stored.

This is a different problem I think of your crash. Do you have the code creating the workspace or just have a minimal workspace with the object that can be saved and then create the functor pdf from it ?

Thanks

Lorenzo

Ciao Lorenzo,
many thanks for looking into this.

I put the whole code in my public area on lxplus: ForLorenzo.tar.gz

In order to run the program you need to:

  1. go into “plugins”
  2. type: make ExtractYield
  3. run it with the line: ./ExtractYield 6 singleCand_B0ToKstMuMu_MC_NTuple_reduced.root yesEffCorr 0
    That’s all.

The line of code I was referring to in my previous post is: 5336

It’s not obvious to me how to make a small simple program to reproduce the problem.
I hope you’ll be able to use the tar file that I made.
Let me know if you need further information.

Many thanks again and kind regards,

  • Mauro.

Dear Lorenzo,
I was wondering whether you had a chance to take a look at the code.
If there is anything you want me to do in order to help you debugging it,
please let me know.

Many thanks and kind regards,

  • Mauro.