Root crashes when using ROOT::EnableImplicitMT()

Hi,
I am using RDataFrame with ROOT::EnableImplicitMT(). I am aware of the bug shown here:
https://sft.its.cern.ch/jira/browse/ROOT-10178

So I am not using ROOT::EnableImplicitMT() when using different root files with different tree names. I am using it when I have only one root file to add in the TChain. This is the code I am using:

The code is running fine. But as soon as the processing is done, root is crashing. This is the entire stack trace of all threads:

 *** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================

Thread 10 (Thread 0x7ff6cb5e3700 (LWP 21449)):
#0  0x00007ff6e43fb349 in syscall () from /lib64/libc.so.6
#1  0x00007ff6d6d6c652 in futex_wait (comparand=2, futex=0x7ff6ce5240ac) at ../../include/tbb/machine/linux_common.h:60
#2  P (this=0x7ff6ce5240ac) at ../../src/tbb/semaphore.h:206
#3  commit_wait (c=<synthetic pointer>, this=0x7ff6ce5240a0) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7ff6ce524080) at ../../src/tbb/private_server.cpp:277
#5  0x00007ff6d6d6c679 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007ff6e46d7dd5 in start_thread () from /lib64/libpthread.so.0
#7  0x00007ff6e440102d in clone () from /lib64/libc.so.6

Thread 9 (Thread 0x7ff6cb1e2700 (LWP 21450)):
#0  0x00007ff6e43fb349 in syscall () from /lib64/libc.so.6
#1  0x00007ff6d6d6c652 in futex_wait (comparand=2, futex=0x7ff6ce52412c) at ../../include/tbb/machine/linux_common.h:60
#2  P (this=0x7ff6ce52412c) at ../../src/tbb/semaphore.h:206
#3  commit_wait (c=<synthetic pointer>, this=0x7ff6ce524120) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7ff6ce524100) at ../../src/tbb/private_server.cpp:277
#5  0x00007ff6d6d6c679 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007ff6e46d7dd5 in start_thread () from /lib64/libpthread.so.0
#7  0x00007ff6e440102d in clone () from /lib64/libc.so.6

Thread 8 (Thread 0x7ff6ca9e0700 (LWP 21451)):
#0  0x00007ff6e43fb349 in syscall () from /lib64/libc.so.6
#1  0x00007ff6d6d6c652 in futex_wait (comparand=2, futex=0x7ff6ce523eac) at ../../include/tbb/machine/linux_common.h:60
#2  P (this=0x7ff6ce523eac) at ../../src/tbb/semaphore.h:206
#3  commit_wait (c=<synthetic pointer>, this=0x7ff6ce523ea0) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7ff6ce523e80) at ../../src/tbb/private_server.cpp:277
#5  0x00007ff6d6d6c679 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007ff6e46d7dd5 in start_thread () from /lib64/libpthread.so.0
#7  0x00007ff6e440102d in clone () from /lib64/libc.so.6

Thread 7 (Thread 0x7ff6cade1700 (LWP 21452)):
#0  0x00007ff6e43fb349 in syscall () from /lib64/libc.so.6
#1  0x00007ff6d6d6c652 in futex_wait (comparand=2, futex=0x7ff6ce523fac) at ../../include/tbb/machine/linux_common.h:60
#2  P (this=0x7ff6ce523fac) at ../../src/tbb/semaphore.h:206
#3  commit_wait (c=<synthetic pointer>, this=0x7ff6ce523fa0) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7ff6ce523f80) at ../../src/tbb/private_server.cpp:277
#5  0x00007ff6d6d6c679 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007ff6e46d7dd5 in start_thread () from /lib64/libpthread.so.0
#7  0x00007ff6e440102d in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x7ff6ca5df700 (LWP 21453)):
#0  0x00007ff6e43fb349 in syscall () from /lib64/libc.so.6
#1  0x00007ff6d6d6c652 in futex_wait (comparand=2, futex=0x7ff6ce523f2c) at ../../include/tbb/machine/linux_common.h:60
#2  P (this=0x7ff6ce523f2c) at ../../src/tbb/semaphore.h:206
#3  commit_wait (c=<synthetic pointer>, this=0x7ff6ce523f20) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7ff6ce523f00) at ../../src/tbb/private_server.cpp:277
#5  0x00007ff6d6d6c679 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007ff6e46d7dd5 in start_thread () from /lib64/libpthread.so.0
#7  0x00007ff6e440102d in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7ff6ca1de700 (LWP 21454)):
#0  0x00007ff6e43fb349 in syscall () from /lib64/libc.so.6
#1  0x00007ff6d6d6c652 in futex_wait (comparand=2, futex=0x7ff6ce52402c) at ../../include/tbb/machine/linux_common.h:60
#2  P (this=0x7ff6ce52402c) at ../../src/tbb/semaphore.h:206
#3  commit_wait (c=<synthetic pointer>, this=0x7ff6ce524020) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7ff6ce524000) at ../../src/tbb/private_server.cpp:277
#5  0x00007ff6d6d6c679 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007ff6e46d7dd5 in start_thread () from /lib64/libpthread.so.0
#7  0x00007ff6e440102d in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7ff6c99dc700 (LWP 21455)):
#0  0x00007ff6e43fb349 in syscall () from /lib64/libc.so.6
#1  0x00007ff6d6d6c652 in futex_wait (comparand=2, futex=0x7ff6ce523d2c) at ../../include/tbb/machine/linux_common.h:60
#2  P (this=0x7ff6ce523d2c) at ../../src/tbb/semaphore.h:206
#3  commit_wait (c=<synthetic pointer>, this=0x7ff6ce523d20) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7ff6ce523d00) at ../../src/tbb/private_server.cpp:277
#5  0x00007ff6d6d6c679 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007ff6e46d7dd5 in start_thread () from /lib64/libpthread.so.0
#7  0x00007ff6e440102d in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7ff6c9ddd700 (LWP 21456)):
#0  0x00007ff6e43fb349 in syscall () from /lib64/libc.so.6
#1  0x00007ff6d6d6c652 in futex_wait (comparand=2, futex=0x7ff6ce523dac) at ../../include/tbb/machine/linux_common.h:60
#2  P (this=0x7ff6ce523dac) at ../../src/tbb/semaphore.h:206
#3  commit_wait (c=<synthetic pointer>, this=0x7ff6ce523da0) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7ff6ce523d80) at ../../src/tbb/private_server.cpp:277
#5  0x00007ff6d6d6c679 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007ff6e46d7dd5 in start_thread () from /lib64/libpthread.so.0
#7  0x00007ff6e440102d in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7ff6c95db700 (LWP 21457)):
#0  0x00007ff6e43fb349 in syscall () from /lib64/libc.so.6
#1  0x00007ff6d6d6c652 in futex_wait (comparand=2, futex=0x7ff6ce523e2c) at ../../include/tbb/machine/linux_common.h:60
#2  P (this=0x7ff6ce523e2c) at ../../src/tbb/semaphore.h:206
#3  commit_wait (c=<synthetic pointer>, this=0x7ff6ce523e20) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7ff6ce523e00) at ../../src/tbb/private_server.cpp:277
#5  0x00007ff6d6d6c679 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007ff6e46d7dd5 in start_thread () from /lib64/libpthread.so.0
#7  0x00007ff6e440102d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7ff6e5c6a980 (LWP 21369)):
#0  0x00007ff6e43c7c09 in waitpid () from /lib64/libc.so.6
#1  0x00007ff6e4345ea2 in do_system () from /lib64/libc.so.6
#2  0x00007ff6e4346251 in system () from /lib64/libc.so.6
#3  0x00007ff6e54dd64d in TUnixSystem::StackTrace() () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#4  0x00007ff6e54dfdb4 in TUnixSystem::DispatchSignals(ESignals) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#5  <signal handler called>
#6  0x00007ff6e543da8f in TList::FindObject(TObject const*) const () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#7  0x00007ff6e5439a57 in THashList::Remove(TObject*) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#8  0x00007ff6e530d010 in TROOT::Remove(TObject*) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#9  0x00007ff6e53b0741 in TDirectory::~TDirectory() () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#10 0x00007ff6e53b07e9 in TDirectory::~TDirectory() () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#11 0x00007ff6e543a965 in THashList::Delete(char const*) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#12 0x00007ff6e53aef14 in TDirectory::Close(char const*) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#13 0x00007ff6e53076a2 in TROOT::CloseFiles() () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#14 0x00007ff6e5307d72 in TROOT::EndOfProcessCleanups() () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#15 0x00007ff6e54da781 in TUnixSystem::Exit(int, bool) [clone .localalias.129] () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#16 0x00007ff6e538f3c0 in TApplication::Terminate(int) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#17 0x00007ff6e538ddc7 in TApplication::ProcessLine(char const*, bool, int*) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#18 0x00007ff6e586adde in TRint::ProcessLineNr(char const*, char const*, int*) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libRint.so
#19 0x00007ff6e586b07f in TRint::HandleTermInput() () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libRint.so
#20 0x00007ff6e54df25d in TUnixSystem::CheckDescriptors() () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#21 0x00007ff6e54e067b in TUnixSystem::DispatchOneEvent(bool) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#22 0x00007ff6e53fb6b1 in TSystem::Run() () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#23 0x00007ff6e538c1bf in TApplication::Run(bool) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#24 0x00007ff6e586c5d1 in TRint::Run(bool) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libRint.so
#25 0x000000000040098a in main ()
===========================================================


The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at http://root.cern.ch/bugs Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#6  0x00007ff6e543da8f in TList::FindObject(TObject const*) const () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#7  0x00007ff6e5439a57 in THashList::Remove(TObject*) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#8  0x00007ff6e530d010 in TROOT::Remove(TObject*) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#9  0x00007ff6e53b0741 in TDirectory::~TDirectory() () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#10 0x00007ff6e53b07e9 in TDirectory::~TDirectory() () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#11 0x00007ff6e543a965 in THashList::Delete(char const*) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#12 0x00007ff6e53aef14 in TDirectory::Close(char const*) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#13 0x00007ff6e53076a2 in TROOT::CloseFiles() () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#14 0x00007ff6e5307d72 in TROOT::EndOfProcessCleanups() () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#15 0x00007ff6e54da781 in TUnixSystem::Exit(int, bool) [clone .localalias.129] () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#16 0x00007ff6e538f3c0 in TApplication::Terminate(int) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
===========================================================

May I know what I should do to avoid this crash? Is this another bug of RDataFrame?

Thank you,
Arka


_ROOT Version:6.16/00
_Platform: x86_64-slc6-gcc62-opt
_Compiler:gcc (GCC) 6.2.0


Hi,
I fed the output of the previous code (a TH2D inside root file) to another code:


I checked the TH2Ds and they seem to be fine.
But when I ran the makeMyFSNtuple.C, I see that root is crashing:

*** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00007fad0aef4bbc in waitpid () from /lib64/libc.so.6
#1  0x00007fad0ae72ea2 in do_system () from /lib64/libc.so.6
#2  0x00007fad0c00a64d in TUnixSystem::StackTrace() () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#3  0x00007fad0c00cdb4 in TUnixSystem::DispatchSignals(ESignals) () from /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.16.00-f8770/x86_64-slc6-gcc62-opt/lib/libCore.so
#4  <signal handler called>
#5  0x00007facf7d611a6 in find_weight(float, float, std::vector<TH2F*, std::allocator<TH2F*> >, bool, bool, TString, int) () from /afs/cern.ch/work/a/asantra/public/Legacy2LJets/FlavorSymmetry/FlavourSymmetryEstimate/makeMyFSNtuple_C.so
#6  0x00007facf7d61edf in applyWeights(float, float, float, float, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /afs/cern.ch/work/a/asantra/public/Legacy2LJets/FlavorSymmetry/FlavourSymmetryEstimate/makeMyFSNtuple_C.so
#7  0x00007facf2492326 in ?? ()
#8  0x00007ffc347cacc0 in ?? ()
#9  0x00026f48000061b2 in ?? ()
#10 0x00000000062aba88 in ?? ()
#11 0x0000000000000000 in ?? ()
===========================================================


The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at http://root.cern.ch/bugs Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#5  0x00007facf7d611a6 in find_weight(float, float, std::vector<TH2F*, std::allocator<TH2F*> >, bool, bool, TString, int) () from /afs/cern.ch/work/a/asantra/public/Legacy2LJets/FlavorSymmetry/FlavourSymmetryEstimate/makeMyFSNtuple_C.so
#6  0x00007facf7d61edf in applyWeights(float, float, float, float, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /afs/cern.ch/work/a/asantra/public/Legacy2LJets/FlavorSymmetry/FlavourSymmetryEstimate/makeMyFSNtuple_C.so
#7  0x00007facf2492326 in ?? ()
#8  0x00007ffc347cacc0 in ?? ()
#9  0x00026f48000061b2 in ?? ()
#10 0x00000000062aba88 in ?? ()
#11 0x0000000000000000 in ?? ()
===========================================================

I am not sure if this crash is related to the previous crash mentioned in the first message of this thread. If not, may I know what is going wrong here?

Thank you again,
Arka

If you want to use IMT features, you have to make sure to call ROOT::EnableImplicitMT() very early in your macro, so that ROOT can set itself up correctly. Calling it after creating a TChain will most likely lead to problems, as you have encountered. Please try to move the call to the top of your macro and if you still see crashes, then please post the stack trace again and we will try to figure out what’s going wrong. Cheers,

Hi Guilherme Amadio,
Thank you for the instruction. Now I have called ROOT::EnableImplicitMT() at the beginning of the macro:

Yet, I see the crash:

===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================

