Equivalent code/different outcomes?

Two bugs:

  1. ConditionalObservables() argument does not work in RooNLLVar constructor:
    RooNLLVar nll(“nll”,“log(likelihood)”,*simPdf,*testDS) ;
    runs fine.

and

RooAbsReal* nll = simPdf>createNLL(*testDS,ConditionalObservables(RooArgSet(dterr))) ;

also runs fine.

But,
RooNLLVar nll(“nll”,“log(likelihood)”,*simPdf,*test,DSConditionalObservables(RooArgSet(dterr))) ;

crashes with a seg violation.

RooNLLVar nll = new RooNLLVar(“nll”,"-log(likelihood)",simPdf,testDS,Extended(kTRUE)/,ConditionalObservables(RooArgSet(dterr))/,NumCPU(8)) ;
// //RooAbsReal
nll = simPdf->createNLL(*testDS,ConditionalObservables(RooArgSet(dterr)),NumCPU(8),Verbose(kTRUE)) ;

============================================================================================
2) RooFitResult->Print(“v”) crashes if RooFitResult was created by the pdf->fitTo() method.

This code runs fine:
RooAbsReal* nll = simPdf>createNLL(*testDS) ;
RooMinuit m(nll) ;
RooFitResult
rfr = m.save();
rfr->Print(“v”);

This code seg faults (stack trace included)
RooFitResult* rfr = simPdf->fitTo(*testDS);
rfr->Print(“v”);

Also, besides the Print() function, the following statements also crash when using RooFitResult
from the fitTo() function:

rfr->constPars().printLatex(Format(“NE”,VerbatimName(kFALSE)),
OutputFile(“fit_constPars_latextables.tex”));
rfr->floatParsFinal().printLatex(Sibling(rfr->floatParsInit()),
Format(“NE”,VerbatimName(kFALSE)),
OutputFile(“fit_floatPars_latextables.tex”));

*** Break *** segmentation violation

===========================================================
There was a crash (#7 0x5578a98d in SigHandler(ESignals) ()).
This is the entire stack trace of all threads:

#0 0xffffe410 in __kernel_vsyscall ()
#1 0x566ee5b3 in __waitpid_nocancel () from /lib/libc.so.6
#2 0x5669307b in do_system () from /lib/libc.so.6
#3 0x56650ead in system () from /lib/libpthread.so.0
#4 0x5578625d in TUnixSystem::Exec(char const*) ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCore.so
#5 0x5578d364 in TUnixSystem::StackTrace() ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCore.so
#6 0x5578a8be in TUnixSystem::DispatchSignals(ESignals) ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCore.so
#7 0x5578a98d in SigHandler(ESignals) ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCore.so
#8 0x55783b54 in sighandler(int) ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCore.so
#9
#10 0x5884171b in adaFit2() ()
from /afs/slac.stanford.edu/u/br/aeevr/B0toD0K0/analysis-43/workdir/anal_dir/./adaFit2_C.so
#11 0x58851197 in G__adaFit2_C_ACLiC_dict__0_3880(G__value*, char const*, G__param*, int) ()
from /afs/slac.stanford.edu/u/br/aeevr/B0toD0K0/analysis-43/workdir/anal_dir/./adaFit2_C.so
#12 0x55d495ea in Cint::G__ExceptionWrapper(int ()(G__value, char const*, G__param*, int), G__value*, char*, G__param*, int) ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCint.so
#13 0x55e053d6 in G__execute_call ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCint.so
#14 0x55e07af0 in G__call_cppfunc ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCint.so
#15 0x55de030f in G__interpret_func ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCint.so
#16 0x55dcc4bb in G__getfunction ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCint.so
#17 0x55da2ec1 in G__getitem ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCint.so
#18 0x55dad781 in G__getexpr ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCint.so
#19 0x55db44c0 in G__calc_internal ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCint.so
#20 0x55e4690f in G__process_cmd ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCint.so
#21 0x55773fc5 in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*)
()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCore.so
#22 0x5577927f in TCint::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCore.so
#23 0x5569ac86 in TApplication::ExecuteFile(char const*, int*, bool) ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCore.so
#24 0x5569b2cc in TApplication::ProcessFile(char const*, int*, bool) ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCore.so
#25 0x55698765 in TApplication::ProcessLine(char const*, bool, int*) ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libCore.so
#26 0x564e98f9 in TRint::Run(bool) ()
from /afs/slac.stanford.edu/package/cernroot/vol2/52600/Linux26SL5_i386_gcc412/lib/libRint.so
#27 0x08048d83 in main ()

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.

#10 0x5884171b in Fit2() ()
from Fit2_C.so

Hi,
the crash in the RooFitResult::Print() method when RooFitResult is created by the RooAbsPdf::fitTo() could be avoided by adding the RooFit::Save(kTRUE) option when calling RooAbsPdf::fitTo().

Leonardo