Home | News | Documentation | Download

RDataFrame from root command line - exceptions causing root exit

Hi Enrico,
This is probably another question you ^_^.

I am starting to get more familiar with the RDataFrame and how to efficiently use it, thank you for your previous help.

While learning RDataFrame, and while exploring a dataset, I find the ROOT interpreter very valuable to quickly try some things out. This is actually one of the reasons I am trying to adopt RDataFrame. However, my typing skills (and memory) could improve, so rather frequently my commands have one typo or another. See below.

With some typos, ROOT will gracefully point out what I did wrong, with some there is a very large crash report, and with some the uncaught exception ends the session.
I was wondering if there is a way to make at least the last case more tolerant to typos?
Maybe there is some way to catch the exceptions?


Example - First error is gracefully handled, second error ends the session.

root [4] auto h =fnode.Hist1D("not_available_name")
ROOT_prompt_4:1:15: error: no member named 'Hist1D' in 'ROOT::RDF::RInterface<ROOT::Detail::RDF::RNodeBase, void>'
auto h =fnode.Hist1D("not_available_name")
        ~~~~~ ^
root [5] auto h =fnode.Histo1D("not_available_name")
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Unknown column: not_available_name

Please read tips for efficient and successful posting and posting code

ROOT Version: 6.22.99
Platform: MacOS & Centos 7
Compiler: clang 11.03 & gcc 9.3.0

Hi @maurik,
I would say this is a problem with the interpreter itself rather than RDataFrame.
I think the interpreter tries its best to return to a sane state after an exception is thrown, but sometimes it doesn’t fully manage.

I cannot reproduce this specific problem on linux, however (I tried with ROOT master as well as v6.22, installed via conda):

root [0] auto df = ROOT::RDataFrame(10)                                                                                                                                       
(ROOT::RDataFrame &) An empty data frame that will create 10 entries                                                                                                          
root [1] auto h = df.Hist1D("..")                                                                                                                                             
ROOT_prompt_1:1:13: error: no member named 'Hist1D' in 'ROOT::RDataFrame'                                                                                                     
auto h = df.Hist1D("..")                                                                                                                                                      
         ~~ ^                                                                                                                                                                 
root [2] auto h = df.Hist1D("..")                                                                                                                                             
ROOT_prompt_2:1:13: error: no member named 'Hist1D' in 'ROOT::RDataFrame'                                                                                                     
auto h = df.Hist1D("..")                                                                                                                                                      
         ~~ ^                                                                                                                                                                 
root [3] auto h = df.Hist1D("..")                                                                                                                                             
ROOT_prompt_3:1:13: error: no member named 'Hist1D' in 'ROOT::RDataFrame'                                                                                                     
auto h = df.Hist1D("..")                                                                                                                                                      
         ~~ ^   

Could it be a Mac-only issue?


Hi @eguiraud Enrico,

Ah, yes, correct, it is MacOS only, with a subtle twist. The example you show behaves the same on a Mac, I don’t get booted out. An RDataFrame derived from a tree does have the issue:

root [0] auto tree = new TTree("T","An example of ROOT tree with a few branches");
root [1] double x;
root [2] tree->Branch("x",&x)
(TBranch *) 0x7f88fe83f7f0
root [3] for(int i=0; i<100; ++i){ x = gRandom->Rndm(); tree->Fill(); }
root [4] using namespace ROOT;
root [5] auto df = RDataFrame( *tree)
(ROOT::RDataFrame &) A data frame built on top of the T dataset.
root [6] df.GetColumnNames()
(ROOT::RDF::RInterface::ColumnNames_t) { "x" }
root [7] auto h1 = df.Histo1D("x")
(ROOT::RDF::RResultPtr<TH1D> &) @0x1268165a0
root [8] h1->Draw()
root [9] auto h1 = df.Histo1D("y")
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Unknown column: y

On an Ubuntu docker image with root 6.20 I get:

root [7] auto h1 = df.Histo1D("y")
Error in <TRint::HandleTermInput()>: std::runtime_error caught: Unknown column: y
root [8]

which is consistent with the behavior with a simpler RDataFrame.

So Mac only. Is there a way to chase this down or prevent it (other than taking typing lessons :wink:)

  • Maurik

I think this is really a bug report for cling, the interpreter.
Can you please post the reproducer and the specifics of your Mac system here? I will make sure that a cling expert takes a look (but also, as bug comes, this one is certainly annoying but not critical so it might take a while before a fix comes in).


or use linux :stuck_out_tongue:

Thanks Enrico,

I submitted a Jira bug report: https://sft.its.cern.ch/jira/browse/ROOT-10962
after I verified the issue also exists on the “master” branch.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.