Thread 8 (Thread 0x7fb64d6fb700 (LWP 12090)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007fb65833c792 in tbb::internal::futex_wait (comparand=2, futex=0x7fb651e5ff2c) at ../../include/tbb/machine/linux_common.h:60
#2  tbb::internal::binary_semaphore::P (this=0x7fb651e5ff2c) at ../../src/tbb/semaphore.h:206
#3  rml::internal::thread_monitor::commit_wait (c=..., this=0x7fb651e5ff20) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7fb651e5ff00) at ../../src/tbb/private_server.cpp:277
#5  0x00007fb65833c7d9 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007fb664d996db in start_thread (arg=0x7fb64d6fb700) at pthread_create.c:463
#7  0x00007fb66576588f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 7 (Thread 0x7fb64dafc700 (LWP 12089)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007fb65833c792 in tbb::internal::futex_wait (comparand=2, futex=0x7fb651e5fe2c) at ../../include/tbb/machine/linux_common.h:60
#2  tbb::internal::binary_semaphore::P (this=0x7fb651e5fe2c) at ../../src/tbb/semaphore.h:206
#3  rml::internal::thread_monitor::commit_wait (c=..., this=0x7fb651e5fe20) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7fb651e5fe00) at ../../src/tbb/private_server.cpp:277
#5  0x00007fb65833c7d9 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007fb664d996db in start_thread (arg=0x7fb64dafc700) at pthread_create.c:463
#7  0x00007fb66576588f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 6 (Thread 0x7fb64defd700 (LWP 12088)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007fb65833c792 in tbb::internal::futex_wait (comparand=2, futex=0x7fb651e6002c) at ../../include/tbb/machine/linux_common.h:60
#2  tbb::internal::binary_semaphore::P (this=0x7fb651e6002c) at ../../src/tbb/semaphore.h:206
#3  rml::internal::thread_monitor::commit_wait (c=..., this=0x7fb651e60020) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7fb651e60000) at ../../src/tbb/private_server.cpp:277
#5  0x00007fb65833c7d9 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007fb664d996db in start_thread (arg=0x7fb64defd700) at pthread_create.c:463
#7  0x00007fb66576588f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 5 (Thread 0x7fb64e2fe700 (LWP 12087)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007fb65833c792 in tbb::internal::futex_wait (comparand=2, futex=0x7fb651e5feac) at ../../include/tbb/machine/linux_common.h:60
#2  tbb::internal::binary_semaphore::P (this=0x7fb651e5feac) at ../../src/tbb/semaphore.h:206
#3  rml::internal::thread_monitor::commit_wait (c=..., this=0x7fb651e5fea0) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7fb651e5fe80) at ../../src/tbb/private_server.cpp:277
#5  0x00007fb65833c7d9 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007fb664d996db in start_thread (arg=0x7fb64e2fe700) at pthread_create.c:463
#7  0x00007fb66576588f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 4 (Thread 0x7fb64e6ff700 (LWP 12086)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007fb65833c792 in tbb::internal::futex_wait (comparand=2, futex=0x7fb651e5ffac) at ../../include/tbb/machine/linux_common.h:60
#2  tbb::internal::binary_semaphore::P (this=0x7fb651e5ffac) at ../../src/tbb/semaphore.h:206
#3  rml::internal::thread_monitor::commit_wait (c=..., this=0x7fb651e5ffa0) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7fb651e5ff80) at ../../src/tbb/private_server.cpp:277
#5  0x00007fb65833c7d9 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007fb664d996db in start_thread (arg=0x7fb64e6ff700) at pthread_create.c:463
#7  0x00007fb66576588f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 3 (Thread 0x7fb64eb00700 (LWP 12085)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007fb65833c792 in tbb::internal::futex_wait (comparand=2, futex=0x7fb651e6012c) at ../../include/tbb/machine/linux_common.h:60
#2  tbb::internal::binary_semaphore::P (this=0x7fb651e6012c) at ../../src/tbb/semaphore.h:206
#3  rml::internal::thread_monitor::commit_wait (c=..., this=0x7fb651e60120) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7fb651e60100) at ../../src/tbb/private_server.cpp:277
#5  0x00007fb65833c7d9 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007fb664d996db in start_thread (arg=0x7fb64eb00700) at pthread_create.c:463
#7  0x00007fb66576588f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7fb64ef01700 (LWP 12084)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007fb65833c792 in tbb::internal::futex_wait (comparand=2, futex=0x7fb651e600ac) at ../../include/tbb/machine/linux_common.h:60
#2  tbb::internal::binary_semaphore::P (this=0x7fb651e600ac) at ../../src/tbb/semaphore.h:206
#3  rml::internal::thread_monitor::commit_wait (c=..., this=0x7fb651e600a0) at ../../src/tbb/../rml/server/thread_monitor.h:259
#4  tbb::internal::rml::private_worker::run (this=0x7fb651e60080) at ../../src/tbb/private_server.cpp:277
#5  0x00007fb65833c7d9 in tbb::internal::rml::private_worker::thread_routine (arg=<optimized out>) at ../../src/tbb/private_server.cpp:223
#6  0x00007fb664d996db in start_thread (arg=0x7fb64ef01700) at pthread_create.c:463
#7  0x00007fb66576588f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7fb666ad3980 (LWP 12014)):
#0  0x00007fb6657286c2 in __GI___waitpid (pid=16344, stat_loc=stat_loc
entry=0x7ffd63a5ace8, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x00007fb665693067 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:149
#2  0x00007fb66633cb23 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x561931f347c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2119
#3  TUnixSystem::StackTrace (this=0x561931f347c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2413
#4  0x00007fb66633f514 in TUnixSystem::DispatchSignals (this=0x561931f347c0, sig=kSigSegmentationViolation) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:3644
#5  <signal handler called>
#6  0x00007fb66629b15e in TList::FindObject (this=<optimized out>, obj=0x561947b3f5b0) at /media/arka/Study1/root-6.16.00/core/cont/src/TList.cxx:614
#7  0x00007fb666296a5f in THashList::Remove (this=0x561931f3a8e0, obj=0x561947b3f5b0) at /media/arka/Study1/root-6.16.00/core/cont/src/THashList.cxx:381
#8  0x00007fb66616b640 in TROOT::Remove (this=0x7fb666677f00 <ROOT::Internal::GetROOT1()::alloc>, obj=<optimized out>) at /media/arka/Study1/root-6.16.00/core/base/src/TROOT.cxx:2622
#9  0x00007fb666208a2d in TDirectory::~TDirectory (this=0x561947b3f5b0, __in_chrg=<optimized out>) at /media/arka/Study1/root-6.16.00/core/base/src/TDirectory.cxx:121
#10 0x00007fb666208aa9 in TDirectory::~TDirectory (this=0x561947b3f5b0, __in_chrg=<optimized out>) at /media/arka/Study1/root-6.16.00/core/base/src/TDirectory.cxx:127
#11 0x00007fb666297ca0 in THashList::Delete (this=0x561931f3a8e0, option=<optimized out>) at /media/arka/Study1/root-6.16.00/core/cont/src/THashList.cxx:234
#12 0x00007fb6662070e1 in TDirectory::Close (this=0x7fb666677f00 <ROOT::Internal::GetROOT1()::alloc>, option=<optimized out>) at /media/arka/Study1/root-6.16.00/core/base/src/TDirectory.cxx:614
#13 0x00007fb66616543f in TROOT::CloseFiles (this=this
entry=0x7fb666677f00 <ROOT::Internal::GetROOT1()::alloc>) at /media/arka/Study1/root-6.16.00/core/base/src/TROOT.cxx:1177
#14 0x00007fb666165b52 in TROOT::EndOfProcessCleanups (this=0x7fb666677f00 <ROOT::Internal::GetROOT1()::alloc>) at /media/arka/Study1/root-6.16.00/core/base/src/TROOT.cxx:1253
#15 0x00007fb666339ad1 in TUnixSystem::Exit (this=<optimized out>, code=0, mode=<optimized out>) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2154
#16 0x00007fb6661eab7d in TApplication::Terminate (this=0x561931f93c80, status=0) at /media/arka/Study1/root-6.16.00/core/base/src/TApplication.cxx:1257
#17 0x00007fb6666bdee0 in TRint::HandleTermInput (this=0x561931f93c80) at /media/arka/Study1/root-6.16.00/core/rint/src/TRint.cxx:575
#18 0x00007fb66633e900 in TUnixSystem::CheckDescriptors (this=this
entry=0x561931f347c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:1322
#19 0x00007fb666340298 in TUnixSystem::DispatchOneEvent (this=0x561931f347c0, pendingOnly=<optimized out>) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:1077
#20 0x00007fb666255161 in TSystem::InnerLoop (this=0x561931f347c0) at /media/arka/Study1/root-6.16.00/core/base/src/TSystem.cxx:412
#21 TSystem::Run (this=0x561931f347c0) at /media/arka/Study1/root-6.16.00/core/base/src/TSystem.cxx:362
#22 0x00007fb6661e781f in TApplication::Run (this=this
entry=0x561931f93c80, retrn=retrn
entry=false) at /media/arka/Study1/root-6.16.00/core/base/src/TApplication.cxx:1183
#23 0x00007fb6666bf252 in TRint::Run (this=0x561931f93c80, retrn=<optimized out>) at /media/arka/Study1/root-6.16.00/core/rint/src/TRint.cxx:460
#24 0x00005619305f3a0c in main (argc=<optimized out>, argv=0x7ffd63a5ff48) at /media/arka/Study1/root-6.16.00/main/src/rmain.cxx:30
===========================================================


