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

L1 DT AM - heap-buffer-overflow fix + slight logic improvement in confirmed TPs #39411

Merged
merged 3 commits into from
Oct 5, 2022

Conversation

jaimeleonh
Copy link
Contributor

@jaimeleonh jaimeleonh commented Sep 16, 2022

PR description:

This PR tries to solve issue #39338, where a heap-buffer-overflow error was encountered and associated to one line in the MPQuality filter. It also includes some improved logic in a different class.

PR validation:

Passed code-format and code-checks tests

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39411/32123

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @jaimeleonh (Jaime Leon Holgado) for master.

It involves the following packages:

  • L1Trigger/DTTriggerPhase2 (upgrade, l1)

@rekovic, @epalencia, @cmsbuild, @AdrianoDee, @srimanob, @cecilecaillol can you please review it and eventually sign? Thanks.
@battibass, @JanFSchulte, @Martin-Grunewald, @missirol, @trtomei, @beaucero this is something you requested to watch as well.
@perrotta, @dpiparo, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@cecilecaillol
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b7785b/27594/summary.html
COMMIT: 752f9ba
CMSSW: CMSSW_12_6_X_2022-09-15-2300/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/39411/27594/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: 51
  • DQMHistoTests: Total histograms compared: 3618332
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3618308
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 50 files compared)
  • Checked 212 log files, 49 edm output root files, 51 DQM output files
  • TriggerResults: no differences found

@cecilecaillol
Copy link
Contributor

+l1

