Details
-
Bug
-
Resolution: Fixed
-
High
-
master
-
None
-
Ubuntu
ROOT master
Description
When constructing RooCmdArgs, they might copy a pointer to a temporary. That leads to crashes when the temporary is destructed before the function that should receive the arguments is called:
import ROOT |
|
ROOT.gInterpreter.Declare('''const RooArgSet * extractObj(const RooCmdArg& arg) { |
const RooArgSet* set = (const RooArgSet*) arg.getObject(0); |
return set; |
}''')
|
|
x = ROOT.RooRealVar("x", "x title", 0, 0, 10) |
temp = ROOT.extractObj(ROOT.RooFit.NormSet( ROOT.RooArgSet(x) )) |
temp.Print("V") |
temp["x"].Print("V") |
In some cases, RooFit doesn't crash, but just gives the wrong result, see e.g.
https://root-forum.cern.ch/t/createintegral-gives-unexpected-result/32627