The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at http://root.cern.ch/bugs Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#6  0x00007fb66629b15e in TList::FindObject (this=<optimized out>, obj=0x561947b3f5b0) at /media/arka/Study1/root-6.16.00/core/cont/src/TList.cxx:614
#7  0x00007fb666296a5f in THashList::Remove (this=0x561931f3a8e0, obj=0x561947b3f5b0) at /media/arka/Study1/root-6.16.00/core/cont/src/THashList.cxx:381
#8  0x00007fb66616b640 in TROOT::Remove (this=0x7fb666677f00 <ROOT::Internal::GetROOT1()::alloc>, obj=<optimized out>) at /media/arka/Study1/root-6.16.00/core/base/src/TROOT.cxx:2622
#9  0x00007fb666208a2d in TDirectory::~TDirectory (this=0x561947b3f5b0, __in_chrg=<optimized out>) at /media/arka/Study1/root-6.16.00/core/base/src/TDirectory.cxx:121
#10 0x00007fb666208aa9 in TDirectory::~TDirectory (this=0x561947b3f5b0, __in_chrg=<optimized out>) at /media/arka/Study1/root-6.16.00/core/base/src/TDirectory.cxx:127
#11 0x00007fb666297ca0 in THashList::Delete (this=0x561931f3a8e0, option=<optimized out>) at /media/arka/Study1/root-6.16.00/core/cont/src/THashList.cxx:234
#12 0x00007fb6662070e1 in TDirectory::Close (this=0x7fb666677f00 <ROOT::Internal::GetROOT1()::alloc>, option=<optimized out>) at /media/arka/Study1/root-6.16.00/core/base/src/TDirectory.cxx:614
#13 0x00007fb66616543f in TROOT::CloseFiles (this=this
entry=0x7fb666677f00 <ROOT::Internal::GetROOT1()::alloc>) at /media/arka/Study1/root-6.16.00/core/base/src/TROOT.cxx:1177
#14 0x00007fb666165b52 in TROOT::EndOfProcessCleanups (this=0x7fb666677f00 <ROOT::Internal::GetROOT1()::alloc>) at /media/arka/Study1/root-6.16.00/core/base/src/TROOT.cxx:1253
#15 0x00007fb666339ad1 in TUnixSystem::Exit (this=<optimized out>, code=0, mode=<optimized out>) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2154
#16 0x00007fb6661eab7d in TApplication::Terminate (this=0x561931f93c80, status=0) at /media/arka/Study1/root-6.16.00/core/base/src/TApplication.cxx:1257
===========================================================

I also modified my other code to call EnableImplicitMT() at the beginning as well:

and I get the crash again:

===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================

Thread 8 (Thread 0x7fc625b4b700 (LWP 17116)):
#0  0x00007fc63db926c2 in __GI___waitpid (pid=17175, stat_loc=stat_loc
entry=0x7fc625b42de8, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x00007fc63dafd067 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:149
#2  0x00007fc63e7a6b23 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2119
#3  TUnixSystem::StackTrace (this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2413
#4  0x00007fc63e7a9514 in TUnixSystem::DispatchSignals (this=0x557eb9cfb7c0, sig=kSigSegmentationViolation) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:3644
#5  <signal handler called>
#6  0x00007fc62d2597c6 in find_weight(float, float, std::vector<TH2F*, std::allocator<TH2F*> >, bool, bool, TString, int) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#7  0x00007fc62d259d46 in applyWeights(float, float, float, float, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#8  0x00007fc624e321c6 in ?? ()
#9  0x00007fc625b45ba0 in ?? ()
#10 0x00007fc63e7122a8 in TObjArray::AddAt (this=0x557ecc4497a8, this
entry=0x7fc6086561a8, obj=0x557ebdc145d0, obj
entry=0x7fc608526470, idx=632577184, idx
entry=152) at /media/arka/Study1/root-6.16.00/core/cont/src/TObjArray.cxx:260
#11 0x00007fc62f5327db in TBranch::GetBasket (this=0x7fc608656060, basketnumber=152) at /media/arka/Study1/root-6.16.00/tree/tree/src/TBranch.cxx:1253
#12 0x00007fc62d4f19b0 in ?? () from /media/arka/Study1/Root6_Build/lib/libROOTVecOps.so
#13 0x0000000000000000 in ?? ()