Comment on lines 409 to 427
if (dtLId.layer() != best_layer) {
minx = std::abs(x_inSL3 - x_wire);
next_wire = best_wire;
next_tdc = best_tdc;
next_layer = best_layer;
next_lat = best_lat;

best_wire = (*digiIt).wire();
best_tdc = (*digiIt).time();
best_layer = dtLId.layer();
best_lat = lat;
matched_digis++;
} else if (dtLId.layer() ==
best_layer) { // same layer than stored, just substituting the hit, no matched_digis++;
best_wire = (*digiIt).wire();
best_tdc = (*digiIt).time();
best_layer = dtLId.layer();
best_lat = lat;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not:

Suggested change
if (dtLId.layer() != best_layer) {
minx = std::abs(x_inSL3 - x_wire);
next_wire = best_wire;
next_tdc = best_tdc;
next_layer = best_layer;
next_lat = best_lat;
best_wire = (*digiIt).wire();
best_tdc = (*digiIt).time();
best_layer = dtLId.layer();
best_lat = lat;
matched_digis++;
} else if (dtLId.layer() ==
best_layer) { // same layer than stored, just substituting the hit, no matched_digis++;
best_wire = (*digiIt).wire();
best_tdc = (*digiIt).time();
best_layer = dtLId.layer();
best_lat = lat;
}
if (dtLId.layer() != best_layer) {
minx = std::abs(x_inSL3 - x_wire);
next_wire = best_wire;
next_tdc = best_tdc;
next_layer = best_layer;
next_lat = best_lat;
matched_digis++;
}
best_wire = (*digiIt).wire();
best_tdc = (*digiIt).time();
best_layer = dtLId.layer();
best_lat = lat;

// buggy, as we could have stored as next LayerX -> LayerY -> LayerX, and this should
// count only as 2 hits. However, as we confirm with at least 2 hits, having 2 or more
// makes no difference
else if (dtLId.layer() != next_layer)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the else if needed after a continue in case of the complementary possibility?

Comment on lines 644 to 662
if (dtLId.layer() != best_layer) {
minx = std::abs(x_inSL1 - x_wire);
next_wire = best_wire;
next_tdc = best_tdc;
next_layer = best_layer;
next_lat = best_lat;

best_wire = (*digiIt).wire();
best_tdc = (*digiIt).time();
best_layer = dtLId.layer();
best_lat = lat;
matched_digis++;
} else if (dtLId.layer() ==
best_layer) { // same layer than stored, just substituting the hit, no matched_digis++;
best_wire = (*digiIt).wire();
best_tdc = (*digiIt).time();
best_layer = dtLId.layer();
best_lat = lat;
}
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
if (dtLId.layer() != best_layer) {
minx = std::abs(x_inSL1 - x_wire);
next_wire = best_wire;
next_tdc = best_tdc;
next_layer = best_layer;
next_lat = best_lat;
best_wire = (*digiIt).wire();
best_tdc = (*digiIt).time();
best_layer = dtLId.layer();
best_lat = lat;
matched_digis++;
} else if (dtLId.layer() ==
best_layer) { // same layer than stored, just substituting the hit, no matched_digis++;
best_wire = (*digiIt).wire();
best_tdc = (*digiIt).time();
best_layer = dtLId.layer();
best_lat = lat;
}
if (dtLId.layer() != best_layer) {
minx = std::abs(x_inSL1 - x_wire);
next_wire = best_wire;
next_tdc = best_tdc;
next_layer = best_layer;
next_lat = best_lat;
matched_digis++;
}
best_wire = (*digiIt).wire();
best_tdc = (*digiIt).time();
best_layer = dtLId.layer();
best_lat = lat;

Comment on lines 671 to 672
else if (dtLId.layer() != next_layer)
matched_digis++;
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
else if (dtLId.layer() != next_layer)
matched_digis++;
matched_digis++;

L1Trigger/DTTriggerPhase2/src/MuonPathAssociator.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@perrotta perrotta left a comment

Choose a reason for hiding this comment

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

I am not asking for updating the PR, just take into account these possible simplifications in case you need to update it further eventually

@perrotta
Copy link
Contributor

@jaimeleonh , do I understand correctly that the bug fix for #39338 is not included in this PR any more? Or could you please point it out to me which is the code change that fixes it?

@jaimeleonh
Copy link
Contributor Author

@jaimeleonh , do I understand correctly that the bug fix for #39338 is not included in this PR any more? Or could you please point it out to me which is the code change that fixes it?

The bug fix is included in the changes in L1Trigger/DTTriggerPhase2/src/MPQualityEnhancerFilter.cc.

@srimanob
Copy link
Contributor

srimanob commented Oct 2, 2022

@cmsbuild please test

Just re-trigger the test after 2 weeks.

@srimanob
Copy link
Contributor

srimanob commented Oct 2, 2022

@jaimeleonh @perrotta
Sorry to miss this PR. Do we converge on this? I still see suggestion which is not answered. Thanks.

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 2, 2022

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b7785b/27909/summary.html
COMMIT: 6b32207
CMSSW: CMSSW_12_6_X_2022-10-02-0000/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/39411/27909/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

@slava77 comparisons for the following workflows were not done due to missing matrix map:

  • /data/cmsbld/jenkins/workspace/compare-root-files-short-matrix/data/PR-b7785b/41834.0_TTbar_14TeV+2026D94+TTbar_14TeV_TuneCP5_GenSimHLBeamSpot14+DigiTrigger+RecoGlobal+HARVESTGlobal

Summary:

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

@srimanob
Copy link
Contributor

srimanob commented Oct 5, 2022

Hi @jaimeleonh @cms-sw/l1-l2
What will be follow up of this PR? Thx.

@jaimeleonh
Copy link
Contributor Author

Hi @jaimeleonh @cms-sw/l1-l2 What will be follow up of this PR? Thx.

Sorry, I missed your previous comment. What I understood from @perrotta is that his last suggestions didn't have to be included in this PR, so I left them for future PRs. I resolved the conversation about these suggestions in any case.

@srimanob
Copy link
Contributor

srimanob commented Oct 5, 2022

+Upgrade

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 5, 2022

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

@@ -390,6 +390,8 @@ void MuonPathAssociator::correlateMPaths(edm::Handle<DTDigiCollection> dtdigis,
double x_inSL3 = SL1metaPrimitive->x - SL1metaPrimitive->tanPhi * (VERT_PHI1_PHI3 + l_shift);
for (auto digiIt = (dtLayerId_It.second).first; digiIt != (dtLayerId_It.second).second; ++digiIt) {
DTWireId wireId(dtLId, (*digiIt).wire());
Copy link
Contributor

Choose a reason for hiding this comment

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

Still for a possible future improvement: this can be moved after L394, so that it gets only executed if needed

@perrotta
Copy link
Contributor

perrotta commented Oct 5, 2022

+1

  • Bearing in mind that some further optimization is possible (and welcome)

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