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

Avoid accessing a destroyed object in V0Fitter #21195

Merged
merged 1 commit into from Nov 8, 2017

Conversation

Dr15Jones
Copy link
Contributor

References to internal data of a destructed temporary were being
passed to a function. Now the temporaries are 'pinned' to stay
on the stack.

References to internal data of a destructed temporary were being
passed to a function. Now the temporaries are 'pinned' to stay
on the stack.
@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2017

The code-checks are being triggered in jenkins.

@Dr15Jones
Copy link
Contributor Author

@Dr15Jones
Copy link
Contributor Author

@davidlt thought you'd want to know

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2017

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/PR-21195/1847

@Dr15Jones
Copy link
Contributor Author

please test

@davidlt
Copy link
Contributor

davidlt commented Nov 6, 2017

I have something similar done over weekend: #21172

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/24219/console Started: 2017/11/06 23:23

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2017

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

It involves the following packages:

RecoVertex/V0Producer

@perrotta, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@makortel, @felicepantaleo, @GiacomoSguazzoni, @rovere, @VinInn, @ebrondol, @dgulhan this is something you requested to watch as well.
@davidlange6, @slava77 you are the release manager for this.

cms-bot commands are listed here

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 7, 2017

-1

Tested at: f51a5e7

The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:
fcaeeab
You can see more details here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-21195/24219/git-log-recent-commits
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-21195/24219/git-merge-result

You can see the results of the tests here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-21195/24219/summary.html

I found follow errors while testing this PR

Failed tests: RelVals

  • RelVals:

When I ran the RelVals I found an error in the following worklfows:
10042.0 step5

runTheMatrix-results/10042.0_ZMM_13+ZMM_13TeV_TuneCUETP8M1_2017_GenSimFull+DigiFull_2017+RecoFull_2017+ALCAFull_2017+HARVESTFull_2017/step5_ZMM_13+ZMM_13TeV_TuneCUETP8M1_2017_GenSimFull+DigiFull_2017+RecoFull_2017+ALCAFull_2017+HARVESTFull_2017.log

The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:
fcaeeab
You can see more details here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-21195/24219/git-log-recent-commits
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-21195/24219/git-merge-result

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 7, 2017

Comparison not run due to runTheMatrix errors (RelVals and Igprof tests were also skipped)

@perrotta
Copy link
Contributor

perrotta commented Nov 7, 2017

This is similar to #21172, which lacks however the protection
if (!posImpact.isValid() || !negImpact.isValid()) continue;
and makes a copy of the wto TrajectoryStateClosestToPoint's

@Dr15Jones @davidlt : we have to evaluate which is preferable, and close the other PR, your opinion is welcome!

@davidlt
Copy link
Contributor

davidlt commented Nov 7, 2017

I kept the original line: if (!posTransTkPtr->impactPointTSCP().isValid() || !negTransTkPtr->impactPointTSCP().isValid()) continue; because that is still fine according to C++ rules. The temporaries are "existing" until ";" (simplified explanation) and we don't save anything on this line. Thus I didn't move this line.

auto const& negImpact = negTransTkPtr->impactPointTSCP();
if (!posImpact.isValid() || !negImpact.isValid()) continue;
FreeTrajectoryState const & posState = posImpact.theState();
FreeTrajectoryState const & negState = negImpact.theState();
Copy link
Contributor

@slava77 slava77 Nov 7, 2017

Choose a reason for hiding this comment

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

this is semantically simpler in terms of copies.

Copy link
Contributor

Choose a reason for hiding this comment

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

if you grep for "impactPointTSCP" you will find the same style allovertheplace
(and is not minimal only in terms of copy also in terms of virtual call and actual computation...)

Copy link
Contributor

Choose a reason for hiding this comment

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

@VinInn
my comment was in context of this scope and was comparing to #21172 .
Does your comment change something in this context? I may be missing something otherwise.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, not in this scope (even if I am not sure auto const& is correct and should not be
auto const.
I was only saying that there are many other places where isValid si first tested on the fly and then impactPointTSCP accesses again...
see
https://cmssdt.cern.ch/dxr/CMSSW/source/L1Trigger/L1TNtuples/plugins/L1MuonRecoTreeProducer.cc#829
fro instance

Copy link
Contributor

Choose a reason for hiding this comment

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

@Dr15Jones could you also look/fix lines 176-177 in your patch? When I checked DXR trajectoryStateClosestToPoint also returns a copy: https://github.com/cms-sw/cmssw/blob/master/TrackingTools/TransientTrack/interface/BasicTransientTrack.h#L51

Copy link
Contributor

Choose a reason for hiding this comment

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

@Dr15Jones ignore my comment above, const extends temporary lifetime in those lines.

@slava77
Copy link
Contributor

slava77 commented Nov 7, 2017

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 7, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/24222/console Started: 2017/11/07 09:14

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 7, 2017

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 7, 2017

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 7, 2017

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

There are some workflows for which there are errors in the baseline:
10042.0 step 5
The results for the comparisons for these workflows could be incomplete
This means most likely that the IB is having errors in the relvals.The error does NOT come from this pull request

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 26
  • DQMHistoTests: Total histograms compared: 2755261
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2755091
  • DQMHistoTests: Total skipped: 169
  • DQMHistoTests: Total Missing objects: 0
  • Checked 107 log files, 10 edm output root files, 26 DQM output files

@slava77
Copy link
Contributor

slava77 commented Nov 7, 2017

+1

for #21195 f51a5e7

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 7, 2017

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. @davidlange6, @slava77, @smuzaffar (and backports should be raised in the release meeting by the corresponding L2)

@davidlange6
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit a876a2e into cms-sw:master Nov 8, 2017
@perrotta
Copy link
Contributor

perrotta commented Nov 8, 2017

Just for the record: this PR addresses issue #21105, not #21173 (for which a fix is proposed in #21214. instead)

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

7 participants