Thread 7 (Thread 0x7fc625f4c700 (LWP 17115)):
#0  0x00007fc63db926c2 in __GI___waitpid (pid=17173, stat_loc=stat_loc
entry=0x7fc625f43de8, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x00007fc63dafd067 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:149
#2  0x00007fc63e7a6b23 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2119
#3  TUnixSystem::StackTrace (this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2413
#4  0x00007fc63e7a9514 in TUnixSystem::DispatchSignals (this=0x557eb9cfb7c0, sig=kSigSegmentationViolation) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:3644
#5  <signal handler called>
#6  0x00007fc62d2597c6 in find_weight(float, float, std::vector<TH2F*, std::allocator<TH2F*> >, bool, bool, TString, int) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#7  0x00007fc62d259d46 in applyWeights(float, float, float, float, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#8  0x00007fc624e321c6 in ?? ()
#9  0x00007fc625f46ba0 in ?? ()
#10 0x00007fc63e7122a8 in TObjArray::AddAt (this=0x557ecc4497a0, this
entry=0x7fc60ccd9698, obj=0x557ebdc145d0, obj
entry=0x7fc60c525b50, idx=636775584, idx
entry=188) at /media/arka/Study1/root-6.16.00/core/cont/src/TObjArray.cxx:260
#11 0x00007fc62f5327db in TBranch::GetBasket (this=0x7fc60ccd9550, basketnumber=188) at /media/arka/Study1/root-6.16.00/tree/tree/src/TBranch.cxx:1253
#12 0x00007fc62d4f19b0 in ?? () from /media/arka/Study1/Root6_Build/lib/libROOTVecOps.so
#13 0x0000000000000000 in ?? ()

Thread 6 (Thread 0x7fc62634d700 (LWP 17114)):
#0  0x00007fc63db926c2 in __GI___waitpid (pid=17183, stat_loc=stat_loc
entry=0x7fc626344de8, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x00007fc63dafd067 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:149
#2  0x00007fc63e7a6b23 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2119
#3  TUnixSystem::StackTrace (this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2413
#4  0x00007fc63e7a9514 in TUnixSystem::DispatchSignals (this=0x557eb9cfb7c0, sig=kSigSegmentationViolation) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:3644
#5  <signal handler called>
#6  0x00007fc62d2597c6 in find_weight(float, float, std::vector<TH2F*, std::allocator<TH2F*> >, bool, bool, TString, int) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#7  0x00007fc62d25a2d1 in applyWeights(float, float, float, float, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#8  0x00007fc624e321c6 in ?? ()
#9  0x00007fc626347ba0 in ?? ()
#10 0x00007fc63e7122a8 in TObjArray::AddAt (this=0x557ecc4497b0, this
entry=0x7fc614cd9128, obj=0x557ebdc145d0, obj
entry=0x7fc614525ff0, idx=640973984, idx
entry=141) at /media/arka/Study1/root-6.16.00/core/cont/src/TObjArray.cxx:260
#11 0x00007fc62f5327db in TBranch::GetBasket (this=0x7fc614cd8fe0, basketnumber=141) at /media/arka/Study1/root-6.16.00/tree/tree/src/TBranch.cxx:1253
#12 0x00007fc62d4f19b0 in ?? () from /media/arka/Study1/Root6_Build/lib/libROOTVecOps.so
#13 0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7fc62674e700 (LWP 17113)):
#0  0x00007fc63db926c2 in __GI___waitpid (pid=17148, stat_loc=stat_loc
entry=0x7fc626745de8, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x00007fc63dafd067 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:149
#2  0x00007fc63e7a6b23 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2119
#3  TUnixSystem::StackTrace (this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2413
#4  0x00007fc63e7a9514 in TUnixSystem::DispatchSignals (this=0x557eb9cfb7c0, sig=kSigSegmentationViolation) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:3644
#5  <signal handler called>
#6  0x00007fc62d2597c6 in find_weight(float, float, std::vector<TH2F*, std::allocator<TH2F*> >, bool, bool, TString, int) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#7  0x00007fc62d259d46 in applyWeights(float, float, float, float, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#8  0x00007fc624e321c6 in ?? ()
#9  0x00007fc626748ba0 in ?? ()
#10 0x00007fc63e7122a8 in TObjArray::AddAt (this=0x557ecc4497c8, this
entry=0x7fc61ccd92b8, obj=0x557ebdc145d0, obj
entry=0x7fc61c526150, idx=645172384, idx
entry=283) at /media/arka/Study1/root-6.16.00/core/cont/src/TObjArray.cxx:260
#11 0x00007fc62f5327db in TBranch::GetBasket (this=0x7fc61ccd9170, basketnumber=283) at /media/arka/Study1/root-6.16.00/tree/tree/src/TBranch.cxx:1253
#12 0x00007fc62d4f19b0 in ?? () from /media/arka/Study1/Root6_Build/lib/libROOTVecOps.so
#13 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7fc626b4f700 (LWP 17112)):
#0  0x00007fc63db926c2 in __GI___waitpid (pid=17138, stat_loc=stat_loc
entry=0x7fc626b46de8, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x00007fc63dafd067 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:149
#2  0x00007fc63e7a6b23 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2119
#3  TUnixSystem::StackTrace (this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2413
#4  0x00007fc63e7a9514 in TUnixSystem::DispatchSignals (this=0x557eb9cfb7c0, sig=kSigSegmentationViolation) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:3644
#5  <signal handler called>
#6  0x00007fc62d2597c6 in find_weight(float, float, std::vector<TH2F*, std::allocator<TH2F*> >, bool, bool, TString, int) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#7  0x00007fc62d259d46 in applyWeights(float, float, float, float, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#8  0x00007fc624e321c6 in ?? ()
#9  0x00007fc626b49ba0 in ?? ()
#10 0x00007fc63e7122a8 in TObjArray::AddAt (this=0x557ecc4497b8, this
entry=0x7fc610cd90f8, obj=0x557ebdc145d0, obj
entry=0x7fc610525fc0, idx=649370784, idx
entry=94) at /media/arka/Study1/root-6.16.00/core/cont/src/TObjArray.cxx:260
#11 0x00007fc62f5327db in TBranch::GetBasket (this=0x7fc610cd8fb0, basketnumber=94) at /media/arka/Study1/root-6.16.00/tree/tree/src/TBranch.cxx:1253
#12 0x00007fc62d4f19b0 in ?? () from /media/arka/Study1/Root6_Build/lib/libROOTVecOps.so
#13 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7fc626f50700 (LWP 17111)):
#0  0x00007fc63db926c2 in __GI___waitpid (pid=17219, stat_loc=stat_loc
entry=0x7fc626f47de8, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x00007fc63dafd067 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:149
#2  0x00007fc63e7a6b23 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2119
#3  TUnixSystem::StackTrace (this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2413
#4  0x00007fc63e7a9514 in TUnixSystem::DispatchSignals (this=0x557eb9cfb7c0, sig=kSigSegmentationViolation) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:3644
#5  <signal handler called>
#6  0x00007fc62d2597c6 in find_weight(float, float, std::vector<TH2F*, std::allocator<TH2F*> >, bool, bool, TString, int) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#7  0x00007fc62d259d46 in applyWeights(float, float, float, float, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#8  0x00007fc624e321c6 in ?? ()
#9  0x00007fc626f4aba0 in ?? ()
#10 0x00007fc63e7122a8 in TObjArray::AddAt (this=0x557ecc4497c0, this
entry=0x7fc618655fb8, obj=0x557ebdc145d0, obj
entry=0x7fc618525cf0, idx=653569184, idx
entry=158) at /media/arka/Study1/root-6.16.00/core/cont/src/TObjArray.cxx:260
#11 0x00007fc62f5327db in TBranch::GetBasket (this=0x7fc618655e70, basketnumber=158) at /media/arka/Study1/root-6.16.00/tree/tree/src/TBranch.cxx:1253
#12 0x00007fc62d4f19b0 in ?? () from /media/arka/Study1/Root6_Build/lib/libROOTVecOps.so
#13 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fc627351700 (LWP 17110)):
#0  0x00007fc63db926c2 in __GI___waitpid (pid=17224, stat_loc=stat_loc
entry=0x7fc627348de8, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x00007fc63dafd067 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:149
#2  0x00007fc63e7a6b23 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2119
#3  TUnixSystem::StackTrace (this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2413
#4  0x00007fc63e7a9514 in TUnixSystem::DispatchSignals (this=0x557eb9cfb7c0, sig=kSigSegmentationViolation) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:3644
#5  <signal handler called>
#6  0x00007fc62d2597c6 in find_weight(float, float, std::vector<TH2F*, std::allocator<TH2F*> >, bool, bool, TString, int) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#7  0x00007fc62d259d46 in applyWeights(float, float, float, float, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#8  0x00007fc624e321c6 in ?? ()
#9  0x00007fc62734bba0 in ?? ()
#10 0x00007fc63e7122a8 in TObjArray::AddAt (this=0x557ecc4497d0, this
entry=0x7fc620656be8, obj=0x557ebdc145d0, obj
entry=0x7fc620527500, idx=657767584, idx
entry=164) at /media/arka/Study1/root-6.16.00/core/cont/src/TObjArray.cxx:260
#11 0x00007fc62f5327db in TBranch::GetBasket (this=0x7fc620656aa0, basketnumber=164) at /media/arka/Study1/root-6.16.00/tree/tree/src/TBranch.cxx:1253
#12 0x00007fc62d4f19b0 in ?? () from /media/arka/Study1/Root6_Build/lib/libROOTVecOps.so
#13 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fc63ef3d980 (LWP 17058)):
#0  0x00007fc63db926c2 in __GI___waitpid (pid=17131, stat_loc=stat_loc
entry=0x7ffec5066268, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x00007fc63dafd067 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:149
#2  0x00007fc63e7a6b23 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2119
#3  TUnixSystem::StackTrace (this=0x557eb9cfb7c0) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:2413
#4  0x00007fc63e7a9514 in TUnixSystem::DispatchSignals (this=0x557eb9cfb7c0, sig=kSigSegmentationViolation) at /media/arka/Study1/root-6.16.00/core/unix/src/TUnixSystem.cxx:3644
#5  <signal handler called>
#6  0x00007fc62d2597c6 in find_weight(float, float, std::vector<TH2F*, std::allocator<TH2F*> >, bool, bool, TString, int) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#7  0x00007fc62d25a7c7 in applyWeights(float, float, float, float, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#8  0x00007fc624e321c6 in ?? ()
#9  0x00007ffec5068ff0 in ?? ()
#10 0x00007fc63e7122a8 in TObjArray::AddAt (this=0x557ecc4497d8, this
entry=0x557eca4de5d8, obj=0x557ebdc145d0, obj
entry=0x557eca6ac060, idx=-989425424, idx
entry=0) at /media/arka/Study1/root-6.16.00/core/cont/src/TObjArray.cxx:260
#11 0x00007fc62f5327db in TBranch::GetBasket (this=0x557eca4de490, basketnumber=0) at /media/arka/Study1/root-6.16.00/tree/tree/src/TBranch.cxx:1253
#12 0x00007fc62d4f19b0 in ?? () from /media/arka/Study1/Root6_Build/lib/libROOTVecOps.so
#13 0x0000000000000000 in ?? ()
===========================================================


