Possible bug in RDataFrame Define with lambdas?

So, say you are trying to define a column in RDataFrame via pyroot, and you need a lambda function to manage it in line. To take a silly example, I’d like to have a vector of jet pT, transformed by the quadratic 2p_T^2 + 5p_T. What I’m actually trying to do is harder to isolate that this, but it does involve a call to Map. Maybe I would try;

import ROOT;ROOT.xAOD.Init()
r_frame = ROOT.RDataFrame("CollectionTree", "example_data/from_lxplus/DAOD_PHYSLITE.28673837._000002.pool.root")
quadratic_lambda = "[](const float &x){return 2*x*x + 5*x;}"
map_call = f"ROOT::VecOps::Map(AnalysisJetsAuxDyn.pt, {quadratic_lambda})"
r_frame = r_frame.Define("my_col", map_call)
r_frame.Mean("my_col").GetValue()

Seemed reasonable to me, but gave a lengthy error message. Understandably, error messages that come from jitting c++ are effectively c++ errors, which I’m less practised at reading, but this one really didn’t help me;

Long error message
In module 'std' imported from input_line_1:1:
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/ext/alloc_traits.h:62:23: error: 
cannot form a reference to 'void'
    typedef value_type&                             reference;
                      ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:86:35: note: in instantiation of template class '__gnu_cxx::__alloc_traits<std::allocator<void>, void>' requested here
      typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
                                  ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:389:30: note: in instantiation of template class 'std::_Vector_base<void, std::allocator<void> >' requested here
    class vector : protected _Vector_base<_Tp, _Alloc>
                             ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RDefine.hxx:64:20: note: in instantiation of template class 'std::vector<void, std::allocator<void> >' requested here
   ValuesPerSlot_t fLastResults;
                   ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/InterfaceUtils.hxx:441:11: note: in instantiation of template class 'ROOT::Detail::RDF::RDefine<__rdf::(lambda at input_line_213:2:16), ROOT::Detail::RDF::CustomColExtraArgs::None>' requested here
      new NewCol_t(name, dummyType, std::forward<F>(f), cols, lm->GetNSlots(), *defines, lm->GetDSValuePtrs(), ds)));
          ^
input_line_214:2:23: note: in instantiation of function template specialization 'ROOT::Internal::RDF::JitDefineHelper<__rdf::(lambda at input_line_213:2:16) &>' requested here
 ROOT::Internal::RDF::JitDefineHelper(__rdf::lambda1, new const char*[1]{"AnalysisJetsAuxDyn.pt"}, 1, "my_col", reinterpret_cast<ROOT::Detail::RDF::RLoopManager*>(0xff33600), reinterpret_cast<std::weak_ptr<ROOT::Detail::RDF::RJittedDefine>*>(0x10e39e90), reinterpret_cast<ROOT::Internal::RDF::RBookedDefines*>(0x10e45890), reinterpret_cast<
std::shared_ptr<ROOT::Detail::RDF::RNodeBase>*>(0x10e15bf0));
                      ^
In module 'std' imported from input_line_1:1:
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/ext/alloc_traits.h:63:29: error: 
cannot form a reference to 'void'
    typedef const value_type&                       const_reference;
                            ^
In module 'std' imported from input_line_1:1:
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:87:2: error: no
 member named 'rebind' in '__gnu_cxx::__alloc_traits<std::allocator<void>, void>'
        rebind<_Tp>::other _Tp_alloc_type;
        ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:389:30: note: in instantiation of template class 'std::_Vector_base<void, std::allocator<void> >' requested here
    class vector : protected _Vector_base<_Tp, _Alloc>
                             ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RDefine.hxx:64:20: note: in instantiation of template class 'std::vector<void, std::allocator<void> >' requested here
   ValuesPerSlot_t fLastResults;
                   ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/InterfaceUtils.hxx:441:11: note: in instantiation of template class 'ROOT::Detail::RDF::RDefine<__rdf::(lambda at input_line_213:2:16), ROOT::Detail::RDF::CustomColExtraArgs::None>' requested here
      new NewCol_t(name, dummyType, std::forward<F>(f), cols, lm->GetNSlots(), *defines, lm->GetDSValuePtrs(), ds)));
          ^
