RooMCStudy crashes in ROOT 5.14.00f and 5.16.00

I am using RooMCStudy to do the toy Monte Carlo study. It works well with ROOT 5.12.00, but it crashed with ROOT 5.14.00f and 5.16.00. It is strange for me. I also found a similar bug report:
sourceforge.net/tracker/index.ph … tid=491900

You could find the prototype of my codes here:
twiki.cern.ch/twiki/pub/LHCb/Li … fetime3.cc

What I modified are:
1)change the name to lifetime3.C
2)add two lines in void lifetime3(int nEvents=10000, double SoB=0.3) {}:
gSystem->Load(“libRooFit”);
using namespace RooFit;
and delete the line “using namespace RooFit;” in the very beginning.
Then it works with ROOT 5.14.00f and 5.16.00 ( % root -l lifetime3.C ).

But If I tried to do the RooMCStudy and add the following before the line:
RooDataSet *toyData = pdf->generate(RooArgSet(*observables),Verbose(false),NumEvents(10000));

RooMCStudy *mgr = new RooMCStudy(*pdf_wrong, *pdf_wrong, *observables, “q”, “mhr”);
mgr->generateAndFit( 10, 100);

It crashed. What’s wrong here? Thanks a lot.

Processing lifetime3.C…

RooFit v2.11 – Developed by Wouter Verkerke and David Kirkby
Copyright © 2000-2005 NIKHEF, University of California & Stanford University
All rights reserved, please read roofit.sourceforge.net/license.txt

RooRealVar::setRange(m) new range named ‘lowersideband’ created with bounds [5.13,5.205]
RooRealVar::setRange(m) new range named ‘signal’ created with bounds [5.205,5.31]
RooRealVar::setRange(m) new range named ‘uppersideband’ created with bounds [5.355,5.43]
RooMCStudy::run: Generating and fitting sample 9

*** Break *** segmentation violation
(no debugging symbols found)
Using host libthread_db library “/lib/tls/libthread_db.so.1”.
Attaching to program: /proc/8142/exe, process 8142
(no debugging symbols found)…done.
[Thread debugging using libthread_db enabled]
[New Thread -1218586080 (LWP 8142)]
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
0x0037023e in __waitpid_nocancel () from /lib/tls/libc.so.6
Thread 1 (Thread -1218586080 (LWP 8142)):
#0 0x0037023e in __waitpid_nocancel () from /lib/tls/libc.so.6
#1 0x00304fa4 in do_system () from /lib/tls/libc.so.6
#2 0x001f9c3f in system () from /lib/tls/libpthread.so.0
#3 0x00608d67 in TUnixSystem::Exec () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCore.so
#4 0x0060916b in TUnixSystem::StackTrace () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCore.so
#5 0x00606fa1 in TUnixSystem::DispatchSignals () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCore.so
#6 0x006050d1 in SigHandler () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCore.so
#7 0x0060b8e1 in sighandler () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCore.so
#8
#9 0x06ee9bb2 in RooLinkedList::iterator () from /projects/lhcb/hejb/software/root/root_5.16/lib/libRooFitCore.so
#10 0x06e6f178 in RooAbsCollection::operator= () from /projects/lhcb/hejb/software/root/root_5.16/lib/libRooFitCore.so
#11 0x06ef427d in RooMCStudy::run () from /projects/lhcb/hejb/software/root/root_5.16/lib/libRooFitCore.so
#12 0x06ef4581 in RooMCStudy::generateAndFit () from /projects/lhcb/hejb/software/root/root_5.16/lib/libRooFitCore.so
#13 0x070b0f22 in G__G__RooFitCore3_173_0_4 () from /projects/lhcb/hejb/software/root/root_5.16/lib/libRooFitCore.so
#14 0x00d0cd9b in Cint::G__ExceptionWrapper () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#15 0x00dae0e9 in G__call_cppfunc () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#16 0x00d9d493 in G__interpret_func () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#17 0x00d88cc8 in G__getfunction () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#18 0x00e16e90 in G__getstructmem () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#19 0x00e16535 in G__getvariable () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#20 0x00d7fdb5 in G__getitem () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#21 0x00d760a7 in G__getexpr () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#22 0x00dc7adb in G__exec_function () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#23 0x00dcec35 in G__exec_statement () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#24 0x00d9b769 in G__interpret_func () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#25 0x00d89e5d in G__getfunction () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#26 0x00d8010e in G__getitem () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#27 0x00d760a7 in G__getexpr () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#28 0x00d75422 in G__calc_internal () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#29 0x00dd8229 in G__process_cmd () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCint.so
#30 0x005dcb4e in TCint::ProcessLine () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCore.so
#31 0x005dcccf in TCint::ProcessLineSynch () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCore.so
#32 0x00557eca in TApplication::ProcessFile () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCore.so
#33 0x005576f4 in TApplication::ProcessLine () from /projects/lhcb/hejb/software/root/root_5.16/lib/libCore.so
#34 0x00c696a8 in TRint::Run () from /projects/lhcb/hejb/software/root/root_5.16/lib/libRint.so
#35 0x080488be in main ()
Root > Function lifetime3() busy flag cleared

