-
Notifications
You must be signed in to change notification settings - Fork 1.4k
TTree: Prevent access to already deleted scratch area #19938
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
TTree: Prevent access to already deleted scratch area #19938
Conversation
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.
Pull Request Overview
This PR addresses a bug in TTree where previously read data from a deleted scratch area could be accessed incorrectly for associative containers. The fix involves preventing duplicate reads on associative containers when the same entry is accessed multiple times, and ensures proper reset of read entry cursors for sub-branches.
Key changes:
- Added helper function to identify associative containers and prevent duplicate reads
- Modified entry reading logic to handle associative containers specially
- Added recursive reset functionality for sub-branch read cursors
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Test Results 21 files 21 suites 3d 13h 46m 11s ⏱️ Results for commit b1d4ac1. ♻️ This comment has been updated with latest results. |
Fix one case that had not been updated to support multimap/multiset.
4a7fa82
to
89425f5
Compare
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
89425f5
to
37ead82
Compare
37ead82
to
9d1ee9f
Compare
The flow for reading an STL associative container is: (a) Read branch count (b) load sub-branch data into a staging/temporary area (c) copy/insert that data into the associative container Previously doing a direct read like: tree->GetBranch("map.second")->GetEntry(e); was leading to 'write' into deleted memory.
This directly test the use pattern applied by TTree::Scan/Draw
This allow to document the 2 sets of similar test at the same place to contrast them
9d1ee9f
to
b1d4ac1
Compare
Fixes #19963