Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched from boost::regex to std::regex #18720

Merged
merged 1 commit into from May 13, 2017

Conversation

Dr15Jones
Copy link
Contributor

Doing a helgrind check uncovered a thread unsafe memory handling
by boost::regex. Switching to std::regex solves that and reduces
dependency on boost.

Doing a helgrind check uncovered a thread unsafe memory handling
by boost::regex. Switching to std::regex solves that and reduces
dependency on boost.
@cmsbuild
Copy link
Contributor

A new Pull Request was created by @Dr15Jones (Chris Jones) for master.

It involves the following packages:

HLTrigger/HLTcore

@Martin-Grunewald, @silviodonato, @cmsbuild, @fwyzard, @davidlange6 can you please review it and eventually sign? Thanks.
@Martin-Grunewald this is something you requested to watch as well.
@davidlange6 you are the release manager for this.

cms-bot commands are listed here

@Dr15Jones
Copy link
Contributor Author

Running a helgrind job on reconstruction uncovered

==660649== Possible data race during write of size 4 at 0x2CB06718 by thread #4
==660649== Locks held: none
==660649==    at 0x4C1132A: boost::re_detail_106300::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_imp() (in /cvmfs/cms-ib.cern.ch/nweek-02471/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_2_X_2017-05-10-1100/lib/slc6_amd64_gcc530/libFWCoreFramework.so)
==660649==    by 0x499F605B: HLTConfigProvider::matched(std::vector<std::string, std::allocator<std::string> > const&, std::string const&) (in /cvmfs/cms-ib.cern.ch/nweek-02471/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_2_X_2017-05-10-1100/lib/slc6_amd64_gcc530/libHLTriggerHLTcore.so)
==660649==    by 0x499F665F: HLTConfigProvider::restoreVersion(std::vector<std::string, std::allocator<std::string> > const&, std::string const&) (in /cvmfs/cms-ib.cern.ch/nweek-02471/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_2_X_2017-05-10-1100/lib/slc6_amd64_gcc530/libHLTriggerHLTcore.so)
==660649==    by 0x4B3FC72E: GenericTriggerEventFlag::expandLogicalExpression(std::vector<std::string, std::allocator<std::string> > const&, std::string const&, bool) const (in /cvmfs/cms-ib.cern.ch/nweek-02471/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_2_X_2017-05-10-1100/lib/slc6_amd64_gcc530/libCommonToolsTriggerUtils.so)
==660649==    by 0x4B3FEDE9: GenericTriggerEventFlag::initRun(edm::Run const&, edm::EventSetup const&) (in /cvmfs/cms-ib.cern.ch/nweek-02471/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_2_X_2017-05-10-1100/lib/slc6_amd64_gcc530/libCommonToolsTriggerUtils.so)
==660649==    by 0x51070DEB: METAnalyzer::dqmBeginRun(edm::Run const&, edm::EventSetup const&) (in /cvmfs/cms-ib.cern.ch/nweek-02471/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_2_X_2017-05-10-1100/lib/slc6_amd64_gcc530/pluginDQMOfflineJetMET.so)
==660649==    by 0x139151E6: DQMEDAnalyzer::beginRun(edm::Run const&, edm::EventSetup const&) (in /cvmfs/cms-ib.cern.ch/nweek-02471/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_2_X_2017-05-10-1100/lib/slc6_amd64_gcc530/libDQMServicesCore.so)
==660649==    by 0x4C55CEA: edm::stream::EDAnalyzerAdaptorBase::doStreamBeginRun(edm::StreamID, edm::RunPrincipal const&, edm::EventSetup const&, edm::ModuleCallingContext const*) (in /cvmfs/cms-ib.cern.ch/nweek-02471/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_2_X_2017-05-10-1100/lib/slc6_amd64_gcc530/libFWCoreFramework.so)

From boosts documentation, boost::regex library is thread safe if BOOST_HAS_THREADS was set. I tested building HLTConfigProvider and did find that value set. It is possible that boost is using some non-mutex synchronization to keep the memory safe and therefore helgrind has a false positive. However, switching to std::regex (which we've been doing elsewhere) reduces our dependency on boost and furthers our use of the standard library.

@fwyzard
Copy link
Contributor

fwyzard commented May 12, 2017

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented May 12, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/19799/console Started: 2017/05/12 21:52

@fwyzard
Copy link
Contributor

fwyzard commented May 12, 2017

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs after it passes the integration tests. This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @smuzaffar

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-18720/19799/summary.html

Comparison Summary:

  • You potentially added 167 lines to the logs
  • Reco comparison results: 3360 differences found in the comparisons
  • DQMHistoTests: Total files compared: 24
  • DQMHistoTests: Total histograms compared: 1830696
  • DQMHistoTests: Total failures: 62688
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 1767828
  • DQMHistoTests: Total skipped: 180
  • DQMHistoTests: Total Missing objects: 0
  • Checked 98 log files, 14 edm output root files, 24 DQM output files

@davidlange6
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 6e69de8 into cms-sw:master May 13, 2017
@Dr15Jones Dr15Jones deleted the changeToStdRegex branch May 18, 2017 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants