-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Improve BDT in L1Trigger/L1TMuonEndCap #47599
base: master
Are you sure you want to change the base?
Conversation
cms-bot internal usage |
please test |
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47599/44099
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
|
||
Node::~Node() { | ||
// Recursively delete all nodes in the tree. | ||
if (leftDaughter) |
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.
NOTE: using the defaultly made Node(Node&&)
with this implementation of a destructor leads to double delete of leftDaughter
and rightDaughter
as the default Node(Node&&)
will not reset the pointers to nullptr
.
@@ -135,24 +121,14 @@ void Tree::findLeafs(Node* local_root, std::list<Node*>& tn) { | |||
findLeafs(local_root->getRightDaughter(), tn); | |||
} | |||
|
|||
Tree::Tree(Tree&& tree) { | |||
if (rootNode) |
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.
This is the problem spotted by gcc 14. rootNode
is uninitialized at this point so the following line deletes some random address.
- fixed memory corruption problems which could lead to double deletes or deletion of random memory locations - memory handling now done via std::unique_ptr - improved const correctness
7e93e60
to
96be2a4
Compare
please test |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47599/44100
|
A new Pull Request was created by @Dr15Jones for master. It involves the following packages:
@aloeliger, @epalencia can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
(just to remind, the code improved in this PR is uses substantial amount of memory as reported in #42526) |
+1 Size: This PR adds an extra 36KB to repository Comparison SummarySummary:
|
PR description:
This deletion of memory coming from an uninitialized pointer was found by gcc 14.
PR validation:
Code compiles and local tests pass.
resolves cms-sw/framework-team#1307