Root file crashes root

Hello,

I just created several root files. I can view all of the branches and leafs with the TBrowser. I can even histogram the contents of the leafs. When I try and access an event with GetEntry(), root crashes. This occured with root versions 5.08 and 4.04.
Here, is an example of what I am doing.

root [0] TFile *f = new TFile (“digis_zprime700_mumu_1.root”);
root [1] TTree t=(TTree)f->Get(“Analysis”);
root [2] int NSim;
root [3] t->SetBranchAddress(“SimPart_size”,&NSim)
root [4] TLeaf *leafSimPID = t->GetLeaf(“SimPart.PID”);
root [5] int NoOfEvents = t->GetEntries();
root [6] t->GetEntry(5);

*** Break *** segmentation violation

Thanks,

Mike

Hi,

please send the output of t->GetBranch(“SimPart_size”)->Print().

Axel.

Hi Axel,

Here is the output.

root [0] TFile *f = new TFile (“digis_zprime700_mumu_1.root”);
root [1] TTree t=(TTree)f->Get(“Analysis”);
root [2] t->GetBranch(“SimPart_size”)->Print()
*Br 0 :SimPart_size : SimPart_size/I *
*Entries : 1000 : Total Size= 24460 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *

root [3]

Hi,

this is strange. Can I have a look at your file (e.g. email to Axel.Naumann@cern.ch)? Or can you run t->MakeClass(“Test”), and check the generated Test.h how that guy sets the branch address for your SimPart_size branch?

Cheers, Axel.

Hi Axel,

They are to big to mail (~70 mb), so I moved one of the root files to my uscms account at:

/uscms/home/rmr

Thanks for all your help.

Mike

Hi,

I cannot (or I don’t know how to) reach it from the machines at cern.ch that I have access to. Can you put it into some web space? Or clone only the tree’s first event into a new file, and send that by mail?

Cheers, Axel.

Hi Axel,

I put one of the root files named digis_zprime700_mumu_1.root at the following path /afs/cern.ch/user/h/hmermerk/scratch0

Thanks,

Mike

Hi Axel,

I reprossesed these events with ExRootAnalysis in ORCA_8_7_3 and I get the same result.

Mike

[quote]I put one of the root files named digis_zprime700_mumu_1.root at the following path /afs/cern.ch/user/h/hmermerk/scratch0
[/quote]This directory is protected in such a way that I can not acceed it:

ls: /afs/cern.ch/user/h/hmermerk/scratch0/digis_zprime700_mumu_1.root: Permission denied
Philippe

Sorry, about that it is also at the following web address,

my.fit.edu/~rralich/digis_zprime700_mumu_1.root

Thanks,

Mike

Hi Mike,

I can not reproduce this problem. I recommend that you run your example using valgrind (valgrind.kde.org).

Also I note that you have added several branches (like SimPart_size) that is duplicating information already readily available in your TTree (It seems to be the size of the TClonesArray SimPart). Maybe there is a better/more efficient way to handle what you are trying to do (Aka please let me know why you chose to add these branches).

Cheers,
Philippe.

Hello,

I do not have this problem in windows, but when I close root after using t->GetEntry(5); , I get an error saying “root.exe has encountered a problem and needs to close”. Also, I have tried this on 2 different computers with CERN scientific linux, and I still get the original problem. I tried valgrind, but I still have the same problem.

As far as the extraTLeafs in my TTree, I know the same info. is in @size. I just haven’t changed my ExRootAnalysis scripts yet.

Thanks to all,

Mike

Hi Phillippe,

Here is the valgrind output when I run the GetEntry, I can’t make heads or tails of it.

