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.