Segmentation fault when using custom classes ::Class() function


ROOT Version: 6.14/04
Platform: CentOS 7
Compiler: g++ 4.9.3


When trying to use a custom classes ::Class() function (after loading the shared object library with gSystem->Load()), the program crashes with a segmentation fault. This only happens on CentOS 7 and MacOS (though I wasn’t able to get gdb working on MacOS so I can’t verify that it produces the same backtrace), on CentOS 6 (with g++ 4.9.3 as well) things work as intended.

Using gdb to get a backtrace shows the start of backtrace:

#0  __gthread_mutex_lock (__mutex=0x13b04e8) at /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/gthr-default.h:748
#1  lock (this=0x13b04e8) at /usr/include/c++/4.8.2/mutex:134
#2  lock (this=0x7fffff7ff040) at /usr/include/c++/4.8.2/mutex:511
#3  unique_lock (__m=..., this=0x7fffff7ff040) at /usr/include/c++/4.8.2/mutex:443
#4  ROOT::TReentrantRWLock<std::mutex, ROOT::Internal::RecurseCounts>::WriteLock (this=0x13b04d8) at /opt/cern/root/root-6.14.04/core/thread/src/TReentrantRWLock.cxx:165
#5  0x00007ffff44b9f3a in ROOT::TVirtualRWMutex::Lock (this=<optimized out>) at /opt/cern/root/root_v6.14.04/include/TVirtualRWMutex.h:66
#6  0x00007ffff45a3d79 in TLockGuard (mutex=0x13b04d0, this=<synthetic pointer>) at /opt/cern/root/root_v6.14.04/include/TVirtualMutex.h:79
#7  TClass::GetListOfBases (this=this@entry=0x1065e40) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:3513
#8  0x00007ffff45a3e97 in TClass::GetBaseClass (this=0x1065e40, cl=0xac22e0) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:2600
#9  0x00007ffff45a3f58 in TClass::InheritsFrom (this=this@entry=0x1065e40, cl=0xac22e0) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:4710
#10 0x00007ffff45a6124 in TClass::Property (this=0x1065e40) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:5784
#11 0x00007ffff45d0344 in TProtoClass::FillTClass (this=0x131a850, cl=cl@entry=0x1065e40) at /opt/cern/root/root-6.14.04/core/meta/src/TProtoClass.cxx:225
#12 0x00007ffff45a3d9d in TClass::GetListOfBases (this=this@entry=0x1065e40) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:3519
#13 0x00007ffff45a3e97 in TClass::GetBaseClass (this=0x1065e40, cl=0xac22e0) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:2600
#14 0x00007ffff45a3f58 in TClass::InheritsFrom (this=this@entry=0x1065e40, cl=0xac22e0) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:4710
#15 0x00007ffff45a6124 in TClass::Property (this=0x1065e40) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:5784
#16 0x00007ffff45d0344 in TProtoClass::FillTClass (this=0x131a850, cl=cl@entry=0x1065e40) at /opt/cern/root/root-6.14.04/core/meta/src/TProtoClass.cxx:225
#17 0x00007ffff45a3d9d in TClass::GetListOfBases (this=this@entry=0x1065e40) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:3519

and the end of the backtrace:

#130797 0x00007ffff45a3d9d in TClass::GetListOfBases (this=this@entry=0x1065e40) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:3519
#130798 0x00007ffff45a3e97 in TClass::GetBaseClass (this=0x1065e40, cl=0xac22e0) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:2600
#130799 0x00007ffff45a3f58 in TClass::InheritsFrom (this=this@entry=0x1065e40, cl=0xac22e0) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:4710
#130800 0x00007ffff45a6124 in TClass::Property (this=0x1065e40) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:5784
#130801 0x00007ffff45d0344 in TProtoClass::FillTClass (this=0x131a850, cl=cl@entry=0x1065e40) at /opt/cern/root/root-6.14.04/core/meta/src/TProtoClass.cxx:225
#130802 0x00007ffff45a27c5 in TClass::GetListOfDataMembers (this=this@entry=0x1065e40, load=load@entry=false) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:3628
#130803 0x00007ffff45cf918 in TProtoClass::FindDataMember (cl=cl@entry=0x1065e40, index=0) at /opt/cern/root/root-6.14.04/core/meta/src/TProtoClass.cxx:536
#130804 0x00007ffff45cfb8d in TProtoClass::TProtoRealData::CreateRealData (this=this@entry=0x7fffffffadb0, dmClass=dmClass@entry=0x1065e40, parent=parent@entry=0x181cbb0, prevData=prevData@entry=0x18a81d0, 
    prevLevel=prevLevel@entry=0) at /opt/cern/root/root-6.14.04/core/meta/src/TProtoClass.cxx:448
#130805 0x00007ffff45d0db9 in TProtoClass::FillTClass (this=0x18a7ed0, cl=cl@entry=0x181cbb0) at /opt/cern/root/root-6.14.04/core/meta/src/TProtoClass.cxx:359
#130806 0x00007ffff45aab2a in TClass::Init (this=this@entry=0x181cbb0, name=name@entry=0x7fffd7dae8f6 "TGRSIMnemonic", cversion=cversion@entry=0, 
    typeinfo=typeinfo@entry=0x7fffd7fddd50 <typeinfo for TGRSIMnemonic>, isa=isa@entry=0x18930b0, dfil=dfil@entry=0x7fffd7daec43 "TGRSIMnemonic.h", 
    ifil=ifil@entry=0x7fffd7daeaf8 "libraries/TGRSIFormat/TGRSIMnemonic.cxx", dl=dl@entry=11, il=il@entry=26, givenInfo=givenInfo@entry=0x0, silent=silent@entry=false)
    at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:1427
#130807 0x00007ffff45b349b in TClass::TClass (this=0x181cbb0, name=0x7fffd7dae8f6 "TGRSIMnemonic", cversion=<optimized out>, info=..., isa=0x18930b0, dfil=0x7fffd7daec43 "TGRSIMnemonic.h", 
    ifil=0x7fffd7daeaf8 "libraries/TGRSIFormat/TGRSIMnemonic.cxx", dl=11, il=26, silent=false) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:1273
#130808 0x00007ffff45b3904 in ROOT::CreateClass (cname=0x7fffd7dae8f6 "TGRSIMnemonic", id=<optimized out>, info=..., isa=0x18930b0, dfil=0x7fffd7daec43 "TGRSIMnemonic.h", 
    ifil=0x7fffd7daeaf8 "libraries/TGRSIFormat/TGRSIMnemonic.cxx", dl=11, il=26) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:5598
#130809 0x00007ffff45c42cf in ROOT::TGenericClassInfo::GetClass (this=0x7fffd7fff180 <ROOT::GenerateInitInstanceLocal(TGRSIMnemonic const*)::instance>)
    at /opt/cern/root/root-6.14.04/core/meta/src/TGenericClassInfo.cxx:257
#130810 0x00007fffd7d91ff6 in TGRSIMnemonic::Class () at .build/libraries/TGRSIFormat/TGRSIFormatDict.cxx:208
#130811 0x00007ffff7fcc031 in ?? ()
#130812 0x0000000001e09ae0 in ?? ()
#130813 0x00007fffffffb540 in ?? ()
#130814 0x0000000000865898 in ?? ()
#130815 0x00007fffffffb540 in ?? ()
#130816 0x00000000007103e0 in ?? ()
#130817 0x00007fffffffb540 in ?? ()
#130818 0x00007fffffffb150 in ?? ()
#130819 0x00007fffe506ec19 in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) () from /opt/cern/root/root_v6.14.04/lib/libCling.so
#130820 0x00007fffe506f6e9 in cling::Interpreter::EvaluateInternal(std::string const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) ()
   from /opt/cern/root/root_v6.14.04/lib/libCling.so
