I have just started to test out RDataFrame with ROOT 6.14/04.
However, for some of my rootfiles, an attempt to plot a histogram of one of the simple tree branches causes a segmentation fault when used with ROOT::EnableImplicitMT().
For example, the following code works fine with the attached file (I have also tested with multiple files in the chain): data_stream42_3.root (250.1 KB)
//ROOT::EnableImplicitMT();
TChain h11;
h11.Add("data_stream42_*.root/INTERF/h1");
ROOT::RDataFrame d(h11);
auto h = d.Histo1D("Tof_e");
h->Draw();
However, if I uncomment the first line, h->Draw() results in a segfault with the backtrace as in the attached file: backtrace.txt (10.2 KB)
It might be important that the above rootfiles were produced using h2root from the HBOOK files. This error seems to occur for all kinds of my files produced this way (with different tree/ntuple structures).
I have tested with several files produced directly in ROOT and did not see the crash.
I would be grateful for any hints on what I might be doing wrong or if there is anything in the attached files that RDataFrame might not be compatible with.
I acknowledge the bug. The issue is caused by an internal ROOT component, TTreeProcessorMT, which is responsible for looping on a dataset in parallel. That component somehow fails to properly handle the tree inside a directory, like in your case.
The single threaded case works fine because the code path is different and TTreeProcessorMT is not used.
We will fix this asap (it will work in the nbext 6.14 patch release and in November’s 6.16 version). Thanks a lot for the report.
perhaps I can immediately provide a workaround for you: would it be possible to specify the name of the tree as name of the chain? (we’ll fix the general case anyway!)
ROOT::EnableImplicitMT();
TChain h11("INTERF/h1");
h11.Add("data_stream42_*.root");
ROOT::RDataFrame d(h11);
auto h = d.Histo1D("Tof_e");
h->Draw();