Seg fault when plotting pdf asymmetry with RooFit2.95

Hi,
I’m trying to update my code to the latest Root version, with which comes the latest RooFit 2.95, but the attached code fails where it did not used to.

The problem comes from the lines
RooCustomizer* custNeg = new RooCustomizer(*this,“neg”) ;
custPos->setOwning(kTRUE) ;
custNeg->setOwning(kTRUE) ;
in RooAbsReal.cxx…

Commenting out the to setOwning lines solves the problem.
Or maybe the delete custPos at the end of the plotAsymOn method is not correct…

Cheers.
bu.C (1.82 KB)

Hi Stephane,

Thanks for reporting that. The updated code aimed to fix a memory leak, but it appears not to work correctly in all circumstances. I will investigate and fix this.

Wouter

Hi Stephane,

I’ve been out sick for a while, hence the lack of progress. I will look into this problem (and your other one) this week.

Wouter

Hi,
This bug is still present in Roofit 3.0.

Cheers.

Argh, that was supposed to be fixed…
I’ll look into it again.

                     Wouter

Hi,

It turns out I did commit an earlier fix, but had also changed the ownership strategy of RooCustomizer, which undid
the effect of the fix.

A new fix has gone into the dev/roostats branch that should solve
this problem properly. I have tested your example with valgrind
to make sure there are no residual issue.

This fix will also be propagated to the first upcoming ROOT release.

Wouter

Thanks !

Cheers.

S Poss.