Issue wuth several TTreeReaderArray pointing to the same branch

Dear all,

The question is in the title : should we expect issues when several TTreeReaderArray are pointing to the exat same branch ?

I’m asking because I’m having this precise use case where several sub-algorithms can be configured at run time to do calculation on some branches. And it happens regularly that several of them point to the same branches.
In this case I get unreproducible crashes : they occur ~1/3 of the runs and are like below.

So should I make sure there’s only 1 TTreeReaderArray per branch ? Else I guess something is wrong in my own code…

Thanks !



Thread 1 (Thread 0x7ff21a29a700 (LWP 12006)): #0 0x00007ff2197d8e53 in waitpid () from /lib64/ #1 0x00007ff21975afbc in do_system () from /lib64/ #2 0x00007ff216443474 in Exec (shellcmd=<optimized out>, this=<optimized out>) at /home/delsart/SOFTWARE/root_src/root/core/unix/src/TUnixSystem.cxx:2116 #3 TUnixSystem::StackTrace (this=0xa954f0) at /home/delsart/SOFTWARE/root_src/root/core/unix/src/TUnixSystem.cxx:2403 #4 0x00007ff2163562ca in DefaultErrorHandler (level=<optimized out>, abort_bool=<optimized out>, location=0x7ff1fa884898 "TTreeReaderArrayBase::CreateProxy()", msg=0x7fffff91ad40 "No fImpl set!") at /home/delsart/SOFTWARE/root_src/root/core/base/src/TError.cxx:192 #5 0x00007ff216355d42 in ErrorHandler(Int_t, const char *, const char *, typedef __va_list_tag __va_list_tag *) (level=level entry=6000, location=location entry=0x7ff1fa884898 "TTreeReaderArrayBase::CreateProxy()", fmt=fmt entry=0x7ff1fa884328 "No fImpl set!", ap=ap entry=0x7fffff91ae88) at /home/delsart/SOFTWARE/root_src/root/core/base/src/TError.cxx:251 #6 0x00007ff216356182 in Fatal (location=location entry=0x7ff1fa884898 "TTreeReaderArrayBase::CreateProxy()", fmt=fmt entry=0x7ff1fa884328 "No fImpl set!") at /home/delsart/SOFTWARE/root_src/root/core/base/src/TError.cxx:347 #7 0x00007ff1fa86b3eb in ROOT::Internal::TTreeReaderArrayBase::CreateProxy (this=0x5bf87f0) at /home/delsart/SOFTWARE/root_src/root/tree/treeplayer/src/TTreeReaderArray.cxx:336 #8 0x00007ff1fa85f669 in TTreeReader::SetEntryBase (this=this entry=0x7fffff91b200, entry=entry entry=0, local=local entry=false) at /home/delsart/SOFTWARE/root_src/root/tree/treeplayer/src/TTreeReader.cxx:320 #9 0x00007ff1fa0f8f03 in SetEntry (entry=0, this=0x7fffff91b200) at /home/delsart/SOFTWARE/root/include/TTreeReader.h:162


can you share a simplified reproducer for this one? I cannot manage to trigger the error…



So I could reproduce the error with a minimal “framework”.
I attach below a c++ file and a python script to drive the c++ code.
The input file is obtain by running

root $ROOTSYS/root/tutorials/tree/hvector.C

then just running ‘python’ a few times is enough to trigger an error. As described before the error doesn’t occur systematically, or if the python script doesn’t contain enough “addTask()” call…



ps: the crash

Thread 1 (Thread 0x7f0b174b4700 (LWP 1368)): #0 0x00007f0b169f2e53 in waitpid () from /lib64/ #1 0x00007f0b16974fbc in do_system () from /lib64/ #2 0x00007f0b13f10474 in Exec (shellcmd=<optimized out>, this=<optimized out>) at /home/delsart/SOFTWARE/root_src/root/core/unix/src/TUnixSystem.cxx:2116 #3 TUnixSystem::StackTrace (this=0x1a95440) at /home/delsart/SOFTWARE/root_src/root/core/unix/src/TUnixSystem.cxx:2403 #4 0x00007f0b13e232ca in DefaultErrorHandler (level=<optimized out>, abort_bool=<optimized out>, location=0x7f0afda84898 "TTreeReaderArrayBase::CreateProxy()", msg=0x7ffda802b1d0 "No fImpl set!") at /home/delsart/SOFTWARE/root_src/root/core/base/src/TError.cxx:192 #5 0x00007f0b13e22d42 in ErrorHandler(Int_t, const char *, const char *, typedef __va_list_tag __va_list_tag *) (level=level entry=6000, location=location entry=0x7f0afda84898 "TTreeReaderArrayBase::CreateProxy()", fmt=fmt entry=0x7f0afda84328 "No fImpl set!", ap=ap entry=0x7ffda802b318) at /home/delsart/SOFTWARE/root_src/root/core/base/src/TError.cxx:251 #6 0x00007f0b13e23182 in Fatal (location=location entry=0x7f0afda84898 "TTreeReaderArrayBase::CreateProxy()", fmt=fmt entry=0x7f0afda84328 "No fImpl set!") at /home/delsart/SOFTWARE/root_src/root/core/base/src/TError.cxx:347 #7 0x00007f0afda6b3eb in ROOT::Internal::TTreeReaderArrayBase::CreateProxy (this=0x50753b0) at /home/delsart/SOFTWARE/root_src/root/tree/treeplayer/src/TTreeReaderArray.cxx:336 #8 0x00007f0afda5f669 in TTreeReader::SetEntryBase (this=0x7ffda802b710, entry=0, local=<optimized out>) at /home/delsart/SOFTWARE/root_src/root/tree/treeplayer/src/TTreeReader.cxx:320 #9 0x00007f0b174ceb1d in ?? () #10 0x00007f0b0f3bff70 in ?? () from /home/delsart/SOFTWARE/root/lib/ #11 0x0000000004dd8b10 in ?? () #12 0x00007f0b174ce000 in ?? () #13 0x00007ffda802b650 in ?? () #14 0x0000000004dd37e8 in ?? () #15 0x00007f0b13c08660 in ?? () from /lib64/ #16 0x00007ffda802b658 in ?? () #17 0x0000000001b3e0f0 in ?? () #18 0x0000000000000030 in ?? () #19 0x00007ffda802b650 in ?? () #20 0x0000000004dd37e8 in ?? () #21 0x00007f0b13c06880 in ?? () from /lib64/ #22 0x00007f0b13c06880 in ?? () from /lib64/ #23 0x00007f0b13c06880 in ?? () from /lib64/ #24 0x00000000000061a8 in ?? () #25 0x0000000003c116b0 in ?? () #26 0x00007f0b174ce000 in ?? () #27 0x0000000003beae90 in ?? () #28 0x00007f0b0f367dc0 in ?? () from /home/delsart/SOFTWARE/root/lib/ #29 0x00007f0b13c08660 in ?? () from /lib64/ #30 0x0000000003bea070 in ?? () #31 0x00007f0b0f3bde18 in cling::IncrementalExecutor::getPointerToGlobalFromJIT(llvm::GlobalValue const&) () from /home/delsart/SOFTWARE/root/lib/ #32 0x00007ffda802b920 in ?? () #33 0x0000000004d8f060 in ?? () #34 0x00007ffda802b790 in ?? () #35 0x0000000000000000 in ?? ()
test.C (966 Bytes) (588 Bytes)


Just to let you know: I’ll debug this tomorrow!



I believe I need the file called hvector.root to reproduce this, right? Could you send it / put it into your public afs directory?


Hello Axel,

I made it by running :



Hi P-A,

Indeed, a bug.

This is fixed in the master. If our nightly tests succeed I’ll merge that into v6-08; it will be part of a future 6.08/04. Until then you’ll have to build your own ROOT…

Cheers, Axel.

Will appear in v6.08/04 (i.e. I have merged the fix into that branch, too).

Again, thanks for your report!


Thanks for the quick fix !