Problem with hadd since root 5.30

Hello,

I’m having a problem when using hadd with root versions >= 5.30.
I don’t know what to say to help solving the problem. I just noticed that for working version I had:

Target file: test.root Source file 1: test_0.root Source file 2: test_1.root Source file 3: test_2.root Source file 4: test_3.root Sources and Target have different compression levels Merging will be slower Target path: test.root:/ test_0.root tree:crm entries=1234567890 test_1.root tree:crm entries=1234567890 test_2.root tree:crm entries=1234567890 test_3.root tree:crm entries=1234567890
but for non working version the part:

test_0.root tree:crm entries=1234567890 test_1.root tree:crm entries=1234567890 test_2.root tree:crm entries=1234567890 test_3.root tree:crm entries=1234567890
wasn’t printed.

Here is the log for root version 5.32.00:

[code]
hadd Target file: test.root
hadd Source file 1: test_0.root
hadd Source file 2: test_1.root
hadd Source file 3: test_2.root
hadd Source file 4: test_3.root
hadd Sources and Target have different compression levels
hadd merging will be slower
hadd Target path: test.root:/

*** Break *** segmentation violation

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

#0 0x00002b00917f8115 in waitpid () from /lib64/libc.so.6
#1 0x00002b009179a481 in do_system () from /lib64/libc.so.6
#2 0x00002b008fa95032 in TUnixSystem::StackTrace() ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libCore.so
#3 0x00002b008fa91f6a in TUnixSystem::DispatchSignals(ESignals) ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libCore.so
#4
#5 0x00002b008e5efcaa in TBranch::FillLeavesImpl(TBuffer&) ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so
#6 0x00002b008e5f22e0 in TBranch::Fill() ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so
#7 0x00002b008e643e33 in TTree::Fill() ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so
#8 0x00002b008e646d8f in TTree::CopyEntries(TTree*, long long, char const*) ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so
#9 0x00002b008e64c7ba in TTree::Merge(TCollection*, TFileMergeInfo*) ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so
#10 0x00002b008e65f02e in ROOT::merge_TTree(void*, TCollection*, TFileMergeInfo*) () from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so
#11 0x00002b008d162e48 in TFileMerger::MergeRecursive(TDirectory*, TList*, int)
()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libRIO.so
#12 0x00002b008d161eff in TFileMerger::PartialMerge(int) ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libRIO.so
#13 0x00002b008d160e22 in TFileMerger::Merge(bool) ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libRIO.so
#14 0x00000000004022ce in main ()

The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug 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 0x00002b008e5efcaa in TBranch::FillLeavesImpl(TBuffer&) ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so
#6 0x00002b008e5f22e0 in TBranch::Fill() ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so
#7 0x00002b008e643e33 in TTree::Fill() ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so
#8 0x00002b008e646d8f in TTree::CopyEntries(TTree*, long long, char const*) ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so
#9 0x00002b008e64c7ba in TTree::Merge(TCollection*, TFileMergeInfo*) ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so
#10 0x00002b008e65f02e in ROOT::merge_TTree(void*, TCollection*, TFileMergeInfo*) () from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so
#11 0x00002b008d162e48 in TFileMerger::MergeRecursive(TDirectory*, TList*, int)
()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libRIO.so
#12 0x00002b008d161eff in TFileMerger::PartialMerge(int) ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libRIO.so
#13 0x00002b008d160e22 in TFileMerger::Merge(bool) ()
from /afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libRIO.so
#14 0x00000000004022ce in main ()

*** glibc detected *** hadd: free(): invalid next size (normal): 0x00000000071bd080 ***
======= Backtrace: =========
/lib64/libc.so.6[0x2b00917d045f]
/lib64/libc.so.6(cfree+0x4b)[0x2b00917d08bb]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so(_ZN6TLeafFD0Ev+0x3d)[0x2b008e6340ad]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libCore.so(_ZN11TCollection14GarbageCollectEP7TObject+0x79)[0x2b008fa39c39]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libCore.so(_ZN9TObjArray6DeleteEPKc+0x37)[0x2b008fa41f57]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so(_ZN7TBranchD0Ev+0x15a)[0x2b008e5f581a]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libCore.so(_ZN11TCollection14GarbageCollectEP7TObject+0x79)[0x2b008fa39c39]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libCore.so(_ZN9TObjArray6DeleteEPKc+0x37)[0x2b008fa41f57]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so(_ZN5TTreeD0Ev+0x113)[0x2b008e6486a3]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libCore.so(_ZN11TCollection14GarbageCollectEP7TObject+0x79)[0x2b008fa39c39]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libCore.so(_ZN5TList6DeleteEPKc+0x198)[0x2b008fa3fbf8]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libRIO.so(_ZN14TDirectoryFile5CloseEPKc+0xb7)[0x2b008d141907]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libRIO.so(_ZN5TFile5CloseEPKc+0xe1)[0x2b008d152201]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libCore.so[0x2b008f9ed6fd]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libCore.so(_ZN5TROOT10CloseFilesEv+0x3a)[0x2b008f9f0a3a]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libCore.so(_ZN11TUnixSystem4ExitEib+0x1e)[0x2b008fa8e7ee]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libCore.so(_ZN11TUnixSystem15DispatchSignalsE8ESignals+0x15d)[0x2b008fa91fed]
/lib64/libpthread.so.0[0x2b0091550b10]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so(_ZN7TBranch14FillLeavesImplER7TBuffer+0x3a)[0x2b008e5efcaa]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so(_ZN7TBranch4FillEv+0x180)[0x2b008e5f22e0]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so(_ZN5TTree4FillEv+0x93)[0x2b008e643e33]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so(_ZN5TTree11CopyEntriesEPS_xPKc+0x18f)[0x2b008e646d8f]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so(_ZN5TTree5MergeEP11TCollectionP14TFileMergeInfo+0xda)[0x2b008e64c7ba]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libTree.so[0x2b008e65f02e]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libRIO.so(_ZN11TFileMerger14MergeRecursiveEP10TDirectoryP5TListi+0xab8)[0x2b008d162e48]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libRIO.so(_ZN11TFileMerger12PartialMergeEi+0xef)[0x2b008d161eff]
/afs/in2p3.fr/system/amd64_sl5/usr/local/root/v5.32.00/lib/libRIO.so(_ZN11TFileMerger5MergeEb+0x12)[0x2b008d160e22]
hadd(main+0x9ee)[0x4022ce]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x2b009177b994]
hadd(__gxx_personality_v0+0x1e1)[0x4017b9][/code]

I’ll try to make a small version of the code to reproduce the problem and post it as soon as possible.

Thank you very much,
Benoit

Hi Benoit,

If you are able to provide us with the ROOT file, we will try to reproduce (and fix) the problem.

Cheers,
Philippe.

I am having a similar issue with 5_3_22_patch1. Is there a fix? I can send you root files if you still need them.

Thanks

Hi,

Yes we still need some files to reproduce this problem.

Cheers,
Philippe.

Hi,

Note that hadd requires object that are readable without the shared library implementing those objects or a way to automatically load those library (for example having rootmap files).

Cheers,
Philippe.