-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
TBufferMerger cannot handle TTree spanning over multiple files #6523
Comments
Update: see the gist for some comments from Philippe. |
One way to go about this would be to mimic the suggested usage of the TFile the TTree is attached to as per the One of the main limitations I see is that TBufferMerger is hardwired to the initial TFile it is constructed with. Supposing we modify |
Since merging implies the intention of creating a single file at the end, I recommend disabling the mechanism to change files by setting the max |
A better option for disabling the mechanism that I just considered with @vepadulano is to change |
Describe the bug
This is a continuation of a jira issue originally found in multithreaded RDF ROOT-10896.
If a TTree spans over multiple files (i.e. when its size is higher than
fgMaxTreeSize
) TBufferMerger cannot correctly save its contents to the (multiple) TBufferMergerFile(s) in its queue. This is due to the original TFile being deleted inTTree::ChangeFile
but not updated in TBufferMergerFile which then holds a dangling pointer. The program crashes with the following stacktrace (not really helpful even with debug symbols enabled in ROOT as well):Expected behavior
The program doesn't crash. TBufferMergerFile is updated alongside the tree (i.e. it should be the same pointer as
TTree::GetCurrentFile()
) and the partial files are correctly saved when the TTree changes to new ones.To Reproduce
See the following gist:
https://gist.github.com/vepadulano/fc09150516193f1a801e0991591958ee
Setup
cmake -GNinja -Ddev=ON -DCMAKE_BUILD_TYPE=Debug -Dtesting=ON -Droottest=ON
Additional Context
Some print statements from
gdb
, also commented in the gist.Before filling the TTree we can see that the current TFile of the tree is correctly the TBufferMergerFile (
tbmfile
):But after the event loop the TTree changes files twice and the latest file it points to is called "tbuffermerger_sequential_2.root", but this is not reflected correctly in the TBufferMergerFile:
The text was updated successfully, but these errors were encountered: