Segmentation fauld on TChain::Add()

Hey there,

I’m running a root program with the following lines of code:

86   TChain* clustChain  = new TChain("clustTree", "List of the clusters.");
87   std::cout << __LINE__ << std::endl;
88   clustChain -> Add("/data_ssd_120gb/hunyadi/CMSSW/SplitClusterStudy_2016_11_14/CMSSW_8_0_18/src/NtuplizerJob/Ntuple_scs.root");
89   std::cout << __LINE__ << std::endl;

Which results a segmentation fault after printing 87:

===========================================================                                                            │                                                                                                                       
There was a crash.                                                                                                     │                                                                                                                       
This is the entire stack trace of all threads:                                                                         │                                                                                                                       
===========================================================                                                            │                                                                                                                       
#0  0x0000003ccf0ac82e in waitpid () from /lib64/                                                             │                                                                                                                       
#1  0x0000003ccf03e479 in do_system () from /lib64/                                                           │                                                                                                                       
#2  0x00007f1574485a49 in TUnixSystem::StackTrace() () from /cvmfs/│                                                                                                                       
/external/slc6_amd64_gcc530/lib/                                                                             │                                                                                                                       
#3  0x00007f157448794c in TUnixSystem::DispatchSignals(ESignals) () from /cvmfs/│                                                                                                                       
/CMSSW_8_0_18/external/slc6_amd64_gcc530/lib/                                                                │                                                                                                                       
#4  <signal handler called>                                                                                            │                                                                                                                       
#5  0x00007f15737cff0b in TChain::AddFileInfoList(TCollection*, long long) () from /cvmfs/│                                                                                                                       
/cms/cmssw/CMSSW_8_0_18/external/slc6_amd64_gcc530/lib/                                                      │                                                                                                                       
#6  0x000000000041b829 in testPairing(nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std:│                                                                                                                       
:char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer│                                                                                                                       
> const&) ()                                                                                                           │                                                                                                                       
#7  0x0000000000414994 in main ()                                                                                      │                                                                                                                       

Is there something I’m doing wrong? The program runs on a different disk that where the data is located, can this be a problem? I tested the same lines in root prompt and had no problems there.


Something looks odd … You code call TChain::Add but the stack trace shows TChain::AddFileInfoList …
It is plausible that you have a setup problem (compiling against the header from one version of ROOT and linking against library of another version of ROOT).

1 Like

Ah, I see. I’ll make sure to check that, I work with multiple root versions and gcc versions at once. Thanks.

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