#130821 0x00007fffe506f8be in cling::Interpreter::process(std::string const&, cling::Value*, cling::Transaction**, bool) () from /opt/cern/root/root_v6.14.04/lib/libCling.so
#130822 0x00007fffe5102ff8 in cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) () from /opt/cern/root/root_v6.14.04/lib/libCling.so
#130823 0x00007fffe4fe839a in HandleInterpreterException (metaProcessor=0xae46c0, input_line=0x1870500 "#line 1 \"ROOT_prompt_2\"\nTGRSIMnemonic::Class()", 
    compRes=@0x7fffffffb410: cling::Interpreter::kSuccess, result=0x7fffffffb540) at /opt/cern/root/root-6.14.04/core/metacling/src/TCling.cxx:2060
#130824 0x00007fffe4ffdd67 in TCling::ProcessLine (this=0x70fa60, line=<optimized out>, error=0x7fffffffb980) at /opt/cern/root/root-6.14.04/core/metacling/src/TCling.cxx:2218
#130825 0x00007ffff44cb57f in TApplication::ProcessLine (this=this@entry=0x13c6fe0, line=<optimized out>, line@entry=0x1870410 "#line 1 \"ROOT_prompt_2\"\nTGRSIMnemonic::Class()", sync=sync@entry=false, 
    err=err@entry=0x7fffffffb980) at /opt/cern/root/root-6.14.04/core/base/src/TApplication.cxx:1021
#130826 0x00007ffff5a72e8a in TGRSIint::ProcessLine (this=this@entry=0x13c6fe0, line=0x1870410 "#line 1 \"ROOT_prompt_2\"\nTGRSIMnemonic::Class()", sync=sync@entry=false, error=error@entry=0x7fffffffb980)
    at libraries/TGRSIint/TGRSIint.cxx:266
#130827 0x00007ffff1c20ccf in TRint::ProcessLineNr (this=this@entry=0x13c6fe0, filestem=filestem@entry=0x7ffff1c3113f "ROOT_prompt_", line=0xaf68d0 "TGRSIMnemonic::Class()", error=0x7fffffffb980, 
    error@entry=0x0) at /opt/cern/root/root-6.14.04/core/rint/src/TRint.cxx:741
#130828 0x00007ffff1c2105b in TRint::HandleTermInput (this=0x13c6fe0) at /opt/cern/root/root-6.14.04/core/rint/src/TRint.cxx:602
#130829 0x00007ffff45ff545 in TUnixSystem::CheckDescriptors (this=this@entry=0x61b8d0) at /opt/cern/root/root-6.14.04/core/unix/src/TUnixSystem.cxx:1322
#130830 0x00007ffff460064a in TUnixSystem::DispatchOneEvent (this=0x61b8d0, pendingOnly=<optimized out>) at /opt/cern/root/root-6.14.04/core/unix/src/TUnixSystem.cxx:1077
#130831 0x00007ffff45292e6 in TSystem::InnerLoop (this=0x61b8d0) at /opt/cern/root/root-6.14.04/core/base/src/TSystem.cxx:411
#130832 0x00007ffff452a1b0 in TSystem::Run (this=0x61b8d0) at /opt/cern/root/root-6.14.04/core/base/src/TSystem.cxx:361
#130833 0x00007ffff44c99df in TApplication::Run (this=this@entry=0x13c6fe0, retrn=retrn@entry=true) at /opt/cern/root/root-6.14.04/core/base/src/TApplication.cxx:1173
#130834 0x00007ffff1c227b4 in TRint::Run (this=0x13c6fe0, retrn=<optimized out>) at /opt/cern/root/root-6.14.04/core/rint/src/TRint.cxx:455
#130835 0x0000000000402138 in main (argc=1, argv=0x7fffffffde78) at src/grsisort.cxx:81

This only happens for a specific class, the other custom classes work fine. As this is part of a rather large software package I can’t really provide a minimum working sample of this, sorry.

But does anyone have an idea what causes this?

I should clarify that this is a shared object library that is loaded at a later stage in the program and contains custom classes that inherit from other custom classes that have been loaded at an earlier stage in the program. This problem occurs for one of the custom classes, but not others.

This is quite strange … i.e. that code is very well worn and is unlikely to crash there … unless … there is a build problem where you would somehow have for that one class some ‘stale’ build products (.o or shared library).

If this is not the case, the best way forward is to run the failing executable under valgrind

valgrind --suppressions=$ROOTSYS/etc/valgrind-root.supp myexecutable myargs

Cheers,
Philippe

Thanks Philippe. What exactly would I be looking for in the output of valgrind? As far as I can tell it says that the program uses the whole stack?

This is part of the output of valgrind:

==22875== Stack overflow in thread #1: can't grow stack to 0x1ffe801000
==22875== Stack overflow in thread #1: can't grow stack to 0x1ffe801000
==22875== Can't extend stack to 0x1ffe801068 during signal delivery for thread 1:
==22875==   no stack segment
==22875== 
==22875== Process terminating with default action of signal 11 (SIGSEGV)
==22875==  Access not within mapped region at address 0x1FFE801068
==22875== Stack overflow in thread #1: can't grow stack to 0x1ffe801000
==22875==    at 0xBC63E58: operator++ (atomic_base.h:404)
==22875==    by 0xBC63E58: ROOT::TReentrantRWLock<std::mutex, ROOT::Internal::RecurseCounts>::WriteLock() (TReentrantRWLock.cxx:163)

This looks like stack exhaustion: too many levels of recursion, likely because of infinite recursion. Can you attach a file with the complete stack trace, or at least the frames 0…10000?

Cheers, Axel.

I’ve tried to attach the full stack trace, but 18 MB is too much to upload here. So I cut it down to the first 20000 (the last few have already been posted above): gdb_head.txt (2.7 MB)

There is something going wrong inside the ROOT code building the information about the class.

Can you share the header for this class and all its bases classes?

Thanks,
Philippe.

Of course, the problematic class is TGRSIMnemonic, which inherits from TMnemonic (which inherits from TObject).

TGRSIMnemonic.h (1.7 KB)
TMnemonic.h (2.7 KB)

There is no remarkable about these class upon visual inspection. It may be the pattern of use of the class (by other part of the code/system). At any rate to make progress, we need to understand why it recurse forever. To do so you can either attach a debugger (and gather the following information) or add in the ROOT code in the file TProtoClass.cxx in the function TProtoClass::FillTClass at line 213 after the line:

Bool_t TProtoClass::FillTClass(TClass* cl) {
   if (cl->fRealData || cl->fBase.load() || cl->fData || cl->fEnums.load() || cl->fSizeof != -1 || cl->fCanSplit >= 0 ||
       cl->fProperty != (-1)) {

the line

fprintf(stderr, "TProtoClass::FillTClass take the error path because: cl->fRealData=%p cl->fBase.load()=%d cl->fData=%p cl->fEnums=%p cl->fSizeof = %d cl->fCanSplit = %d cl->fProperty=%d \n", cl->fRealData,  cl->fBase.load(), cl->fData, cl->fEnums.load(), cl->fSizeof != -1, cl->fCanSplit >= 0, cl->fProperty);

Cheers,
Philippe.

Adding that line gives an error

/opt/cern/root/root-6.14.04/core/meta/src/TProtoClass.cxx:213:309: error: use of deleted function ‘std::atomic<long int>::atomic(const std::atomic<long int>&)’
 fprintf(stderr, "TProtoClass::FillTClass take the error path because: cl->fRealData=%p cl->fBase.load()=%d cl->fData=%p cl->fEnums=%p cl->fSizeof = %d cl->fCanSplit = %d cl->fProperty=%d \n", cl->fRealData,  cl->fBase.load(), cl->fData, cl->fEnums.load(), cl->fSizeof != -1, cl->fCanSplit >= 0, cl->fProperty);

so I removed the output of cl->fProperty.

After re-compiling everything I get tons of lines like this:

TProtoClass::FillTClass take the error path because: cl->fRealData=(nil) cl->fBase.load()=0 cl->fData=(nil) cl->fEnums=(nil) cl->fSizeof = 1 cl->fCanSplit = 0 
TProtoClass::FillTClass take the error path because: cl->fRealData=(nil) cl->fBase.load()=0 cl->fData=(nil) cl->fEnums=(nil) cl->fSizeof = 1 cl->fCanSplit = 0 
TProtoClass::FillTClass take the error path because: cl->fRealData=(nil) cl->fBase.load()=0 cl->fData=(nil) cl->fEnums=(nil) cl->fSizeof = 1 cl->fCanSplit = 0 
TProtoClass::FillTClass take the error path because: cl->fRealData=(nil) cl->fBase.load()=0 cl->fData=(nil) cl->fEnums=(nil) cl->fSizeof = 1 cl->fCanSplit = 0 
TProtoClass::FillTClass take the error path because: cl->fRealData=(nil) cl->fBase.load()=0 cl->fData=(nil) cl->fEnums=(nil) cl->fSizeof = 1 cl->fCanSplit = 0 
TProtoClass::FillTClass take the error path because: cl->fRealData=(nil) cl->fBase.load()=0 cl->fData=(nil) cl->fEnums=(nil) cl->fSizeof = 1 cl->fCanSplit = 0 
TProtoClass::FillTClass take the error path because: cl->fRealData=(nil) cl->fBase.load()=0 cl->fData=(nil) cl->fEnums=(nil) cl->fSizeof = 1 cl->fCanSplit = 0

And putting a line like

std::cout<<"TClass "<<this<<"/"<<this->GetName()<<" calls InheritsFrom("<<cl<<"/"<<(cl!=nullptr?cl->GetName():"NA")<<")"<<std::endl;

in TClass.cxx line 4692 (start of InheritsFrom function) gives me this line repeated over and over:

TClass 0x1dadfa0/TMnemonic calls InheritsFrom(0x1804f30/TObject)

My bad … it needed to be

cl->fProperty.load();

Changing the line to use cl->fProperty.load(), adds cl->fProperty=-1 to the output.

This is likely the next symptom to track down. Because of this, TClass thinks the object was completely setup but given the other values (and fProperty printing -1 would confirm) it is not the case.

There is very few places that can set this value …

So, first let’s instrument:

core/meta/inc/TClass.h:   void               SetClassSize(Int_t sizof) { fSizeof = sizof; }

with

void SetClassSize(int_t  sizof) { fSizeof = sizof; fprintf(stderr, "SetClassSize %d for %s\n", sizof, GetName()); }

Cheers,
Philippe.

Adding the output to TClass::SetClassSize gives at the start of the program:

SetClassSize 232 for TStreamerInfo
SetClassSize 184 for TKey
SetClassSize 16 for TObject
SetClassSize 64 for TNamed
SetClassSize 40 for TObjString
SetClassSize 88 for TGlobal
SetClassSize 80 for TDictionary
SetClassSize 64 for TObjArray
SetClassSize 48 for TSeqCollection
SetClassSize 48 for TCollection
SetClassSize 192 for TProtoClass
SetClassSize 496 for TClass
SetClassSize 8 for string
SetClassSize 264 for TDataMember
SetClassSize 24 for vector<TProtoClass::TProtoRealData>
SetClassSize 32 for TProtoClass::TProtoRealData
SetClassSize 152 for TListOfEnumsWithLock
SetClassSize 104 for TEnumConstant
SetClassSize 216 for TEnum
SetClassSize 24 for vector<TDataMember*>
SetClassSize 24 for TString
SetClassSize 24 for vector<TString>
SetClassSize 184 for TStreamerElement
SetClassSize 104 for TList
SetClassSize 128 for TBaseClass
SetClassSize 16 for TClassRef
SetClassSize 88 for TDictAttributeMap
SetClassSize 152 for TListOfEnums
SetClassSize 112 for THashList
SetClassSize 192 for TStreamerBasicType
SetClassSize 96 for TOptionListItem
SetClassSize 248 for TDirectoryFile
SetClassSize 32 for TObjArrayIter
SetClassSize 136 for TDataType
SetClassSize 88 for TMnemonic
SetClassSize 680 for TPad
SetClassSize 440 for TGX11
SetClassSize 144 for TVirtualX
SetClassSize 64 for TRootGuiFactory
SetClassSize 64 for TGuiFactory
SetClassSize 464 for TGX11TTF
SetClassSize 248 for TGClient
SetClassSize 32 for TQObject
SetClassSize 1456 for TGFont
SetClassSize 16 for TRefCnt
SetClassSize 184 for TGGC
SetClassSize 56 for TSignalHandler
SetClassSize 48 for TSysEvtHandler
SetClassSize 56 for TFileHandler

probably the only line of interest from that is the base class:

SetClassSize 88 for TMnemonic

When loading the shared object library with gSystem->Load() I get:

SetClassSize 296 for TRint
SetClassSize 160 for TApplication
SetClassSize 360 for TGRSIint

Calling TGRSIMnemonic::Class() after that does not give any more output.

Can you set a breakpoint in TClass::SetClassSize so that we can see the stack trace when it is called for TMnemonic?

I’m not sure I can, sorry. I tried setting a break point via

b 'TClass::SetClassSize(Int_t)'
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 ('TClass::SetClassSize(Int_t)') pending.

but that doesn’t work. And by doesn’t work, I mean the break point is never reached.

Hi,

Are you using a ‘debug’ build of ROOT?

Cheers,

Philippe.

PS. Thanks for bearing with us. This is indeed a deficiency in the ROOT code, it is just not immediately evident what it is …

I managed to get the breakpoint to work by using the file with line number instead of the function name.
Stepping through it, the stack trace (using bt in gdb) for the preceding class (TDataType) is:

#0  ROOT::TGenericClassInfo::GetClass (this=0x7ffff4907a20 <ROOT::GenerateInitInstanceLocal(TDataType const*)::instance>) at /opt/cern/root/root-6.14.04/core/meta/src/TGenericClassInfo.cxx:280
#1  0x00007ffff4478fd1 in TDataType::Dictionary () at /opt/cern/root/root_v6.14.04/core/base/G__Core.cxx:16788
#2  0x00007ffff45af9ea in TClass::GetClass (name=name@entry=0xfd41f0 "TDataType", load=load@entry=true, silent=silent@entry=false) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:2943
#3  0x00007ffff45b0bff in TClass::Load (b=...) at /opt/cern/root/root-6.14.04/core/meta/src/TClass.cxx:5454
#4  0x00007ffff3bff823 in TBufferFile::ReadClass (this=0x96a3e0, clReq=0xadd9a0, objTag=0x7fffffffcd90) at /opt/cern/root/root-6.14.04/io/io/src/TBufferFile.cxx:2599
#5  0x00007ffff3bff134 in TBufferFile::ReadObjectAny (this=this@entry=0x96a3e0, clCast=0xadd9a0) at /opt/cern/root/root-6.14.04/io/io/src/TBufferFile.cxx:2361
#6  0x00007ffff457b381 in TObjArray::Streamer (this=0xfd4110, b=...) at /opt/cern/root/root-6.14.04/core/cont/src/TObjArray.cxx:467
#7  0x00007ffff3c8021f in Streamer (onfile_class=0x0, b=..., obj=0xfd4110, this=0xba20d0) at /opt/cern/root/root_v6.14.04/include/TClass.h:568
#8  TKey::ReadObjectAny (this=0xba0cc0, expectedClass=<optimized out>) at /opt/cern/root/root-6.14.04/io/io/src/TKey.cxx:1092
#9  0x00007ffff3c3272f in TDirectoryFile::GetObjectChecked (this=this@entry=0xfd4ce0, namecycle=namecycle@entry=0x7fffe6dd73e6 "__Typedefs", expectedClass=0xba20d0)
    at /opt/cern/root/root-6.14.04/io/io/src/TDirectoryFile.cxx:1066
#10 0x00007fffe500b935 in GetObject<TObjArray> (ptr=<synthetic pointer>, namecycle=0x7fffe6dd73e6 "__Typedefs", this=0xfd4ce0) at /opt/cern/root/root_v6.14.04/include/TDirectoryFile.h:80
#11 TCling::LoadPCM (this=this@entry=0x70fa60, pcmFileName=..., headers=headers@entry=0x7ffff0d9a300 <(anonymous namespace)::TriggerDictionaryInitialization_libMultiProc_Impl()::headers>, 
    triggerFunc=triggerFunc@entry=0x7ffff0b93940 <(anonymous namespace)::TriggerDictionaryInitialization_libMultiProc_Impl()>) at /opt/cern/root/root-6.14.04/core/metacling/src/TCling.cxx:1533
#12 0x00007fffe50150fe in TCling::RegisterModule (this=0x70fa60, modulename=<optimized out>, headers=<optimized out>, includePaths=<optimized out>, payloadCode=<optimized out>, fwdDeclsCode=<optimized out>, 
    triggerFunc=0x7ffff0b93940 <(anonymous namespace)::TriggerDictionaryInitialization_libMultiProc_Impl()>, fwdDeclsArgToSkip=..., 
    classesHeaders=0x7ffff0d9a3c0 <(anonymous namespace)::TriggerDictionaryInitialization_libMultiProc_Impl()::classesHeaders+96>, lateRegistration=true, hasCxxModule=false)
    at /opt/cern/root/root-6.14.04/core/metacling/src/TCling.cxx:1903
#13 0x00007ffff4445312 in TROOT::InitInterpreter (this=0x7ffff48fde20 <ROOT::Internal::GetROOT1()::alloc>) at /opt/cern/root/root-6.14.04/core/base/src/TROOT.cxx:2114
#14 0x00007ffff4445836 in ROOT::Internal::GetROOT2 () at /opt/cern/root/root-6.14.04/core/base/src/TROOT.cxx:388
#15 0x00007ffff45c8296 in ROOT::TGenericClassInfo::GetClass (this=0x7ffff5f62140 <ROOT::GenerateInitInstanceLocal(TMnemonic const*)::instance>)
    at /opt/cern/root/root-6.14.04/core/meta/src/TGenericClassInfo.cxx:241
#16 0x00007ffff5d2f856 in TMnemonic::Class () at .build/libraries/TGRSIFormat/TGRSIFormatDict.cxx:946
#17 0x00007ffff5cd4471 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at libraries/TGRSIFormat/TChannel.cxx:33
#18 _GLOBAL__sub_I_TChannel.cxx(void) () at libraries/TGRSIFormat/TChannel.cxx:1410
#19 0x00007ffff7deab03 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#20 0x00007ffff7ddc06a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#21 0x0000000000000002 in ?? ()
#22 0x00007fffffffe256 in ?? ()
#23 0x00007fffffffe290 in ?? ()
#24 0x0000000000000000 in ?? ()

