Re: Re: Add THnSparse problem

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Fri, 16 May 2008 19:27:59 +0200


Hi Smbat,

yes, that seg fault is what I fixed in the trunk. You need the trunk + the uncommented line in Add.C, only then do you get proper results.

FYI, hadd in the trunk can now add THnSparse objects, too. Anything deriving from TObject and implementing Merge(TCollection*), actually. So just run "hadd out.root run1.root run2.root".

Cheers, Axel.

Smbat Grigoryan wrote:
> Hi Axel,
>
> I commented the line nextsource->cd( path ); since the uncommented
> version gives segmentation violation, please see the output at the end
> of this mail.
> Thanks for fixing the problem in the trunk, I'll check when
> will update my ROOT.
> Cheers, Smbat
>
> On Fri, 16 May 2008, Axel Naumann wrote:
>

>> Hi Smbat,
>>
>> the bug was triggered by THnSparse objects read from file that got additional
>> bins appended; it's fixed in the trunk. Thanks so much for pointing it out!
>>
>> In your hadd script you commented the nextsource->cd( path ); line - uncomment
>> it and it will work. Otherwise you are adding the first histogram to the first
>> histogram. In your failing example the number of entries was twice the number
>> of entries of the first histogram. BUT this will only work with the trunk,
>> i.e. ROOT from today!
>>
>> Btw, ROOT's hadd utility will soon add THnSparses, too.
>>
>> Cheers, Axel.
>>
>> On 2008-05-15 19:18, Axel Naumann wrote:
>>> Hi Smbat,
>>>
>>> I see that in your example THnSpare::Add() writes to a memory location that
>>> it shouldn't be writing to. I'll fix it tomorrow. It might or might not be
>>> related to the problem with the number of entries you observed.
>>>
>>> Cheers, Axel
>>>
>>>
>>> Smbat Grigoryan wrote:
>>>> Hi,
>>>>
>>>> I have the following problem when merging root files including THnSparse.
>>>> I've modified the hadd.C macro from the tutorials,
>>>> adding the part for THnSparse like it is done for histograms
>>>> (see Add.C in the attachment). To show the problem I included
>>>> in the attachment 2 root files containing THnSparse of dim 5
>>>> and the resulting root file obtained using Add.C. The problem is that the
>>>> number of entries of the resulting THnSparse is not equal (is smaller) to
>>>> the sum of entries of the initial THnSparse-s. In the attachment you can
>>>> find a
>>>> small macro which shows that the method THnSparse::Add() works correctly
>>>> when used directly, but not in Add.C.
>>>> Apparently the problem is in Add.C
>>>> Could anybody help to correct Add.C for THnSparse?
>>>>
>>>> Thanks in advance,
>>>> Smbat

>
> root [0] .L Add.C+
> Info in <TUnixSystem::ACLiC>: creating shared library
> /users/divers/alice/smbat/ParamPythia08/./Add_C.so
> root [1] Add()
>
> *** Break *** segmentation violation
> (no debugging symbols found)
> Using host libthread_db library "/lib/tls/libthread_db.so.1".
> Attaching to program: /proc/5113/exe, process 5113
> (no debugging symbols found)...done.
> (no debugging symbols found)...done.
> [Thread debugging using libthread_db enabled]
> [New Thread -1208326464 (LWP 5113)]
> (no debugging symbols found)...done.
> (no debugging symbols found)...done.
> (no debugging symbols found)...done.
> (no debugging symbols found)...done.
> (no debugging symbols found)...done.
> (no debugging symbols found)...done.
> (no debugging symbols found)...done.
> (no debugging symbols found)...done.
> (no debugging symbols found)...done.
> (no debugging symbols found)...done.
> (no debugging symbols found)...done.
> 0x009ef7a2 in _dl_sysinfo_int80 ()
> from /lib/ld-linux.so.2
> #1 0x010017e3 in __waitpid_nocancel () from /lib/tls/libc.so.6
> #2 0x00fab649 in do_system () from /lib/tls/libc.so.6
> #3 0x009688bd in system () from /lib/tls/libpthread.so.0
> #4 0x002ce58f in TUnixSystem::Exec () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #5 0x002d403d in TUnixSystem::StackTrace ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #6 0x002d0c5a in TUnixSystem::DispatchSignals ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #7 0x002d0ce8 in SigHandler () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #8 0x002cff35 in sighandler () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #9 <signal handler called>
> #10 0x00ad1946 in G__get_ifunc_internal ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCint.so
> #11 0x00a82781 in Cint::G__MethodInfo::IsValid ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCint.so
> #12 0x00a83fed in Cint::G__MethodInfo::GetThisPointerOffset ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCint.so
> #13 0x00a7cf8a in Cint::G__CallFunc::Execute ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCint.so
> #14 0x002ad72d in TClass::Streamer () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #15 0x0495a110 in TBufferFile::WriteObject ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRIO.so
> #16 0x0495a23e in TBufferFile::WriteObjectAny ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRIO.so
> #17 0x049599c0 in TBufferFile::WriteFastArray ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRIO.so
> #18 0x049f447e in TStreamerInfo::WriteBufferAux<char**> ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRIO.so
> #19 0x0495bd72 in TBufferFile::WriteClassBuffer ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRIO.so
> #20 0x03c2c04e in THnSparseArrayChunk::Streamer ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libHist.so
> #21 0x002ad6d0 in TClass::Streamer () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #22 0x0495a110 in TBufferFile::WriteObject ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRIO.so
> #23 0x0495a23e in TBufferFile::WriteObjectAny ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRIO.so
> #24 0x00297453 in TObjArray::Streamer ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #25 0x002ad6d0 in TClass::Streamer () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #26 0x049598d9 in TBufferFile::WriteFastArray ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRIO.so
> #27 0x049f2e28 in TStreamerInfo::WriteBufferAux<char**> ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRIO.so
> #28 0x0495bd72 in TBufferFile::WriteClassBuffer ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRIO.so
> #29 0x03c29e2e in THnSparse::Streamer ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libHist.so
> #30 0x03cdfdf5 in THnSparse::StreamerNVirtual ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libHist.so
> #31 0x03c883d3 in G__G__Hist_192_0_66 ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libHist.so
> #32 0x00a7cfe4 in Cint::G__CallFunc::Execute ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCint.so
> #33 0x002c2d4d in TMethodCall::Execute ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #34 0x002c738f in TStreamerBase::WriteBuffer ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #35 0x049f6081 in TStreamerInfo::WriteBufferAux<char**> ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRIO.so
> #36 0x0495bd72 in TBufferFile::WriteClassBuffer ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRIO.so
> #37 0x03c2a852 in THnSparseT<TArrayF>::Streamer ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libHist.so
> #38 0x04988220 in TKey::TKey () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRIO.so
> #39 0x0496fc45 in TFile::CreateKey () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRIO.so
> #40 0x04964b79 in TDirectoryFile::WriteTObject ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRIO.so
> #41 0x00232c38 in TObject::Write () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #42 0x00232ab3 in TObject::Write () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #43 0x05d01e69 in MergeRootfile () from
> /users/divers/alice/smbat/ParamPythia08/./Add_C.so
> #44 0x05d02024 in Add () from
> /users/divers/alice/smbat/ParamPythia08/./Add_C.so
> #45 0x05d02172 in G__filempkO0U__0_392 () from
> /users/divers/alice/smbat/ParamPythia08/./Add_C.so
> #46 0x00a4299f in Cint::G__ExceptionWrapper ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCint.so
> #47 0x00af84ad in G__call_cppfunc () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCint.so
> #48 0x00ade741 in G__interpret_func () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCint.so
> #49 0x00acd7ce in G__getfunction () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCint.so
> #50 0x00ab3158 in G__getitem () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCint.so
> #51 0x00ab5c83 in G__getexpr () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCint.so
> #52 0x00b2529b in G__exec_statement () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCint.so
> #53 0x00aa1038 in G__exec_tempfile_core ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCint.so
> #54 0x00aa2373 in G__exec_tempfile_fp ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCint.so
> #55 0x00b2e96c in G__process_cmd () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCint.so
> #56 0x002a0f23 in TCint::ProcessLine () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #57 0x0020e236 in TApplication::ProcessLine ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #58 0x008461b1 in TRint::HandleTermInput ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRint.so
> #59 0x0084482c in TTermInputHandler::Notify ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRint.so
> #60 0x00846aa6 in TTermInputHandler::ReadNotify ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRint.so
> #61 0x002ccf1a in TUnixSystem::CheckDescriptors ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #62 0x002d1138 in TUnixSystem::DispatchOneEvent ()
> from /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #63 0x00263b9c in TSystem::InnerLoop () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #64 0x00263963 in TSystem::Run () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #65 0x0020e322 in TApplication::Run () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libCore.so
> #66 0x00844fa6 in TRint::Run () from
> /scratch/vulpescu/Software/ALICE/ROOT/v5-19-02/lib/libRint.so
> #67 0x08048d46 in main ()
>
>
Received on Fri May 16 2008 - 19:28:11 CEST

This archive was generated by hypermail 2.2.0 : Sat May 17 2008 - 17:50:01 CEST