input_line_214:2:23: note: in instantiation of function template specialization 'ROOT::Internal::RDF::JitDefineHelper<__rdf::(lambda at input_line_213:2:16) &>' requested here
 ROOT::Internal::RDF::JitDefineHelper(__rdf::lambda1, new const char*[1]{"AnalysisJetsAuxDyn.pt"}, 1, "my_col", reinterpret_cast<ROOT::Detail::RDF::RLoopManager 00), reinterpret_cast<std::weak_ptr<ROOT::Detail::RDF::RJittedDefine>*>(0x10e39e90), reinterpret_cast<ROOT::Internal::RDF::RBookedDefines*>(0x10e45890), reinterpret_cast<
std::shared_ptr<ROOT::Detail::RDF::RNodeBase>*>(0x10e15bf0));
                      ^
In module 'std' imported from input_line_1:1:
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/ext/alloc_traits.h:47:47: error: 
type 'int' cannot be used prior to '::' because it has no members
template<typename _Alloc, typename = typename _Alloc::value_type>
                                              ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:88:35: note: in instantiation of default argument for '__alloc_traits<int>' required here
      typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:389:30: note: in instantiation of template class 'std::_Vector_base<void, std::allocator<void> >' requested here
    class vector : protected _Vector_base<_Tp, _Alloc>
                             ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RDefine.hxx:64:20: note: in instantiation of template class 'std::vector<void, std::allocator<void> >' requested here
   ValuesPerSlot_t fLastResults;
                   ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/InterfaceUtils.hxx:441:11: note: in instantiation of template class 'ROOT::Detail::RDF::RDefine<__rdf::(lambda at input_line_213:2:16), ROOT::Detail::RDF::CustomColExtraArgs::None>' requested here
      new NewCol_t(name, dummyType, std::forward<F>(f), cols, lm->GetNSlots(), *defines, lm->GetDSValuePtrs(), ds)));
          ^
input_line_214:2:23: note: in instantiation of function template specialization 'ROOT::Internal::RDF::JitDefineHelper<__rdf::(lambda at input_line_213:2:16) &>' requested here
 ROOT::Internal::RDF::JitDefineHelper(__rdf::lambda1, new const char*[1]{"AnalysisJetsAuxDyn.pt"}, 1, "my_col", reinterpret_cast<ROOT::Detail::RDF::RLoopManager*>(0xff33600), reinterpret_cast<std::weak_ptr<ROOT::Detail::RDF::RJittedDefine>*>(0x10e39e90), reinterpret_cast<ROOT::Internal::RDF::RBookedDefines*>(0x10e45890), reinterpret_cast<
std::shared_ptr<ROOT::Detail::RDF::RNodeBase>*>(0x10e15bf0));
                      ^
In module 'std' imported from input_line_1:1:
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:129:11: error: 
base specifier must name a class
        : public _Tp_alloc_type, public _Vector_impl_data
          ~~~~~~~^~~~~~~~~~~~~~
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:340:20: note: in instantiation of member class 'std::_Vector_base<void, std::allocator<void> >::_Vector_impl' requested here                                                   [157/1601]
      _Vector_impl _M_impl;
                   ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:389:30: note: in instantiation of template class 'std::_Vector_base<void, std::allocator<void> >' requested here
    class vector : protected _Vector_base<_Tp, _Alloc>
                             ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RDefine.hxx:64:20: note: in instantiation of template class 'std::vector<void, std::allocator<void> >' requested here
   ValuesPerSlot_t fLastResults;
                   ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/InterfaceUtils.hxx:441:11: note: in instantiation of template class 'ROOT::Detail::RDF::RDefine<__rdf::(lambda at input_line_213:2:16), ROOT::Detail::RDF::CustomColExtraArgs::None>' requested here
      new NewCol_t(name, dummyType, std::forward<F>(f), cols, lm->GetNSlots(), *defines, lm->GetDSValuePtrs(), ds)));
          ^
input_line_214:2:23: note: in instantiation of function template specialization 'ROOT::Internal::RDF::JitDefineHelper<__rdf::(lambda at input_line_213:2:16) &>' requested here
 ROOT::Internal::RDF::JitDefineHelper(__rdf::lambda1, new const char*[1]{"AnalysisJetsAuxDyn.pt"}, 1, "my_col", reinterpret_cast<ROOT::Detail::RDF::RLoopManager*>(0xff33600), reinterpret_cast<std::weak_ptr<ROOT::Detail::RDF::RJittedDefine>*>(0x10e39e90), reinterpret_cast<ROOT::Internal::RDF::RBookedDefines*>(0x10e45890), reinterpret_cast<
std::shared_ptr<ROOT::Detail::RDF::RNodeBase>*>(0x10e15bf0));
                      ^
In module 'std' imported from input_line_1:1:
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/ext/alloc_traits.h:47:47: error: 
type 'int' cannot be used prior to '::' because it has no members
template<typename _Alloc, typename = typename _Alloc::value_type>
                                              ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:411:26: note: in instantiation of default argument for '__alloc_traits<int>' required here
      typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Alloc_traits;
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RDefine.hxx:64:20: note: in instantiation of template class 'std::vector<void, std::allocator<void> >' requested here
   ValuesPerSlot_t fLastResults;
                   ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/InterfaceUtils.hxx:441:11: note: in instantiation of template class 'ROOT::Detail::RDF::RDefine<__rdf::(lambda at input_line_213:2:16), ROOT::Detail::RDF::CustomColExtraArgs::None>' requested here
      new NewCol_t(name, dummyType, std::forward<F>(f), cols, lm->GetNSlots(), *defines, lm->GetDSValuePtrs(), ds)));
          ^
input_line_214:2:23: note: in instantiation of function template specialization 'ROOT::Internal::RDF::JitDefineHelper<__rdf::(lambda at input_line_213:2:16) &>' requested
 here
 ROOT::Internal::RDF::JitDefineHelper(__rdf::lambda1, new const char*[1]{"AnalysisJetsAuxDyn.pt"}, 1, "my_col", reinterpret_cast<ROOT::Detail::RDF::RLoopManager 00), reinterpret_cast<std::weak_ptr<ROOT::Detail::RDF::RJittedDefine>*>(0x10e39e90), reinterpret_cast<ROOT::Internal::RDF::RBookedDefines*>(0x10e45890), reinterpret_cast<
std::shared_ptr<ROOT::Detail::RDF::RNodeBase>*>(0x10e15bf0));
                      ^
In module 'std' imported from input_line_1:1:
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:522:45: error: 
cannot form a reference to 'void'
      vector(size_type __n, const value_type& __value,
                                            ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RDefine.hxx:64:20: note: in instantiation of template class 'std::vector<void, std::allocator<void> >' requested here
   ValuesPerSlot_t fLastResults;
                   ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/InterfaceUtils.hxx:441:11: note: in instantiation of template class 'ROOT::Detail::RDF::RDefine<__rdf::(lambda at input_line_213:2:16), ROOT::Detail::RDF::CustomColExtraArgs::None>' requested here
      new NewCol_t(name, dummyType, std::forward<F>(f), cols, lm->GetNSlots(), *defines, lm->GetDSValuePtrs(), ds)));
          ^
input_line_214:2:23: note: in instantiation of function template specialization 'ROOT::Internal::RDF::JitDefineHelper<__rdf::(lambda at input_line_213:2:16) &>' requested
 here
 ROOT::Internal::RDF::JitDefineHelper(__rdf::lambda1, new const char*[1]{"AnalysisJetsAuxDyn.pt"}, 1, "my_col", reinterpret_cast<ROOT::Detail::RDF::RLoopManager*>(0xff33600), reinterpret_cast<std::weak_ptr<ROOT::Detail::RDF::RJittedDefine>*>(0x10e39e90), reinterpret_cast<ROOT::Internal::RDF::RBookedDefines*>(0x10e45890), reinterpret_cast<
std::shared_ptr<ROOT::Detail::RDF::RNodeBase>*>(0x10e15bf0));
                      ^
In module 'std' imported from input_line_1:1:
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:749:45: error: 
cannot form a reference to 'void'
      assign(size_type __n, const value_type& __val)
                                            ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:957:52: error: 
cannot form a reference to 'void'
      resize(size_type __new_size, const value_type& __x)
                                                   ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:1187:33: error:
 cannot form a reference to 'void'
      push_back(const value_type& __x)
                                ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:1203:27: error:
 cannot form a reference to 'void'
      push_back(value_type&& __x)
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:1263:57: error:
 cannot form a reference to 'void'
      insert(const_iterator __position, const value_type& __x);
                                                        ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:1293:51: error:
 cannot form a reference to 'void'
      insert(const_iterator __position, value_type&& __x)
                                                  ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:1335:72: error:
 cannot form a reference to 'void'
      insert(const_iterator __position, size_type __n, const value_type& __x)
                                                                       ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:1593:57: error:
 cannot form a reference to 'void'
      _M_fill_initialize(size_type __n, const value_type& __value)
                                                        ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:1645:53: error:
 cannot form a reference to 'void'
      _M_fill_assign(size_type __n, const value_type& __val);
                                                    ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:1684:69: error:
 cannot form a reference to 'void'
      _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
                                                                    ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:1741:59: error:
 cannot form a reference to 'void'
      _M_insert_rval(const_iterator __position, value_type&& __v);
                                                          ^
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/bin/../lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_vector.h:1750:59: error:
 cannot form a reference to 'void'
      _M_emplace_aux(const_iterator __position, value_type&& __v)
                                                          ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
In module 'ROOTDataFrame':
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:90:9: warning: inline function 'ROOT::Internal::RDF::RAction<ROOT::Internal::RDF::MeanHelper, ROOT::Detail::RDF::RNodeBase, ROOT::TypeTraits::TypeList<void> >::Initialize' is not defined [-Wundefin
ed-inline]
   void Initialize() final { fHelper.Initialize(); }
        ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:65:4: note: used here
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:92:9: warning: inline function 'ROOT::Internal::RDF::RAction<ROOT::Internal::RDF::MeanHelper, ROOT::Detail::RDF::RNodeBase, ROOT::TypeTraits::TypeList<void> >::InitSlot' is not defined [-Wundefined
-inline]
   void InitSlot(TTreeReader *r, unsigned int slot) final
        ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:65:4: note: used here
   RAction(Helper &&h, const ColumnNames_t &columns, std::shared_ptr<PrevDataFrame> pd, const RBookedDefines &defines)
   ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:116:9: warning: inline function 'ROOT::Internal::RDF::RAction<ROOT::Internal::RDF::MeanHelper, ROOT::Detail::RDF::RNodeBase, ROOT::TypeTraits::TypeList<void> >::TriggerChildrenCount' is not defined
 [-Wundefined-inline]
   void TriggerChildrenCount() final { fPrevData.IncrChildrenCount(); }
        ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:65:4: note: used here
   RAction(Helper &&h, const ColumnNames_t &columns, std::shared_ptr<PrevDataFrame> pd, const RBookedDefines &defines)
   ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:119:9: warning: inline function 'ROOT::Internal::RDF::RAction<ROOT::Internal::RDF::MeanHelper, ROOT::Detail::RDF::RNodeBase, ROOT::TypeTraits::TypeList<void> >::FinalizeSlot' is not defined [-Wundefined-inline]
   void FinalizeSlot(unsigned int slot) final
        ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:65:4: note: used here
   RAction(Helper &&h, const ColumnNames_t &columns, std::shared_ptr<PrevDataFrame> pd, const RBookedDefines &defines)
   ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:130:9: warning: inline function 'ROOT::Internal::RDF::RAction<ROOT::Internal::RDF::MeanHelper, ROOT::Detail::RDF::RNodeBase, ROOT::TypeTraits::TypeList<void> >::Finalize' is not defined [-Wundefined-inline]
   void Finalize() final
        ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:65:4: note: used here
   RAction(Helper &&h, const ColumnNames_t &columns, std::shared_ptr<PrevDataFrame> pd, const RBookedDefines &defines)
   ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:154:10: warning: inline function 'ROOT::Internal::RDF::RAction<ROOT::Internal::RDF::MeanHelper, ROOT::Detail::RDF::RNodeBase, ROOT::TypeTraits::TypeList<void> >::PartialUpdate' is not defined [-Wundefined-inline]
   void *PartialUpdate(unsigned int slot) final { return PartialUpdateImpl(slot); }
         ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:65:4: note: used here
   RAction(Helper &&h, const ColumnNames_t &columns, std::shared_ptr<PrevDataFrame> pd, const RBookedDefines &defines)
   ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:136:48: warning: inline function 'ROOT::Internal::RDF::RAction<ROOT::Internal::RDF::MeanHelper, ROOT::Detail::RDF::RNodeBase, ROOT::TypeTraits::TypeList<void> >::GetGraph' is not defined [-Wundefined-inline]
   std::shared_ptr<RDFGraphDrawing::GraphNode> GetGraph()
                                               ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:65:4: note: used here
   RAction(Helper &&h, const ColumnNames_t &columns, std::shared_ptr<PrevDataFrame> pd, const RBookedDefines &defines)
   ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:85:52: warning: inline function 'ROOT::Internal::RDF::RAction<ROOT::Internal::RDF::MeanHelper, ROOT::Detail::RDF::RNodeBase, ROOT::TypeTraits::TypeList<void> >::GetMergeableValue' is not defined [-Wundefined-inline]
   std::unique_ptr<RDFDetail::RMergeableValueBase> GetMergeableValue() const final
                                                   ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:65:4: note: used here
   RAction(Helper &&h, const ColumnNames_t &columns, std::shared_ptr<PrevDataFrame> pd, const RBookedDefines &defines)
   ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:156:38: warning: inline function 'ROOT::Internal::RDF::RAction<ROOT::Internal::RDF::MeanHelper, ROOT::Detail::RDF::RNodeBase, ROOT::TypeTraits::TypeList<void> >::GetDataBlockCallback' is not defined [-Wundefined-inline]
   std::function<void(unsigned int)> GetDataBlockCallback() final { return fHelper.GetDataBlockCallback(); }
                                     ^
