Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-7791

Fitting histogram is not thread safe

    XMLWordPrintable

    Details

      Description

      Even after calling TMinuitMinimizer::UseStaticMinuit(false) we are seeing a crash when running threads. The relevant traceback

      #5 0x0000000000000000 in ?? ()
      #6 0x00007f2232be2d87 in ROOT::Fit::Fitter::~Fitter() () from /afs/cern.ch/cms/sw/ReleaseCandidates/vol0/slc6_amd64_gcc493/cms/cmssw-patch/CMSSW_8_0_THREADED_X_2015-11-10-1100/external/slc6_amd64_gcc493/lib/libMathCore.so
      #7 0x00007f222abf2992 in TBackCompFitter::~TBackCompFitter() () from /afs/cern.ch/cms/sw/ReleaseCandidates/vol0/slc6_amd64_gcc493/cms/cmssw-patch/CMSSW_8_0_THREADED_X_2015-11-10-1100/external/slc6_amd64_gcc493/lib/libHist.so
      #8 0x00007f222abf29d9 in TBackCompFitter::~TBackCompFitter() () from /afs/cern.ch/cms/sw/ReleaseCandidates/vol0/slc6_amd64_gcc493/cms/cmssw-patch/CMSSW_8_0_THREADED_X_2015-11-10-1100/external/slc6_amd64_gcc493/lib/libHist.so
      #9 0x00007f222abe269a in TFitResultPtr HFit::Fit
      (TH1*, TF1*, Foption_t&, ROOT::Math::MinimizerOptions const&, char const*, ROOT::Fit::DataRange&) () from /afs/cern.ch/cms/sw/ReleaseCandidates/vol0/slc6_amd64_gcc493/cms/cmssw-patch/CMSSW_8_0_THREADED_X_2015-11-10-1100/external/slc6_amd64_gcc493/lib/libHist.so
      #10 0x00007f222abde705 in ROOT::Fit::FitObject(TH1*, TF1*, Foption_t&, ROOT::Math::MinimizerOptions const&, char const*, ROOT::Fit::DataRange&) () from /afs/cern.ch/cms/sw/ReleaseCandidates/vol0/slc6_amd64_gcc493/cms/cmssw-patch/CMSSW_8_0_THREADED_X_2015-11-10-1100/external/slc6_amd64_gcc493/lib/libHist.so
      #11 0x00007f222ac65af4 in TH1::Fit(TF1*, char const*, char const*, double, double) () from /afs/cern.ch/cms/sw/ReleaseCandidates/vol0/slc6_amd64_gcc493/cms/cmssw-patch/CMSSW_8_0_THREADED_X_2015-11-10-1100/external/slc6_amd64_gcc493/lib/libHist.so
      #12 0x00007f2214c5f407 in HIPixelMedianVtxProducer::produce(edm::Event&, edm::EventSetup const&) () from /afs/cern.ch/cms/sw/ReleaseCandidates/vol0/slc6_amd64_gcc493/cms/cmssw/CMSSW_8_0_THREADED_X_2015-11-08-1100/lib/slc6_amd64_gcc493/pluginRecoHIHiTrackingPlugins.so

      I traced the problem to

      https://root.cern.ch/doc/master/HFitImpl_8cxx_source.html#l00410

      The problem is the chain TVirtualFitter::GetFitter() then delete then call to TVirtualFitter::SetFitter().

      One possible way to fix this is to make the static class as thread_local
      https://root.cern.ch/doc/master/TVirtualFitter_8h_source.html#l00052

        Attachments

          Activity

            People

            • Assignee:
              pcanal Philippe Canal
              Reporter:
              chrjones Christopher Jones
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: