Automatically generated dictionary for std::pair base class with libstdc++

Dear ROOTers,
I’ve come across a puzzling error message when trying to open a file with a non-trivial TTree inside which contains lots of custom classes and std containers/types.
The file was produced on a CentOS7 machine, and I am opening it on a MacBook.

The puzzling errors are all related to std::pair

Warning in <TClass::Init>: no dictionary for class __pair_base<unsigned int,float> is available

I tracked down the error message to the fact that std::pair has an empty base class in the libstdc++ implementation, while this doesn’t seem the case in libc++.

I also found that this kind of issue already presented itself in 2018 and was fixed by ignoring the base class for std::pair in the streamer.

From the original JIRA issue I understood that the expected behavior for std::pair is

root [0] auto c = TClass::GetClass("pair<int,int>");auto pb = c->GetListOfBases();pb->GetEntries()
(int) 0

while if I perform this check on my 6.22/08 install (compiled with gcc 9.3.0 on CentOS7) I get

root [0] auto c = TClass::GetClass("pair<int,int>");auto pb = c->GetListOfBases();pb->GetEntries()
(int) 1

(this particular ROOT install is available on cvmfs: /cvmfs/

So, my question is, is this a regression? Or is this intended behavior?
In the latter case, how can I avoid the truckload of warnings when opening files on my MacBook?


ROOT Version: 6.22/08
Platform: CentOS7
Compiler: gcc 9.3.0

Maybe @pcanal can take a look at this

The warning can be safely ignored. I can not remember if this is a regression or a not-yet-fixed combination (v6.22 is rather old) but this have been fixed on the tip of the v6.22 patch branch (will eventually be in v6.22/10), the tip of the v6.24 patch branch (will eventually be in v6.24/08) and the tip of the v6.26 patch branch and the released v6.26/02 (i.e. I recommend you upgrade to v6.26/02)

1 Like

Oh ok thanks, it’s cool that the fix was already in-flight :slight_smile:

Of course this will require us to upgrade ROOT version, so at this point we’ll jump directly to 6.26/02

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