cms-sw / cmssw

CMS Offline Software
http://cms-sw.github.io/
Apache License 2.0
1.08k stars 4.29k forks source link

(likely) Unwanted auto-parsing in aarch64 IBs #33196

Open pcanal opened 3 years ago

pcanal commented 3 years ago

In https://github.com/cms-sw/cmssw/issues/31123 we see https://github.com/cms-sw/cmssw/issues/31123#issuecomment-778318184 which in particular has the lines:

#34 0x0000ffff39f68384 in cling::Interpreter::parseForModule (this=0xffff402b1400, input="\n#define __ROOTCLING__ 1\n#undef ClassDef\n#define ClassDef(name,id) \\\n_ClassDefOutline_(name,id,virtual,) \\\nstatic int DeclFileLine() { return __LINE__; }\n#undef ClassDefNV\n#define ClassDefNV(name, id)"...) at /home/dsr/root/interpreter/cling/lib/Interpreter/Interpreter.cpp:922
#35 0x0000ffff39d86254 in ExecAutoParse (what=0xffff80ac0e38 "\n#line 1 \"DataFormatsTrackReco_xr dictionary payload\"\n\n#ifndef CMS_DICT_IMPL\n  #define CMS_DICT_IMPL 1\n#endif\n#ifndef _REENTRANT\n  #define _REENTRANT 1\n#endif\n#ifndef GNUSOURCE\n  #define GNUSOURCE 1\n#"..., header=false, interpreter=0xffff402b1400) at /home/dsr/root/core/metacling/src/TCling.cxx:6232
#36 0x0000ffff39d86944 in TCling::AutoParseImplRecurse (this=0xffff40418b80, cls=0xffff4b3251a0 "vector<reco::Track>", topLevel=false) at /home/dsr/root/core/metacling/src/TCling.cxx:6337
#37 0x0000ffff39d86c30 in TCling::AutoParseImplRecurse (this=0xffff40418b80, cls=0xffff4b3d8400 "edm::refhelper::FindUsingAdvance<vector<reco::Track>,reco::Track>", topLevel=true) at /home/dsr/root/core/metacling/src/TCling.cxx:6373
#38 0x0000ffff39d86f34 in TCling::AutoParse (this=0xffff40418b80, cls=0xffff4b3d8400 "edm::refhelper::FindUsingAdvance<vector<reco::Track>,reco::Track>") at /home/dsr/root/core/metacling/src/TCling.cxx:6422
#39 0x0000ffff39d72034 in TClingLookupHelper__AutoParse (cname=0xffff4b3d8400 "edm::refhelper::FindUsingAdvance<vector<reco::Track>,reco::Track>") at /home/dsr/root/core/metacling/src/TCling.cxx:900
#40 0x0000ffff39c1500c in ROOT::TMetaUtils::TClingLookupHelper::GetPartiallyDesugaredNameWithScopeHandling (this=0xffff44e45740, tname="edm::refhelper::FindUsingAdvance<vector<reco::Track>,reco::Track>", result="", dropstd=true) at /home/dsr/root/core/clingutils/src/TClingUtils.cxx:626
#41 0x0000ffff87cb81d4 in TClassEdit::TSplitType::ShortType (this=0xffffc631e588, answ="", mode=3618) at /home/dsr/root/core/foundation/src/TClassEdit.cxx:437
#42 0x0000ffff87cbb5b0 in TClassEdit::ShortType[abi:cxx11](char const*, int) (typeDesc=0xffff4b39a580 "edm::RefVector<std::vector<reco::Track>,reco::Track,edm::refhelper::FindUsingAdvance<std::vector<reco::Track>,reco::Track> >", mode=3618) at /home/dsr/root/core/foundation/src/TClassEdit.cxx:1292
#43 0x0000ffff87cb80dc in TClassEdit::TSplitType::ShortType (this=0xffffc631e6d8, answ="", mode=3618) at /home/dsr/root/core/foundation/src/TClassEdit.cxx:429
#44 0x0000ffff87cbb5b0 in TClassEdit::ShortType[abi:cxx11](char const*, int) (typeDesc=0xffff4b3d84a0 "std::vector<edm::RefVector<std::vector<reco::Track>,reco::Track,edm::refhelper::FindUsingAdvance<std::vector<reco::Track>,reco::Track> > >", mode=3618) at /home/dsr/root/core/foundation/src/TClassEdit.cxx:1292
#45 0x0000ffff87cb80dc in TClassEdit::TSplitType::ShortType (this=0xffffc631e870, answ="", mode=3618) at /home/dsr/root/core/foundation/src/TClassEdit.cxx:429
#46 0x0000ffff87cb94f0 in TClassEdit::GetNormalizedName (norm_name="", name="edm::AssociationVector<edm::RefToBaseProd<reco::Jet>,std::vector<edm::RefVector<std::vector<reco::Track>,reco::Track,edm::refhelper::FindUsingAdvance<std::vector<reco::Track>,reco::Track> > >,edm::Ref"...) at /home/dsr/root/core/foundation/src/TClassEdit.cxx:851
#47 0x0000ffff87cdae18 in TClass::GetClass (name=0xffff4a5dcc40 "edm::AssociationVector<edm::RefToBaseProd<reco::Jet>,std::vector<edm::RefVector<std::vector<reco::Track>,reco::Track,edm::refhelper::FindUsingAdvance<std::vector<reco::Track>,reco::Track> > >,edm::Ref"..., load=true, silent=false, hint_pair_offset=0, hint_pair_size=0) at /home/dsr/root/core/meta/src/TClass.cxx:3032
#48 0x0000ffff87cdab14 in TClass::GetClass (name=0xffff4a5dcc40 "edm::AssociationVector<edm::RefToBaseProd<reco::Jet>,std::vector<edm::RefVector<std::vector<reco::Track>,reco::Track,edm::refhelper::FindUsingAdvance<std::vector<reco::Track>,reco::Track> > >,edm::Ref"..., load=true, silent=false) at /home/dsr/root/core/meta/src/TClass.cxx:2948
#49 0x0000ffff88e411d4 in edm::TypeWithDict::byName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) () from /home/dsr/CMSSW_11_3_X_2021-02-05-2300/lib/cc8_aarch64_gcc9/libFWCoreReflection.so
#50 0x0000ffff88e3d05c in edm::TypeWithDict::byName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /home/dsr/CMSSW_11_3_X_2021-02-05-2300/lib/cc8_aarch64_gcc9/libFWCoreReflection.so

