PDF Print segfault via HypoTestInverter if AsymptoticError(true) in pre-fit

Hello,

I’ve run into a rather peculiar segfault after transitioning to ROOT 6.28/00 from 6.26. It doesn’t crash with 6.26/08.

I can reproduce this segfault with the StandardHypoTestInvDemo.C with calc type = 0 (freq / toys) and by adding AsymptoticError(true) to the fitTo() args here root/StandardHypoTestInvDemo.C at master · root-project/root · GitHub It doesn’t crash with this extra option if the calc type is 2 (asymptotic). My naive understanding is that this provides better errors on the parameters.

The odd part is that, from what I can tell, it’s crashing in ModelConfig->Print() → PDF->Print():
https://root.cern.ch/doc/master/ModelConfig_8cxx_source.html#l00158
after the HypoTestInverter::GetInterval() call.

If it’s useful, I have attached the test workspace I’m using:
SPlusB_combined_NormalMeasurement_model_afterFit.root (27.6 KB)
The workspace name is ‘w’.

Thanks,
Jonathan

Stack Trace:

#4 0x00007f323b143f15 in TUnixSystem::DispatchSignals(ESignals) () from root-install/root-6.28.00-dl/lib/libCore.so.6.28
#5
#6 0x00007f321e414271 in RooAbsArg::dependsOn(RooAbsCollection const&, RooAbsArg const*, bool) const () from root-install/root-6.28.00-dl/lib/libRooFitCore.so.6.28.00
#7 0x00007f321e41753e in RooAbsArg::getObservables(RooAbsCollection const*, RooArgSet&, bool) const () from root-install/root-6.28.00-dl/lib/libRooFitCore.so.6.28.00
#8 0x00007f321e5f1c46 in RooNormSetCache::autoCache(RooAbsArg const*, RooArgSet const*, RooArgSet const*, TNamed const*, bool) () from root-install/root-6.28.00-dl/lib/libRooFitCore.so.6.28.00
#9 0x00007f321e40d4ca in RooCacheManager::getObj(RooArgSet const*, RooArgSet const*, int*, TNamed const*) () from root-install/root-6.28.00-dl/lib/libRooFitCore.so.6.28.00
#10 0x00007f321e473227 in RooAbsPdf::syncNormalization(RooArgSet const*, bool) const () from root-install/root-6.28.00-dl/lib/libRooFitCore.so.6.28.00
#11 0x00007f321e46cc7f in RooAbsPdf::getNorm(RooArgSet const*) const () from root-install/root-6.28.00-dl/lib/libRooFitCore.so.6.28.00
#12 0x00007f321e64ede5 in RooRealSumPdf::expectedEvents(RooArgSet const*) const () from root-install/root-6.28.00-dl/lib/libRooFitCore.so.6.28.00
#13 0x00007f321e619809 in RooProdPdf::expectedEvents(RooArgSet const*) const () from root-install/root-6.28.00-dl/lib/libRooFitCore.so.6.28.00
#14 0x00007f321e66c609 in RooSimultaneous::evaluate() const () from root-install/root-6.28.00-dl/lib/libRooFitCore.so.6.28.00
#15 0x00007f321e46b2a8 in RooAbsPdf::printValue(std::ostream&) const () from root-install/root-6.28.00-dl/lib/libRooFitCore.so.6.28.00
#16 0x00007f321e614018 in RooPrintable::printStream(std::ostream&, int, RooPrintable::StyleOption, TString) const () from root-install/root-6.28.00-dl/lib/libRooFitCore.so.6.28.00
#17 0x00007f321d42be2b in RooStats::ModelConfig::Print(char const*) const () from root-install/root-6.28.00-dl/lib/libRooStats.so.6.28.00
#18 0x00007f321d42c9da in RooStats::ModelConfig::GuessObsAndNuisance(RooAbsData const&, bool) () from root-install/root-6.28.00-dl/lib/libRooStats.so.6.28.00
#19 0x00007f321d3eff21 in RooStats::HypoTestCalculatorGeneric::GetHypoTest() const () from root-install/root-6.28.00-dl/lib/libRooStats.so.6.28.00
#20 0x00007f321d3f3329 in RooStats::HypoTestInverter::Eval(RooStats::HypoTestCalculatorGeneric&, bool, double) const () from root-install/root-6.28.00-dl/lib/libRooStats.so.6.28.00
#21 0x00007f321d3f44d6 in RooStats::HypoTestInverter::RunOnePoint(double, bool, double) const () from root-install/root-6.28.00-dl/lib/libRooStats.so.6.28.00
#22 0x00007f321d3f5374 in RooStats::HypoTestInverter::RunFixedScan(int, double, double, bool) const () from root-install/root-6.28.00-dl/lib/libRooStats.so.6.28.00
#23 0x00007f321d3f7fa4 in RooStats::HypoTestInverter::GetInterval() const () from root-install/root-6.28.00-dl/lib/libRooStats.so.6.28.00
#24 0x00007f32323436fd in RooStats::HypoTestInvTool::RunInverter(RooWorkspace*, char const*, char const*, char const*, int, int, bool, int, double, double, int, bool, char const*) () from debug/StandardHypoTestInvDemo_C.so
#25 0x00007f3232347573 in StandardHypoTestInvDemo(char const*, char const*, char const*, char const*, char const*, int, int, bool, int, double, double, int, bool, char const*) () from debug/StandardHypoTestInvDemo_C.so

Hi, thanks for the report! Can you tell me which constructor arguments you used the get the crash? If I try this for example, I don’t get the crash:

StandardHypoTestInvDemo("SPlusB_combined_NormalMeasurement_model_afterFit.root", "w", "ModelConfig", "", "obsData", 0, 0)

Hi @jonas ,

I edited the script at line ~266 to be:

void StandardHypoTestInvDemo(const char *infile = "SPlusB_combined_NormalMeasurement_model_afterFit.root",
                             const char *wsName = "w",
                             const char *modelSBName = "ModelConfig", const char *modelBName = "",
                             const char *dataName = "obsData", int calculatorType = 0, int testStatType = 3,
                             bool useCLs = true, int npoints = 6, double poimin = 0, double poimax = 5,
                             int ntoys = 1000, bool useNumberCounting = false, const char *nuisPriorName = 0)

The changes from the default being: the input, wsName, and testStatType = 3 instead of 0. Sorry, I missed including this last point on the stat type, which indeed does not crash for me if I revert it to 0 (LEP).

Best,
Jonathan

Bump to avoid closing this before follow-up. If there is an issue or other tracker to follow, I’m happy to do so.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.