/cvmfs/atlas.cern.ch/repo/sw/software/22.0/sw/lcg/releases/LCG_101_ATLAS_14/ROOT/6.24.06/x86_64-centos7-gcc11-opt/include/ROOT/RDF/RAction.hxx:65:4: note: used here
   RAction(Helper &&h, const ColumnNames_t &columns, std::shared_ptr<PrevDataFrame> pd, const RBookedDefines &defines)
   ^
---------------------------------------------------------------------------
runtime_error                             Traceback (most recent call last)
<ipython-input-2-84d58f9035de> in <module>
      4 map_call = f"ROOT::VecOps::Map(AnalysisJetsAuxDyn.pt, {quadratic_lambda})"
      5 r_frame = r_frame.Define("my_col", map_call)
----> 6 r_frame.Mean("my_col").GetValue()

runtime_error: const double& ROOT::RDF::RResultPtr<double>::GetValue() =>
    runtime_error: 
An error occurred during just-in-time compilation in RLoopManager::Run. The lines above might indicate the cause of the crash
All RDF objects that have not run their event loop yet should be considered in an invalid state.

Eventually I realised it works if I add a return to the map_call like so;

map_call = f"return ROOT::VecOps::Map(AnalysisJetsAuxDyn.pt, {quadratic_lambda})"
r_frame = r_frame.Define("my_col", map_call)
r_frame.Mean("my_col").GetValue() # Works!

Note that return is not normally needed in a Define. It’s not given in the documentation example either. Though, adding one never seems to cause problems. I guess the existance of the return statement inside the lambda confused the compiler into thinking the whole block already had a return statement?

This could be a bug, or just my lack of comprehension of what is normally possible when jitting c++. If it’s the latter, maybe it could go in the docs anyway though, because it seemed like a reasonable confusion to me?


ROOT Version: 6.24/06
Platform: NAME=“CentOS Linux” VERSION=“7 (Core)” ID_LIKE=“rhel fedora” CLUSTER=“sunrise”
Compiler: using pyroot


Hi Day,

I guess it is expected and known behaviour that you need a return there.

I also stumbled in the same problem a while ago.
You can see detailed Enrico’s reply in the post below on why is that the case:

as far as I understood, the issue is that in your expression inside lambda function you already have a return word. So RDF does not automatically put any returns inside to avoid confusion, so you have to write it manually in the beginning in this case.

I agree a better documentation&example for this case would be nice.

cheers,
Bohdan

2 Likes

That’s exactly it. I think it would be fair to classify this as a bug, unfortunately it is quite complicated and expensive to do more sophisticated C++ parsing of the string expression to figure out whether it needs a return or not. I hope one day someone better than me at parsing C++ will come up with a solution, for now we cannot but live with this limitation

I completely agree with you and @FoxWise that this behavior should at the very least be clearly documented, I opened a pull request here.

Thank you for the feedback and sorry about the problem!
Enrico

1 Like

@eguiraud and @FoxWise thank you both of you.

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