Prevent RDataFrame from crashing the interpreter


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.30/06
Platform: macosxarm64
Compiler: Not Provided


Following the RDataFrame example, suppose I have

void df000_simple()
{
  // Create a data frame with 100 rows
  ROOT::RDataFrame rdf(100);

  // Define a new column `x` that contains random numbers
  auto rdf_x = rdf.Define("x", [](){ return gRandom->Rndm(); });

}

and I execute with root df000_simple(); everything’s fine.
However, upon executing the second time

>>> .x df000_simple.C

(inside the interpreter), I’d be hit with a wall of error:

IncrementalExecutor::executeFunction: symbol '_ZNSt3__122__hash_node_destructorINS_9allocatorINS_11__hash_nodeINS_17__hash_value_typeINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEENS_10unique_ptrIN4ROOT6Detail3RDF11RDefineBaseENS_14default_deleteISD_EEEEEEPvEEEEEC1B8ue170006ERSK_b' unresolved while linking [cling interface function]!
You are probably missing the definition of std::__1::__hash_node_destructor<std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::unique_ptr<ROOT::Detail::RDF::RDefineBase, std::__1::default_delete<ROOT::Detail::RDF::RDefineBase>>>, void*>>>::__hash_node_destructor[abi:ue170006](std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::unique_ptr<ROOT::Detail::RDF::RDefineBase, std::__1::default_delete<ROOT::Detail::RDF::RDefineBase>>>, void*>>&, bool)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__19address
                       --snip--

Why does this happen with RDataFrame?
(I seem to recall not having this issue when using TTrees)

IIRC, sometimes, executing the same macro several times is causing troubles…

Somewhat related: