Skip to content

Not quite normalized type names end up in rootmap files #19559

@makortel

Description

@makortel

Check duplicate issues.

  • Checked for duplicates

Description

Somewhat connected to #18402 (comment) I found that the type edm::Wrapper<ticl::AssociationMap<ticl::mapWithFraction,std::vector<reco::CaloCluster>,std::vector<ticl::Trackster> > > that CMS specifies in the classes_def.xml is not found with TClass::GetClass().

Debugging with @pcanal we found the cause to be that the .rootmap file contains "not quite normalized name". The classes_def.xml has an entry

<class name="edm::Wrapper<ticl::AssociationMap<ticl::mapWithFraction, std::vector<reco::CaloCluster>, std::vector<ticl::Trackster> > >"/>

The corresponding .rootmap file has

class edm::Wrapper<ticl::AssociationMap<ticl::mapWithFraction,std::vector<reco::CaloCluster>,std::vector<ticl::Trackster> > >

Stepping through the TClass::GetClass() in a debugger revealed that a normalized name (cls2 in the reproducer below) is created in

TClassEdit::GetNormalizedName(normalizedName, name);

and then passed to the library loading through
if (gInterpreter->AutoLoad(normalizedName.c_str(),kTRUE)) {

return DeepAutoLoadImpl(cls, visited, false /*normalized*/);

if (ShallowAutoLoadImpl(cls) == 0) {

TString deplibs = gCling->GetClassSharedLibs(cls);

libs_record = fMapfile->Lookup(cls);

that returned nullptr (as shown in the reproducer below) leading to the TClass::GetClass() returning nullptr.

Reproducer

E.g. in a recent CMSSW IB or 15_1_X prerelease via root prompt

root [0] auto const cls = "edm::Wrapper<ticl::AssociationMap<ticl::mapWithFraction,std::vector<reco::CaloCluster>,std::vector<ticl::Trackster> > >"
(const char *) "edm::Wrapper<ticl::AssociationMap<ticl::mapWithFraction,std::vector<reco::CaloCluster>,std::vector<ticl::Trackster> > >"
root [1] auto const cls2 = "edm::Wrapper<ticl::AssociationMap<ticl::mapWithFraction,vector<reco::CaloCluster>,vector<ticl::Trackster> > >"
(const char *) "edm::Wrapper<ticl::AssociationMap<ticl::mapWithFraction,vector<reco::CaloCluster>,vector<ticl::Trackster> > >"
root [2] TClass::GetClass(cls)
(TClass *) nullptr
root [3] TClass::GetClass(cls2)
(TClass *) nullptr
root [4] gInterpreter->GetMapfile()->Lookup(cls)
(TEnvRec *) 0x39a1e00
root [5] gInterpreter->GetMapfile()->Lookup(cls2)
(TEnvRec *) nullptr

In above the cls has the std:: in the type names (as in classes_def.xml), and cls2 has not.

ROOT version

First observed in ROOT commit a9a81f1 with #18402 merged on top. Occurs also in 6.32.13 (and possibly elsewhere).

Installation method

Built from source by CMS

Operating system

Linux Alma8

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions