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

[12_3_X] Fix ThroughputServiceClient.cc unsigned variables overflow #38287

Merged
merged 1 commit into from
Jun 11, 2022

Conversation

pmandrik
Copy link
Contributor

@pmandrik pmandrik commented Jun 8, 2022

PR description:

TH1F FindFirstBinAbove() can return -1 [0] when hist is empty overflowing unsigned variables uint64_t first and uint64_t last. The next two loops for (unsigned int i = first; i <= last; ++i) became very long and hlt_clientPB DQM client is not able to exit in time when the run is ended. Affect Online DQM operation.

PR validation:

[0] https://root.cern.ch/doc/master/classTH1.html#a63960594f84aea92e5fa2d5129b49007

if this PR is a backport please specify the original PR and why you need to backport that PR:

backport of #38282

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 8, 2022

A new Pull Request was created by @pmandrik for CMSSW_12_3_X.

It involves the following packages:

  • HLTrigger/Timer (hlt)

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

cms-bot commands are listed here

@Martin-Grunewald
Copy link
Contributor

Will there be a 12_4_X backport?

@Martin-Grunewald
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 8, 2022

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-9bec22/25363/summary.html
COMMIT: f0138bf
CMSSW: CMSSW_12_3_X_2022-06-08-1100/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/38287/25363/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3628978
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3628954
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 205 log files, 45 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

@Martin-Grunewald
Copy link
Contributor

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_12_3_X IBs (tests are also fine) and once validation in the development release cycle CMSSW_12_5_X is complete. This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

Copy link
Contributor

@missirol missirol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a couple of suggestions that I think would have made the implementation simpler.

No need to apply them, since the PR in master has already been merged.

Thanks for the fix.

Comment on lines +124 to +125
int64_t first = sourced->FindFirstBinAbove(0.);
int64_t last = sourced->FindLastBinAbove(0.);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int64_t first = sourced->FindFirstBinAbove(0.);
int64_t last = sourced->FindLastBinAbove(0.);
auto first = sourced->FindFirstBinAbove(0.);
auto last = sourced->FindLastBinAbove(0.);

booker.setCurrentFolder(folder);
// (re)book and fill .../average_sourced
average = booker.book1D("average_sourced", "Throughput (sourced events)", (int)width, avg_min, avg_max)->getTH1F();
for (unsigned int i = first; i <= last; ++i)
for (int64_t i = std::max(first, (int64_t)0); i <= last; ++i)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (int64_t i = std::max(first, (int64_t)0); i <= last; ++i)
if(first >= 0)
for (auto i = first; i <= last; ++i)

@@ -135,7 +135,7 @@ void ThroughputServiceClient::fillSummaryPlots(DQMStore::IBooker &booker, DQMSto
booker.setCurrentFolder(folder);
// (re)book and fill .../average_retired
average = booker.book1D("average_retired", "Throughput (retired events)", (int)width, avg_min, avg_max)->getTH1F();
for (unsigned int i = first; i <= last; ++i)
for (int64_t i = std::max(first, (int64_t)0); i <= last; ++i)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (int64_t i = std::max(first, (int64_t)0); i <= last; ++i)
if(first >= 0)
for (auto i = first; i <= last; ++i)

@missirol
Copy link
Contributor

type bugfix

@qliphy
Copy link
Contributor

qliphy commented Jun 11, 2022

+1

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.

5 participants