==5346== Invalid write of size 4
==5346== at 0x414DA6F: TBuffer::ReadFastArray(float*, int) (in /home/mike/root/lib/libCore.so)
==5346== by 0x4227EDD: int TStreamerInfo::ReadBuffer<char**>(TBuffer&, char** const&, int, int, int, int) (in /home/mike/root/lib/libCore.so)
==5346== by 0x4222856: TStreamerInfo::ReadBufferClones(TBuffer&, TClonesArray*, int, int, int) (in /home/mike/root/lib/libCore.so)
==5346== by 0x4FF681F: TBranchElement::ReadLeaves(TBuffer&) (in /home/mike/root/lib/libTree.so)
==5346== by 0x4FEB6FC: TBranch::GetEntry(long long, int) (in /home/mike/root/lib/libTree.so)
==5346== by 0x4FF4E25: TBranchElement::GetEntry(long long, int) (in /home/mike/root/lib/libTree.so)
==5346== by 0x4FF4DC3: TBranchElement::GetEntry(long long, int) (in /home/mike/root/lib/libTree.so)
==5346== by 0x50223AB: TTree::GetEntry(long long, int) (in /home/mike/root/lib/libTree.so)
==5346== by 0x5045D40: G__G__Tree_137_8_5(G__value*, char const*, G__param*, int) (in /home/mike/root/lib/libTree.so)
==5346== by 0x4796FB5: G__ExceptionWrapper (in /home/mike/root/lib/libCint.so)
==5346== by 0x4826D5A: G__call_cppfunc (in /home/mike/root/lib/libCint.so)
==5346== by 0x4815ABA: G__interpret_func (in /home/mike/root/lib/libCint.so)
==5346== Address 0x575AA54 is 0 bytes after a block of size 44 alloc’d
==5346== at 0x401AE0A: operator new (vg_replace_malloc.c:197)
==5346== by 0x4208BFD: TClass::New(TClass::ENewType) (in /home/mike/root/lib/libCore.so)
==5346== by 0x41DFC1B: TClonesArray::ExpandCreateFast(int) (in /home/mike/root/lib/libCore.so)
==5346== by 0x4FF67C6: TBranchElement::ReadLeaves(TBuffer&) (in /home/mike/root/lib/libTree.so)
==5346== by 0x4FEB6FC: TBranch::GetEntry(long long, int) (in /home/mike/root/lib/libTree.so)
==5346== by 0x4FF4D78: TBranchElement::GetEntry(long long, int) (in /home/mike/root/lib/libTree.so)
==5346== by 0x50223AB: TTree::GetEntry(long long, int) (in /home/mike/root/lib/libTree.so)
==5346== by 0x5045D40: G__G__Tree_137_8_5(G__value*, char const*, G__param*, int) (in /home/mike/root/lib/libTree.so)
==5346== by 0x4796FB5: G__ExceptionWrapper (in /home/mike/root/lib/libCint.so)
==5346== by 0x4826D5A: G__call_cppfunc (in /home/mike/root/lib/libCint.so)
==5346== by 0x4815ABA: G__interpret_func (in /home/mike/root/lib/libCint.so)
==5346== by 0x4804748: G__getfunction (in /home/mike/root/lib/libCint.so)
–5346-- INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exiting
–5346-- si_code=1; Faulting address: 0x3FE209DA; sp: 0x62558EA8

valgrind: the ‘impossible’ happened:
Killed by fatal signal
==5346== at 0xB0015DD2: vgPlain_arena_malloc (m_mallocfree.c:169)
==5346== by 0xB002A935: vgPlain_cli_malloc (replacemalloc_core.c:101)
==5346== by 0xB000135B: vgMAC___builtin_new (mac_malloc_wrappers.c:192)
==5346== by 0xB002C00B: do_client_request (scheduler.c:987)
==5346== by 0xB002BAE9: vgPlain_scheduler (scheduler.c:721)
==5346== by 0xB00394E4: thread_wrapper (syswrap-linux.c:86)
==5346== by 0xB00395A0: run_a_thread_NORETURN (syswrap-linux.c:119)

sched status:
running_tid=1

