0: caught exception triggered by signal '1' while merging ob

Hello,

I believe it’s a bug in ROOT TTreeCache handling code.
Here is the minimal code which reproduces the problem.

It has nothing to do with PROOF except the fact that PROOF implicitly enables the cache for input files.

The exact portion of code which triggers the bug was:

     T_select = fChain->CloneTree(0);
     T_select->SetDirectory(f_select);

I.e. clone input tree, then output it to the TProofOutputFile (f_select). The TTree::SetDirectory() on cloned tree somehow makes both input and output files share the same TTreeCache. Eventually destructors (or Close() methods) of both files will try to remove the same pointer which will lead to crash.

P.S.
I think it’s worth mentioning here because the “pre-selection” approach with CloneTree() might be a common scenario in PROOF analyses.