The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at http://root.cern.ch/bugs Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#6  0x00007fc62d2597c6 in find_weight(float, float, std::vector<TH2F*, std::allocator<TH2F*> >, bool, bool, TString, int) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#7  0x00007fc62d259d46 in applyWeights(float, float, float, float, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::vector<TH2F*, std::allocator<TH2F*> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /media/arka/OS/2LJets/ForIFIC/makeMyFSNtuple_C.so
#8  0x00007fc624e321c6 in ?? ()
#9  0x00007fc625b45ba0 in ?? ()
#10 0x00007fc63e7122a8 in TObjArray::AddAt (this=0x557ecc4497a8, this
entry=0x7fc6086561a8, obj=0x557ebdc145d0, obj
entry=0x7fc608526470, idx=632577184, idx
entry=152) at /media/arka/Study1/root-6.16.00/core/cont/src/TObjArray.cxx:260
#11 0x00007fc62f5327db in TBranch::GetBasket (this=0x7fc608656060, basketnumber=152) at /media/arka/Study1/root-6.16.00/tree/tree/src/TBranch.cxx:1253
#12 0x00007fc62d4f19b0 in ?? () from /media/arka/Study1/Root6_Build/lib/libROOTVecOps.so
#13 0x0000000000000000 in ?? ()

===========================================================

Please have a look and suggest me a solution.

Thank you very much,
Arka

Hi, that’s strange, how are you running your macro? Can you try to run with root -t ... if you are running from the command line with root? If you still get the crash, can you maybe make a reproducer that can run independently (i.e. 1 macro file + 1 data file if possible)? I would like to try running here to check what is happening. Thank you.

Hi Guilherme Amadio,
Strangely I removed the EnableImplicitMT() from my code and yet I was getting the crash. The standalone code (makeAlphaK.C) and one sample root file (ttbar_merged_processed.root) on which I am working are kept here:

https://drive.google.com/drive/folders/1gPNJYoKKsLWFPdQX1d79vs2ZoZY7-LCs?usp=sharing

To run the code:
root -l -b -t
.L makeAlphaK.C++
makeAlphak(“MC”,“MC16ade”,“v1.6”)

.q

Please let me know if I can help you in any other way.

Cheers,
Arka

When I ran as above, your macro didn’t crash, only when I typed .q ROOT crashed, and that’s most likely due to memory management issues from things being closed/deleted by hand, then at tear down ROOT tries to delete objects that were already deleted. When I compiled your macro, I got this error:

$ a.out 
Making Alpha and K for  MC
The output file for alpha weights: v1.6/TxtFiles/alphaFactors_MC16ade_MC.root
The output file for lep0 weights: v1.6/TxtFiles/kFactors_lep0_MC16ade_MC.root
The output file for lep1 weights: v1.6/TxtFiles/kFactors_lep1_MC16ade_MC.root
The output file for alpha plots: v1.6/plots/alphaFactors_MC16ade_MC_plots.root
The output file for lep0 plots: v1.6/plots/kFactors_lep0_MC16ade_MC_plots.root
The output file for lep1 plots: v1.6/plots/kFactors_lep1_MC16ade_MC_plots.root
-----------------
Processing MC
Including ttbar
ttbar_merged_processed.root
Looping over 8760798 events
input_line_64:10:8: error: use of undeclared identifier 'lumiWeight'
return lumiWeight(sampleTag, luminosity, genWeight, eventWeight, leptonWeight, jvtWeight, bTagWeight, pileupWeight, FFWeight)
       ^
terminate called after throwing an instance of 'std::runtime_error'
  what():  Cannot interpret the following expression:
lumiWeight(sampleTag, luminosity, genWeight, eventWeight, leptonWeight, jvtWeight, bTagWeight, pileupWeight, FFWeight)

Make sure it is valid C++.
Aborted (core dumped)

The function does exist in the body of the macro, so maybe the parameter list is not correct, or there is a bug in RDataFrame that the function is not recognized as valid code.

lumiWeight is declared as a standard function but then it is used inside a string – the problem might be that the interpreter is not able to lookup lumiWeight. Passing the definition of lumiWeight to gInterpreter->Declare might fix it.

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