where asking for the TClass for "edm::AssociationVector<edm::RefToBaseProd<reco::Jet>,std::vector<edm::RefVector<std::vector<reco::Track>,reco::Track,edm::refhelper::FindUsingAdvance<std::vector<reco::Track>,reco::Track> > >,edm::Ref"... (name truncated) is unexpectedly leading to a call to AutoParse headers.

As part of the handling of that classname, TClassEdit is asking the interpreter more information about "edm::refhelper::FindUsingAdvance<vector<reco::Track>,reco::Track>",

Is the dictionary for one of those 2 classes missing or is there an issue in the ROOT handling of those classes?

cmsbuild commented 3 years ago

A new Issue was created by @pcanal Philippe Canal.

@Dr15Jones, @dpiparo, @silviodonato, @smuzaffar, @makortel, @qliphy can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

makortel commented 3 years ago

assign core

cmsbuild commented 3 years ago

New categories assigned: core

@Dr15Jones,@smuzaffar,@makortel you have been requested to review this Pull request/Issue and eventually sign? Thanks

makortel commented 3 years ago

"edm::AssociationVector<edm::RefToBaseProd<reco::Jet>,std::vector<edm::RefVector<std::vector<reco::Track>,reco::Track,edm::refhelper::FindUsingAdvance<std::vector<reco::Track>,reco::Track> > >,edm::Ref"...

Dictionary for this class is declared in https://github.com/cms-sw/cmssw/blob/07a27e5287a583bb5fd83e34f568a4f206536bec/DataFormats/JetReco/src/classes_def_3.xml#L49-L51

makortel commented 3 years ago

As part of the handling of that classname, TClassEdit is asking the interpreter more information about "edm::refhelper::FindUsingAdvance<vector<reco::Track>,reco::Track>",

For this I did not see any explicit dictionary declaration, but it is part of declarations of many others, e.g. here https://github.com/cms-sw/cmssw/blob/07a27e5287a583bb5fd83e34f568a4f206536bec/DataFormats/TrackReco/src/classes_def.xml#L354-L358

pcanal commented 3 years ago

But (at least in that file) not for edm::refhelper::FindUsingAdvance<std::vector<reco::Track>,reco::Track>.

makortel commented 3 years ago

Checking the use of FindUsingAdvance in more general, I see only one case where a dictionary for its instantiation is declared https://github.com/cms-sw/cmssw/blob/07a27e5287a583bb5fd83e34f568a4f206536bec/DataFormats/CaloTowers/src/classes_def.xml#L23

Philippe, are essentially saying that we should declare a dictionary for all instantiations of edm::refhelper::FindUsingAdvance explicitly?

pcanal commented 3 years ago

First, we should double check doing so is enough to avoid the AutoParsing :)