[df] Manage resources created via TFile::Get#21964
[df] Manage resources created via TFile::Get#21964dpiparo merged 2 commits intoroot-project:masterfrom
Conversation
Test Results 22 files 22 suites 3d 9h 57m 40s ⏱️ Results for commit e651291. ♻️ This comment has been updated with latest results. |
|
Also fixes #21987 since the two issues stem from the same pattern. |
There was a problem hiding this comment.
According to my local tests on my branch: the full valgrind memleak report only disappared after I added:
Maybe with your approach this is not needed anymore, but it would still be useful to add a comment into TFile.cxx as to why key is not deleted / purposely leaked if StreamerInfo not found.
* Simplify logic to ensure output file is ready for snapshot * Avoid unnecessarily calling TFile::Get and prefer TFile::GetKey to check for presence of object
I don't see the originally reported leaks with valgrind anymore. There's something weird I still see with the original reproducer: Which to me looks like a false positive since that line is using standard |
Yep, saw the same. I don't think it's a false positive, since it got solved with: |
|
@ferdymercury now I understand what you mean, apologies for being slow! I see that's indeed another leak, good catch! I think that deserves a separate PR on its own (probably can be reproduced standalone even without RDF). |
|
@ferdymercury I have created a reproducer and issue for the TFile::Open leak at #21997 |
|
@dpiparo this should go to 6.40 |
|
Let's put it in 6.40.00-rc1 |
| } else { | ||
| outFile->Delete(treeName.c_str()); | ||
| // Ensure deletion of object and all its cycles. | ||
| outFile->Delete((objName + ";*").c_str()); |
There was a problem hiding this comment.
That feels wrong. What if the object is semantically the same? In that case this deletes all previous 'backup' copies of the object, is that really the intent? (usually the over-write only over-write the lastest key and keeps the backup)?
Related though, the TTree::Delete("all"); has no choice but to delete also the backup copies since it removes from the files all the TBasket that they share.
Fixes #21962