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
DetectorDescription Clang Crash Bug Fix #20002
Conversation
please test |
The tests are being triggered in jenkins. |
A new Pull Request was created by @ianna (Ianna Osborne) for master. It involves the following packages: DetectorDescription/Core @cmsbuild, @civanch, @Dr15Jones, @ianna, @mdhildreth can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@@ -16,6 +16,9 @@ std::ostream & operator<<(std::ostream &, const DDRotation &); | |||
DDRotation DDrot(const DDName & name, | |||
DDRotationMatrix * rot); | |||
|
|||
DDRotation * DDrotPtr(const DDName & name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about returing a std::unique_ptr<DDRotation>
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I have much more then that :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but as this stands, is this a memory leak?
please test |
The tests are being triggered in jenkins. |
type bugfix |
+1 The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: |
Comparison job queued. |
+1 |
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, @smuzaffar (and backports should be raised in the release meeting by the corresponding L2) |
This was not a case of clang doing something 'wrong'. The previous code was always wrong since by the C++ standard the object is always deleted at the end of its scope. The pointer in question was always pointing to deleted memory. What probably happened with clang is clang decided to re-use that space on the stack where the object used to be while gcc probably was using additional space on the stack. The new code does the right thing. |
I agree, the code was not up to the standard - we would have hit this problem at some point with gcc. |
Comparison is ready Comparison Summary:
|
+1 |
@Dr15Jones and @smuzaffar - FYI