Repository navigation
Conversation
vepadulano
left a comment
There was a problem hiding this comment.
Thanks a lot @jmcarcell ! In principle LGTM, but I think having the extra test case would be helpful anyway, could you upload that too?
|
Test added, note that it is not for the leak, which is not tested for in CI. It hangs without |
vepadulano
left a comment
There was a problem hiding this comment.
Thanks! I believe we should wait for @pcanal 's opinion first. Meanwhile I'll start the CI 👍
| FIXTURES_REQUIRED root-tree-reader-WarnNoDict-fixture) | ||
|
|
||
| ROOTTEST_ADD_TEST(CreateChainNoDictFiles | ||
| MACRO CreateChainNoDictFiles.C+ |
There was a problem hiding this comment.
This is mostly a question for @pcanal , I wonder if with this syntax we run the risk of leaving artifacts in the test directory that the reading test might pick up and effectively still read a dictionary from? The ChainNoDict.C test already has a good check at lines 5-6, but what's your opinion?
There was a problem hiding this comment.
ACLiC doesn't generate a rootmap here, only CreateChainNoDictFiles_C.so, _C.d and _C_ACLiC_dict_rdict.pcm, so there is nothing that would trigger autoloading of the library when reading. I checked by running ChainNoDict() in the test directory with those files present: after reading both files ChainNoDictHit still has no dictionary and the library isn't loaded.
Test Results 24 files 24 suites 3d 23h 19m 48s ⏱️ For more details on these failures, see this check. Results for commit ca56ea2. ♻️ This comment has been updated with latest results. |
This Pull request:
Changes or fixes:
TBranchProxyowns the collection proxy it creates withGenerate()inSetup(), but only deletes it inReset(). It is leaked when theTBranchProxyis destroyed, and whenSetup()runs again after aTChainswitches files. This happens when reading split collections withTTreeReaderArray(and therefore RDataFrame), e.g.:fCollectionis now astd::unique_ptr. The deleter callsPopProxy()before deleting, because~TEmulatedCollectionProxy()clears the collection that is still pushed into the proxy. After aTChainfile switch, that collection belongs to a tree that has already been deleted. Deleting without popping hangs or crashes inTEmulatedCollectionProxy::Shrink()when reading a split collection of a class without a dictionary over a chain of several files. The member is marked as transient since I/O doesn't supportunique_ptrs with custom deleters.Checklist:
I tested this with LeakSanitizer (no leaks from
Generate()remain, and the values read are the same as before) and with the tree and dataframe tests.I haven't added a test for the leak itself: the ASan CI runs with
detect_leaks=0, so it would never fail. Instead, I could add a regression test for the reason the custom deleter is needed: a roottest pair inroottest/root/tree/reader, followingCreateWarnNoDictFile.C/WarnNoDict.C. A macro compiled with ACLiC writes two files with a splitstd::vectorof a struct. A second macro, run without that dictionary so that the collection proxy is emulated, reads one of its data members withTTreeReaderArrayover aTChainof both files and checks the values. WithoutPopProxy()in the deleter, this test hangs or, in the ASan build, reports a heap-use-after-free.