Crash when GetEntry

Hello!

I need your expertice on the following –

I have a class that uses two TTree (fChain and fChainMC) …I declared them correctly using
virtual void Init (TTree * tree = 0, TTree *MCTree = 0)
and

in Init(...) fChain = tree; fChainMC = MCtree; fChain->SetBranchAddress(....); fChainMC->SetBranchAddress(....);

The problem is, that wherever trying to GetEntry from fChainMC it crashes… I LoadTree(0) before trying to GetEntry, but still cannot find a solution…

Any ideas?

Alexi

Hi,

[quote]The problem is, that wherever trying to GetEntry from fChainMC it crashes… I LoadTree(0) before trying to GetEntry, but still cannot find a solution… [/quote]Their could be many reasons, none of which is obvious you the code snippet you provided :slight_smile:. To narrow the scope, can you re-run your example with valgrind and also provide the stack trace at the time of the crash.

Cheers,
Philippe.

Hi Rene --thanks for your time

What do you mean valgrid?

The output is this

*** Break *** segmentation violation
(no debugging symbols found)
Using host libthread_db library “/lib64/tls/libthread_db.so.1”.
Attaching to program: /proc/11820/exe, process 11820
(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.
[Thread debugging using libthread_db enabled]
[New Thread 4125537984 (LWP 11820)]
0xffffe410 in __kernel_vsyscall ()
#1 0x00abdd23 in __waitpid_nocancel () from /lib/tls/libc.so.6
#2 0x00a677a9 in do_system () from /lib/tls/libc.so.6
#3 0x00c6498d in system () from /lib/tls/libpthread.so.0
#4 0xf7af1d4d in TUnixSystem::Exec ()
from /grid_mnt/swmgrs/cmss/slc4_ia32_gcc345/cms/cmssw/CMSSW_2_2_13/external/slc4_ia32_gcc345/lib/libCore.so
#5 0xf7af83d0 in TUnixSystem::StackTrace ()
from /grid_mnt/swmgrs/cmss/slc4_ia32_gcc345/cms/cmssw/CMSSW_2_2_13/external/slc4_ia32_gcc345/lib/libCore.so
#6 0xf7af4959 in TUnixSystem::DispatchSignals ()
from /grid_mnt/swmgrs/cmss/slc4_ia32_gcc345/cms/cmssw/CMSSW_2_2_13/external/slc4_ia32_gcc345/lib/libCore.so
#7 0xf7af4a03 in SigHandler ()
from /grid_mnt/swmgrs/cmss/slc4_ia32_gcc345/cms/cmssw/CMSSW_2_2_13/external/slc4_ia32_gcc345/lib/libCore.so
#8 0xf7af3aae in sighandler ()
from /grid_mnt/swmgrs/cmss/slc4_ia32_gcc345/cms/cmssw/CMSSW_2_2_13/external/slc4_ia32_gcc345/lib/libCore.so
#9
#10 0xf6917fdf in TBranch::GetEntry ()
from /grid_mnt/swmgrs/cmss/slc4_ia32_gcc345/cms/cmssw/CMSSW_2_2_13/external/slc4_ia32_gcc345/lib/libTree.so
#11 0xf691daaf in TBranchElement::GetEntry ()
from /grid_mnt/swmgrs/cmss/slc4_ia32_gcc345/cms/cmssw/CMSSW_2_2_13/external/slc4_ia32_gcc345/lib/libTree.so
#12 0xf691da3b in TBranchElement::GetEntry ()
from /grid_mnt/swmgrs/cmss/slc4_ia32_gcc345/cms/cmssw/CMSSW_2_2_13/external/slc4_ia32_gcc345/lib/libTree.so
#13 0xf69613dc in TTree::GetEntry ()
from /grid_mnt/swmgrs/cmss/slc4_ia32_gcc345/cms/cmssw/CMSSW_2_2_13/external/slc4_ia32_gcc345/lib/libTree.so
#14 0xf608dac9 in DelphesTreeProducer::FillEntry ()
from /user/alkaloge/lib/libMadGraphTreeProducer.so
#15 0xf608d8e3 in DelphesTreeProducer::Loop ()
from /user/alkaloge/lib/libMadGraphTreeProducer.so
#16 0x080496b4 in main ()

Also forgot to tell, that my code compiles fine–the crash is during running

Hi,

Most likely the addresses of the user object for the branch is not set correctly.

You can find information on how to use valgrind at valgrind.org
This is a very powerful tools, in particular to debug memory related issues.

Cheers,
Philippe.

ok Phillipe–will check this out and maybe get back to you…But you think is memory (mis)handling issue?

TIA

[quote]But you think is memory (mis)handling issue? [/quote]Yes I do.

Cheers,
Philippe.