Has anything been done to rectify this?

I’m trying to do a toy study and seeing this issue in Root 5.17/05, with RooFit v2.22.

my code can be found at ph.ed.ac.uk/~p0127440/B2PhiK … _broken.cc
(segfault occurs at line 665)

Am I doing something wrong, or has this yet to be fixed?
Thanks,

Conor

RooArgSet::parameters:

  1. RooRealVar::C: “cos component”
  2. RooRealVar::S: “sin2B component”
    [#1] INFO:Generation – RooGenContext::ctor() setting up event generator context for p.d.f. ptime for generation of observable(s) (C,S) with internal generation forced for observables (B0_MC_tau)
    [#1] INFO:Generation – RooGenContext::ctor() Context will generate variables (C,S) with accept/reject sampling
    [#0] WARNING:Integration – RooRealIntegral::initNumIntegrator(ptime_coefVar_0_Int[C,S]) evaluation requires 2-D numeric integration step. Evaluation may be slow, sufficient numeric precision for fitting & minimization is not guaranteed
    [#0] WARNING:Integration – RooRealIntegral::initNumIntegrator(ptime_coefVar_1_Int[C,S]) evaluation requires 2-D numeric integration step. Evaluation may be slow, sufficient numeric precision for fitting & minimization is not guaranteed
    [#0] WARNING:Integration – RooRealIntegral::initNumIntegrator(ptime_coefVar_2_Int[C,S]) evaluation requires 2-D numeric integration step. Evaluation may be slow, sufficient numeric precision for fitting & minimization is not guaranteed
    [#1] INFO:Generation – RooGenContext::ctor() accept/reject sampling function is ptime_AccRej
    RooMCStudy::run: Generating and fitting sample 9

*** Break *** segmentation violation
(no debugging symbols found)
Using host libthread_db library “/lib/tls/libthread_db.so.1”.
Attaching to program: /proc/26972/exe, process 26972
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
[Thread debugging using libthread_db enabled]
[New Thread -1209059648 (LWP 26972)]
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.

0x001bc7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x068c4d23 in __waitpid_nocancel () from /lib/tls/libc.so.6
#2 0x0686e7a9 in do_system () from /lib/tls/libc.so.6
#3 0x001b598d in system () from /lib/tls/libpthread.so.0
#4 0x009d2e67 in TUnixSystem::Exec ()
from /Disk/lochnagar0/general/root/src-build/lib/libCore.so
#5 0x009d8615 in TUnixSystem::StackTrace ()
from /Disk/lochnagar0/general/root/src-build/lib/libCore.so
#6 0x009d5259 in TUnixSystem::DispatchSignals ()
from /Disk/lochnagar0/general/root/src-build/lib/libCore.so
#7 0x009d5360 in SigHandler ()
from /Disk/lochnagar0/general/root/src-build/lib/libCore.so
#8 0x009d4539 in sighandler ()
from /Disk/lochnagar0/general/root/src-build/lib/libCore.so
#9
#10 0x043dd287 in RooLinkedList::iterator ()
from /Disk/lochnagar0/general/root/src-build/lib/libRooFitCore.so
#11 0x04354f19 in RooAbsCollection::operator= ()
from /Disk/lochnagar0/general/root/src-build/lib/libRooFitCore.so
#12 0x043e6b9d in RooMCStudy::run ()
from /Disk/lochnagar0/general/root/src-build/lib/libRooFitCore.so
#13 0x043e7098 in RooMCStudy::generateAndFit ()
from /Disk/lochnagar0/general/root/src-build/lib/libRooFitCore.so
#14 0x08051567 in main ()

Hi,

I believe your problem has been fixed. There was a specific issue with RooMCStudy objects set up with a separate fit and generator model (which is the way you call it in the linked code fragment), even if the specified model is the same.

It should be quick to check this. You can either try the latest root version (5.17/08) with your macro unchanged, or alternatively change the construction of RooMCStudy so that *pdf only appears once on the command line, in this configuration the problem never occured.

If you find that the problem is still there either way, please let me know.

Wouter

Thanks! The latest release shows no sign of this issue, and toys are now working fine.

I have found another small issue with the ‘slice’ option in plotting, but I will post that as a seperate topic as soon as I have convinced myself that it isn’t something silly I am doing.

Conor