and the stack trace for TMnemonic is:

#0  ROOT::TGenericClassInfo::GetClass (this=0x7ffff5f62140 <ROOT::GenerateInitInstanceLocal(TMnemonic const*)::instance>) at /opt/cern/root/root-6.14.04/core/meta/src/TGenericClassInfo.cxx:280
#1  0x00007ffff5d2f856 in TMnemonic::Class () at .build/libraries/TGRSIFormat/TGRSIFormatDict.cxx:946
#2  0x00007ffff5cd4471 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at libraries/TGRSIFormat/TChannel.cxx:33
#3  _GLOBAL__sub_I_TChannel.cxx(void) () at libraries/TGRSIFormat/TChannel.cxx:1410
#4  0x00007ffff7deab03 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#5  0x00007ffff7ddc06a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#6  0x0000000000000002 in ?? ()
#7  0x00007fffffffe256 in ?? ()
#8  0x00007fffffffe290 in ?? ()
#9  0x0000000000000000 in ?? ()

Is this what you were looking for? The SetClassSize function gets called quite a bit during the start of the program, so I’m not sure I got the right stack trace for you.

And thanks for helping me with this, I really appreciate it!

I managed to create a stack trace for every time the break point is encountered, see attached.

gdb_callstack.txt (219.6 KB)