RooMCStudy example failure

Hey, I tried to run the RooMCStudy example found in several of Wouter Verkerke’s documents and presentations. The code is:

RooRealVar x(“x”, “x”, -5, 15);
RooRealVar mean(“mean”, “mean of gaussian”, -1);
RooRealVar sigma(“sigma”, “width of gaussian”, 4);
RooGaussian gauss(“gauss”, “gaussian PDF”, x, mean, sigma);

    RooMCStudy mgr(gauss, gauss, x, "", "mhv");

    mgr.generateAndFit(1000, 100);


However my generateAndFit function claims that gauss is constant, then throws a segfault. if I run

where test.C is the macro above,

I get the following output:

[code]root [0]
Processing test.C…

RooFit v3.55 – Developed by Wouter Verkerke and David Kirkby
Copyright © 2000-2012 NIKHEF, University of California & Stanford University
All rights reserved, please read

RooMCStudy: now generating 100 events
[#1] INFO:Minization – RooMinuit::optimizeConst: activating const optimization
[#1] INFO:Minization – The following expressions have been identified as constant and will be precalculated and cached: (gauss)
[#1] INFO:Minization – RooMinuit::optimizeConst: deactivating const optimization

*** Break *** segmentation violation

There was a crash.
This is the entire stack trace of all threads:

I’m using root v5.34.04
Any idea what is going wrong here?