Thread 1: status = VgTs_Runnable
==5346== at 0x401A9D0: operator new(unsigned) (vg_replace_malloc.c:164)
==5346== by 0x41F18CF: TList::MakeIterator(bool) const (in /home/mike/root/lib/libCore.so)
==5346== by 0x4220BC7: TStreamerInfo::GetStreamerElement(char const*, int&) const (in /home/mike/root/lib/libCore.so)
==5346== by 0x4FF50AC: TBranchElement::CheckBranchID() (in /home/mike/root/lib/libTree.so)
==5346== by 0x4FF5327: TBranchElement::GetInfo() (in /home/mike/root/lib/libTree.so)
==5346== by 0x4FF7961: TBranchElement::SetAddress(void*) (in /home/mike/root/lib/libTree.so)
==5346== by 0x4FF4CC8: TBranchElement::SetupAddresses() (in /home/mike/root/lib/libTree.so)
==5346== by 0x4FF4D46: TBranchElement::GetEntry(long long, int) (in /home/mike/root/lib/libTree.so)
==5346== by 0x50223AB: TTree::GetEntry(long long, int) (in /home/mike/root/lib/libTree.so)
==5346== by 0x5045D40: G__G__Tree_137_8_5(G__value*, char const*, G__param*, int) (in /home/mike/root/lib/libTree.so)
==5346== by 0x4796FB5: G__ExceptionWrapper (in /home/mike/root/lib/libCint.so)
==5346== by 0x4826D5A: G__call_cppfunc (in /home/mike/root/lib/libCint.so)
==5346== by 0x4815ABA: G__interpret_func (in /home/mike/root/lib/libCint.so)
==5346== by 0x4804748: G__getfunction (in /home/mike/root/lib/libCint.so)
==5346== by 0x4886EC0: G__getstructmem (in /home/mike/root/lib/libCint.so)
==5346== by 0x4880844: G__getvariable (in /home/mike/root/lib/libCint.so)
==5346== by 0x47FB690: G__getitem (in /home/mike/root/lib/libCint.so)
==5346== by 0x47FA2C5: G__getexpr (in /home/mike/root/lib/libCint.so)
==5346== by 0x483E12D: G__exec_function (in /home/mike/root/lib/libCint.so)
==5346== by 0x48451B5: G__exec_statement (in /home/mike/root/lib/libCint.so)
==5346== by 0x4817483: G__interpret_func (in /home/mike/root/lib/libCint.so)
==5346== by 0x4804D64: G__getfunction (in /home/mike/root/lib/libCint.so)
==5346== by 0x47FB6D0: G__getitem (in /home/mike/root/lib/libCint.so)
==5346== by 0x47FA2C5: G__getexpr (in /home/mike/root/lib/libCint.so)
==5346== by 0x47F1708: G__calc_internal (in /home/mike/root/lib/libCint.so)
==5346== by 0x484AFE8: G__process_cmd (in /home/mike/root/lib/libCint.so)
==5346== by 0x41FB416: TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) (in /home/mike/root/lib/libCore.so)
==5346== by 0x41FB571: TCint::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (in /home/mike/root/lib/libCore.so)
==5346== by 0x414183D: TApplication::ProcessFile(char const*, int*) (in /home/mike/root/lib/libCore.so)
==5346== by 0x4140F0C: TApplication::ProcessLine(char const*, bool, int*) (in /home/mike/root/lib/libCore.so)
==5346== by 0x52F2C12: TRint::HandleTermInput() (in /home/mike/root/lib/libRint.so)
==5346== by 0x52F1901: TTermInputHandler::Notify() (in /home/mike/root/lib/libRint.so)
==5346== by 0x52F34C7: TTermInputHandler::ReadNotify() (in /home/mike/root/lib/libRint.so)
==5346== by 0x427F831: TUnixSystem::CheckDescriptors() (in /home/mike/root/lib/libCore.so)
==5346== by 0x427E71F: TUnixSystem::DispatchOneEvent(bool) (in /home/mike/root/lib/libCore.so)
==5346== by 0x41B8E57: TSystem::InnerLoop() (in /home/mike/root/lib/libCore.so)
==5346== by 0x41B8DFC: TSystem::Run() (in /home/mike/root/lib/libCore.so)
==5346== by 0x4141A5F: TApplication::Run(bool) (in /home/mike/root/lib/libCore.so)
==5346== by 0x52F26A3: TRint::Run(bool) (in /home/mike/root/lib/libRint.so)
==5346== by 0x80488DC: main (in /home/mike/root/bin/root.exe)

Note: see also the FAQ.txt in the source distribution.
It contains workarounds to several common problems.

If that doesn’t help, please report this bug to: www.valgrind.org

In the bug report, send all the above text, the valgrind
version, and what Linux distro you are using. Thanks.

Thanks for your time.

Regards,

Mike

Can you please try with ROOT 5.10/00?

Thanks,
Philippe

Good advice Pillippe, it works fine in 5.10.

Thank you,

Mike