Suspect TTree::GetEntry() causing on and off segmentation violation

Hi.
I am having a problem of segmentation violation that appears most of the times (but not always) in a specific point of my code.
It is the GetEntry() call in the file buildevents.cpp at line 69:

for (unsigned int i = 0; i < _cluster_tree->GetEntries(); i++) {
        bar.update();
        _cluster_tree->GetEntry(i);
        v_clusters.push_back(*cluster);
    }

The tree is defined at lines 42-43:

_cluster_tree = (TTree *)_file_in->Get<TTree>(tree_name_in.c_str());
    _cluster_tree->SetBranchAddress("clusters", &cluster, &b_clusters);

And this is the error printout:

 *** Break *** segmentation violation



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

Thread 15 (Thread 0x7f01efa93640 (LWP 2980027) "BuildEvents"):
#0  0x00007f021488679a in __futex_abstimed_wait_common () from /lib64/libc.so.6
#1  0x00007f0214891c48 in __new_sem_wait_slow64.constprop.0 () from /lib64/libc.so.6
#2  0x00007f01f6587446 in XrdSysSemaphore::Wait (this=0x4665d60) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysPthread.hh:509
#3  XrdCl::SyncQueue<XrdCl::JobManager::JobHelper>::Get (this=0x4597fd8) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdCl/XrdClSyncQueue.hh:66
#4  XrdCl::JobManager::RunJobs (this=0x4597fc0) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdCl/XrdClJobManager.cc:151
#5  0x00007f01f65874f9 in RunRunnerThread (arg=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdCl/XrdClJobManager.cc:34
#6  0x00007f0214889c02 in start_thread () from /lib64/libc.so.6
#7  0x00007f021490ec40 in clone3 () from /lib64/libc.so.6

Thread 14 (Thread 0x7f01f0294640 (LWP 2980026) "BuildEvents"):
#0  0x00007f021488679a in __futex_abstimed_wait_common () from /lib64/libc.so.6
#1  0x00007f0214891c48 in __new_sem_wait_slow64.constprop.0 () from /lib64/libc.so.6
#2  0x00007f01f6587446 in XrdSysSemaphore::Wait (this=0x4665d60) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysPthread.hh:509
#3  XrdCl::SyncQueue<XrdCl::JobManager::JobHelper>::Get (this=0x4597fd8) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdCl/XrdClSyncQueue.hh:66
#4  XrdCl::JobManager::RunJobs (this=0x4597fc0) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdCl/XrdClJobManager.cc:151
#5  0x00007f01f65874f9 in RunRunnerThread (arg=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdCl/XrdClJobManager.cc:34
#6  0x00007f0214889c02 in start_thread () from /lib64/libc.so.6
#7  0x00007f021490ec40 in clone3 () from /lib64/libc.so.6

Thread 13 (Thread 0x7f01f0a95640 (LWP 2980025) "BuildEvents"):
#0  0x00007f021488679a in __futex_abstimed_wait_common () from /lib64/libc.so.6
#1  0x00007f0214891c48 in __new_sem_wait_slow64.constprop.0 () from /lib64/libc.so.6
#2  0x00007f01f6587446 in XrdSysSemaphore::Wait (this=0x4665d60) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysPthread.hh:509
#3  XrdCl::SyncQueue<XrdCl::JobManager::JobHelper>::Get (this=0x4597fd8) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdCl/XrdClSyncQueue.hh:66
#4  XrdCl::JobManager::RunJobs (this=0x4597fc0) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdCl/XrdClJobManager.cc:151
#5  0x00007f01f65874f9 in RunRunnerThread (arg=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdCl/XrdClJobManager.cc:34
#6  0x00007f0214889c02 in start_thread () from /lib64/libc.so.6
#7  0x00007f021490ec40 in clone3 () from /lib64/libc.so.6

Thread 12 (Thread 0x7f01f1296640 (LWP 2980024) "BuildEvents"):
#0  0x00007f02148d4075 in clock_nanosleep
GLIBC_2.2.5 () from /lib64/libc.so.6
#1  0x00007f02148d8c87 in nanosleep () from /lib64/libc.so.6
#2  0x00007f020daa8a68 in XrdSysTimer::Wait (mills=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysTimer.cc:239
#3  0x00007f01f6506686 in XrdCl::TaskManager::RunTasks (this=0x3e14650) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdCl/XrdClTaskManager.cc:246
#4  0x00007f01f6506789 in RunRunnerThread (arg=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdCl/XrdClTaskManager.cc:38
#5  0x00007f0214889c02 in start_thread () from /lib64/libc.so.6
#6  0x00007f021490ec40 in clone3 () from /lib64/libc.so.6

Thread 11 (Thread 0x7f01f1a97640 (LWP 2980023) "BuildEvents"):
#0  0x00007f021490e21e in epoll_wait () from /lib64/libc.so.6
#1  0x00007f020daa305a in XrdSys::IOEvents::PollE::Begin (this=0x463c7f0, syncsem=<optimized out>, retcode=<optimized out>, eTxt=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEventsPollE.icc:212
#2  0x00007f020da9f1ed in XrdSys::IOEvents::BootStrap::Start (parg=0x7ffff4847600) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEvents.cc:149
#3  0x00007f020daa8177 in XrdSysThread_Xeq (myargs=0x458e1b0) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysPthread.cc:86
#4  0x00007f0214889c02 in start_thread () from /lib64/libc.so.6
#5  0x00007f021490ec40 in clone3 () from /lib64/libc.so.6

Thread 10 (Thread 0x7f01f2298640 (LWP 2980022) "BuildEvents"):
#0  0x00007f021490e21e in epoll_wait () from /lib64/libc.so.6
#1  0x00007f020daa305a in XrdSys::IOEvents::PollE::Begin (this=0x3d1f8d0, syncsem=<optimized out>, retcode=<optimized out>, eTxt=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEventsPollE.icc:212
#2  0x00007f020da9f1ed in XrdSys::IOEvents::BootStrap::Start (parg=0x7ffff4847600) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEvents.cc:149
#3  0x00007f020daa8177 in XrdSysThread_Xeq (myargs=0x45e42f0) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysPthread.cc:86
#4  0x00007f0214889c02 in start_thread () from /lib64/libc.so.6
#5  0x00007f021490ec40 in clone3 () from /lib64/libc.so.6

Thread 9 (Thread 0x7f01f2a99640 (LWP 2980021) "BuildEvents"):
#0  0x00007f021490e21e in epoll_wait () from /lib64/libc.so.6
#1  0x00007f020daa305a in XrdSys::IOEvents::PollE::Begin (this=0x4667cd0, syncsem=<optimized out>, retcode=<optimized out>, eTxt=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEventsPollE.icc:212
#2  0x00007f020da9f1ed in XrdSys::IOEvents::BootStrap::Start (parg=0x7ffff4847600) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEvents.cc:149
#3  0x00007f020daa8177 in XrdSysThread_Xeq (myargs=0x4601b30) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysPthread.cc:86
#4  0x00007f0214889c02 in start_thread () from /lib64/libc.so.6
#5  0x00007f021490ec40 in clone3 () from /lib64/libc.so.6

Thread 8 (Thread 0x7f01f329a640 (LWP 2980020) "BuildEvents"):
#0  0x00007f021490e21e in epoll_wait () from /lib64/libc.so.6
#1  0x00007f020daa305a in XrdSys::IOEvents::PollE::Begin (this=0x45b43e0, syncsem=<optimized out>, retcode=<optimized out>, eTxt=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEventsPollE.icc:212
#2  0x00007f020da9f1ed in XrdSys::IOEvents::BootStrap::Start (parg=0x7ffff4847600) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEvents.cc:149
#3  0x00007f020daa8177 in XrdSysThread_Xeq (myargs=0x45e1760) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysPthread.cc:86
#4  0x00007f0214889c02 in start_thread () from /lib64/libc.so.6
#5  0x00007f021490ec40 in clone3 () from /lib64/libc.so.6

Thread 7 (Thread 0x7f01f3a9b640 (LWP 2980019) "BuildEvents"):
#0  0x00007f021490e21e in epoll_wait () from /lib64/libc.so.6
#1  0x00007f020daa305a in XrdSys::IOEvents::PollE::Begin (this=0x45f36c0, syncsem=<optimized out>, retcode=<optimized out>, eTxt=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEventsPollE.icc:212
#2  0x00007f020da9f1ed in XrdSys::IOEvents::BootStrap::Start (parg=0x7ffff4847600) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEvents.cc:149
#3  0x00007f020daa8177 in XrdSysThread_Xeq (myargs=0x458e400) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysPthread.cc:86
#4  0x00007f0214889c02 in start_thread () from /lib64/libc.so.6
#5  0x00007f021490ec40 in clone3 () from /lib64/libc.so.6

Thread 6 (Thread 0x7f01f429c640 (LWP 2980018) "BuildEvents"):
#0  0x00007f021490e21e in epoll_wait () from /lib64/libc.so.6
#1  0x00007f020daa305a in XrdSys::IOEvents::PollE::Begin (this=0x4626ee0, syncsem=<optimized out>, retcode=<optimized out>, eTxt=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEventsPollE.icc:212
#2  0x00007f020da9f1ed in XrdSys::IOEvents::BootStrap::Start (parg=0x7ffff4847600) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEvents.cc:149
#3  0x00007f020daa8177 in XrdSysThread_Xeq (myargs=0x41498c0) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysPthread.cc:86
#4  0x00007f0214889c02 in start_thread () from /lib64/libc.so.6
#5  0x00007f021490ec40 in clone3 () from /lib64/libc.so.6

Thread 5 (Thread 0x7f01f4a9d640 (LWP 2980017) "BuildEvents"):
#0  0x00007f021490e21e in epoll_wait () from /lib64/libc.so.6
#1  0x00007f020daa305a in XrdSys::IOEvents::PollE::Begin (this=0x45e1a40, syncsem=<optimized out>, retcode=<optimized out>, eTxt=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEventsPollE.icc:212
#2  0x00007f020da9f1ed in XrdSys::IOEvents::BootStrap::Start (parg=0x7ffff4847600) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEvents.cc:149
#3  0x00007f020daa8177 in XrdSysThread_Xeq (myargs=0x46861f0) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysPthread.cc:86
#4  0x00007f0214889c02 in start_thread () from /lib64/libc.so.6
#5  0x00007f021490ec40 in clone3 () from /lib64/libc.so.6

Thread 4 (Thread 0x7f01f529e640 (LWP 2980016) "BuildEvents"):
#0  0x00007f021490e21e in epoll_wait () from /lib64/libc.so.6
#1  0x00007f020daa305a in XrdSys::IOEvents::PollE::Begin (this=0x459d700, syncsem=<optimized out>, retcode=<optimized out>, eTxt=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEventsPollE.icc:212
#2  0x00007f020da9f1ed in XrdSys::IOEvents::BootStrap::Start (parg=0x7ffff4847600) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEvents.cc:149
#3  0x00007f020daa8177 in XrdSysThread_Xeq (myargs=0x45a6030) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysPthread.cc:86
#4  0x00007f0214889c02 in start_thread () from /lib64/libc.so.6
#5  0x00007f021490ec40 in clone3 () from /lib64/libc.so.6

Thread 3 (Thread 0x7f01f5a9f640 (LWP 2980015) "BuildEvents"):
#0  0x00007f021490e21e in epoll_wait () from /lib64/libc.so.6
#1  0x00007f020daa305a in XrdSys::IOEvents::PollE::Begin (this=0x45f3a80, syncsem=<optimized out>, retcode=<optimized out>, eTxt=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEventsPollE.icc:212
#2  0x00007f020da9f1ed in XrdSys::IOEvents::BootStrap::Start (parg=0x7ffff4847600) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEvents.cc:149
#3  0x00007f020daa8177 in XrdSysThread_Xeq (myargs=0x46880a0) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysPthread.cc:86
#4  0x00007f0214889c02 in start_thread () from /lib64/libc.so.6
#5  0x00007f021490ec40 in clone3 () from /lib64/libc.so.6

Thread 2 (Thread 0x7f01f62a0640 (LWP 2980014) "BuildEvents"):
#0  0x00007f021490e21e in epoll_wait () from /lib64/libc.so.6
#1  0x00007f020daa305a in XrdSys::IOEvents::PollE::Begin (this=0x4285b90, syncsem=<optimized out>, retcode=<optimized out>, eTxt=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEventsPollE.icc:212
#2  0x00007f020da9f1ed in XrdSys::IOEvents::BootStrap::Start (parg=0x7ffff4847600) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysIOEvents.cc:149
#3  0x00007f020daa8177 in XrdSysThread_Xeq (myargs=0x45ed240) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/xrootd-5.6.3/src/xrootd/5.6.3/src/XrdSys/XrdSysPthread.cc:86
#4  0x00007f0214889c02 in start_thread () from /lib64/libc.so.6
#5  0x00007f021490ec40 in clone3 () from /lib64/libc.so.6

Thread 1 (Thread 0x7f0216080bc0 (LWP 2979998) "BuildEvents"):
#0  0x00007f02148d8a3f in wait4 () from /lib64/libc.so.6
#1  0x00007f021484b243 in do_system () from /lib64/libc.so.6
#2  0x00007f0216912519 in TUnixSystem::StackTrace() () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libCore.so
#3  0x00007f0216911ed4 in TUnixSystem::DispatchSignals(ESignals) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libCore.so
#4  <signal handler called>
#5  0x00007f02163fa7e7 in int TStreamerInfoActions::ReadBasicType<double>(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libRIO.so
#6  0x00007f02162cc29d in TBufferFile::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libRIO.so
#7  0x00007f021573d017 in TBranchElement::ReadLeavesMember(TBuffer&) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libTree.so
#8  0x00007f02157357d9 in TBranch::GetEntry(long long, int) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libTree.so
#9  0x00007f021574892c in TBranchElement::GetEntry(long long, int) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libTree.so
#10 0x00007f02157489ba in TBranchElement::GetEntry(long long, int) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libTree.so
#11 0x00007f02157b03b0 in TTree::GetEntry(long long, int) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libTree.so
#12 0x00007f0216dad7d7 in Tracking::BuildEvents::loadclusters() () from /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so
#13 0x00007f0216dad566 in Tracking::BuildEvents::BuildEvents(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double) () from /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so
#14 0x000000000043fdf9 in main ()
===========================================================


The lines below might hint at the cause of the crash. If you see question
marks as part of the stack trace, try to recompile with debugging information
enabled and export CLING_DEBUG=1 environment variable before running.
You may get help by asking at the ROOT forum https://root.cern/forum
preferably using the command (.forum bug) in the ROOT prompt.
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://root.cern/bugs or (preferably) using the command (.gh bug) in
the ROOT prompt. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#5  0x00007f02163fa7e7 in int TStreamerInfoActions::ReadBasicType<double>(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libRIO.so
#6  0x00007f02162cc29d in TBufferFile::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libRIO.so
#7  0x00007f021573d017 in TBranchElement::ReadLeavesMember(TBuffer&) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libTree.so
#8  0x00007f02157357d9 in TBranch::GetEntry(long long, int) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libTree.so
#9  0x00007f021574892c in TBranchElement::GetEntry(long long, int) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libTree.so
#10 0x00007f02157489ba in TBranchElement::GetEntry(long long, int) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libTree.so
#11 0x00007f02157b03b0 in TTree::GetEntry(long long, int) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_105/ROOT/6.30.02/x86_64-el9-gcc13-opt/lib/libTree.so
#12 0x00007f0216dad7d7 in Tracking::BuildEvents::loadclusters() () from /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so
#13 0x00007f0216dad566 in Tracking::BuildEvents::BuildEvents(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double) () from /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so
#14 0x000000000043fdf9 in main ()
===========================================================

This is the repository where you can find the full code. I hope you can help solving this issue.
Thank you
Best regards
Luca Moleri

_ROOT Version: 6.32.04
_Platform: Red Hat 11.4.1-3
_Compiler: g++ (GCC) 11.4.1 20231218


Hi Luca,

Thanks for the post.
Can you provide a minimal reproducer?

Best,
D

Hi Danilo.
Thank you for you reply.
What I can do is to provide a small file to run on, I cannot separate this part of the code from the rest. Also, the crash happens often, but not always, so it might need a few trials to show up.
After compiling the src code as in the README (it should work in lxplus) , it is possible to run

source tools/run.sh -i tools/GenerateMPGDTracks/mpgd_tracks_4DUTs_10000.root -s all -n -1

I hope this helps.
Thank you
LM

Hi Luca,

I just tried to do what is described in your README file, but at the cmake stage I get this:

 % mkdir build; cd build
cmake ..; make

-- The C compiler identification is AppleClang 16.0.0.16000026
-- The CXX compiler identification is AppleClang 16.0.0.16000026
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/couet/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Users/couet/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:13 (find_package):
  By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Eigen3", but
  CMake did not find one.

  Could not find a package configuration file provided by "Eigen3" with any
  of the following names:

    Eigen3Config.cmake
    eigen3-config.cmake

  Add the installation prefix of "Eigen3" to CMAKE_PREFIX_PATH or set
  "Eigen3_DIR" to a directory containing one of the above files.  If "Eigen3"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!
make: *** No targets specified and no makefile found.  Stop.

It seems there is some extra needed. That’s not the minimal reproducer Danilo asked for. As I understood you need the whole thing to see the error ? and it does not show every time ?

You said that the error occurs in GetEntries. May be _cluster_tree is not valid sometimes ? is it possible to check its validity before calling GetEntries on it ?

Hi @couet. Thank you for the prompt reply.
Can you be that the error that you get is solved by running source setup.sh?

Concerning your questions, indeed the error shows up when running the whole chain of executables, and not every time.

I would like to check the validity of _cluster_tree as you suggest. How to implement this?
Thank you
LM

Something like:

if (!_cluster_tree) {
   cout << "invalid tree"<< end;
   return,
}

?

I checked now. It crashes without entering this if condition, so the tree itself is valid.
I thought that maybe something is bad with the access to the branch which is declared at line 43 in the same buildevents.cpp file:

_cluster_tree->SetBranchAddress("clusters", &(this->cluster), &b_clusters);

How can I check if this is fine before GetEntry()?
Thank you
LM

I recommend running the failing example under valgrind:

valgrind --suppressions=$ROOTSYS/etc/valgrind-root.supp my_executable my_args

this should give more indication on the problem

Hi @pcanal.
Thank you for the suggestion.
I ran with valgrind and this is the report:

==3778318== Memcheck, a memory error detector
==3778318== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==3778318== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info
==3778318== Command: BuildEvents ../../data/srs/clusters/run_283_20240927175803_clusters.root
==3778318== 
Reading config file: /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/configs/default_config.json
in filename: ../../data/srs/clusters/run_283_20240927175803_clusters.root
out filename: /eos/project-w/wis-tb24/public/data/srs/events/run_283_20240927175803_events.root
Reading clusters from file: ../../data/srs/clusters/run_283_20240927175803_clusters.root
File ../../data/srs/clusters/run_283_20240927175803_clusters.root opened successfully 
File /eos/project-w/wis-tb24/public/data/srs/events/run_283_20240927175803_events.rootopened successfully 
==3778318== Conditional jump or move depends on uninitialised value(s)
==3778318==    at 0x5E1CD1F: TBranchElement::SetAddressImpl(void*, bool) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E78CE8: TTree::SetBranchAddressImp(TBranch*, void*, TBranch**) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E78E28: TTree::SetBranchAddress(char const*, void*, TBranch**, TClass*, EDataType, bool) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x497341C: int TTree::SetBranchAddress<Tracking::Cluster>(char const*, Tracking::Cluster**, TBranch**) (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x497176A: Tracking::BuildEvents::BuildEvents(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double) (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x43FDF8: main (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/BuildEvents)
==3778318==  Uninitialised value was created by a stack allocation
==3778318==    at 0x43F91D: main (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/BuildEvents)
==3778318== 
==3778318== Conditional jump or move depends on uninitialised value(s)
==3778318==    at 0x5E1C6D1: TBranchElement::SetAddressImpl(void*, bool) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E1C875: TBranchElement::SetAddressImpl(void*, bool) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E78CE8: TTree::SetBranchAddressImp(TBranch*, void*, TBranch**) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E78E28: TTree::SetBranchAddress(char const*, void*, TBranch**, TClass*, EDataType, bool) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x497341C: int TTree::SetBranchAddress<Tracking::Cluster>(char const*, Tracking::Cluster**, TBranch**) (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x497176A: Tracking::BuildEvents::BuildEvents(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double) (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x43FDF8: main (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/BuildEvents)
==3778318==  Uninitialised value was created by a stack allocation
==3778318==    at 0x43F91D: main (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/BuildEvents)
==3778318== 
==3778318== Conditional jump or move depends on uninitialised value(s)
==3778318==    at 0x5E1C77E: TBranchElement::SetAddressImpl(void*, bool) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E1C875: TBranchElement::SetAddressImpl(void*, bool) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E78CE8: TTree::SetBranchAddressImp(TBranch*, void*, TBranch**) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E78E28: TTree::SetBranchAddress(char const*, void*, TBranch**, TClass*, EDataType, bool) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x497341C: int TTree::SetBranchAddress<Tracking::Cluster>(char const*, Tracking::Cluster**, TBranch**) (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x497176A: Tracking::BuildEvents::BuildEvents(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double) (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x43FDF8: main (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/BuildEvents)
==3778318==  Uninitialised value was created by a heap allocation
==3778318==    at 0x48455F7: operator new(unsigned long, std::align_val_t) (vg_replace_malloc.c:543)
==3778318==    by 0x8D66193: clang::LazyGenerationalUpdatePtr<clang::Decl const*, clang::Decl*, &clang::ExternalASTSource::CompleteRedeclChain>::makeValue(clang::ASTContext const&, clang::Decl*) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libCling.so)
==3778318==    by 0x99C8F10: clang::Redeclarable<clang::VarDecl>::DeclLink::setLatest(clang::VarDecl*) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libCling.so)
==3778318==    by 0x998A8A6: clang::ASTReader::finishPendingActions() (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libCling.so)
==3778318==    by 0x99968C3: non-virtual thunk to clang::ASTReader::FinishedDeserializing() (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libCling.so)
==3778318==    by 0x9A8B1FC: clang::MultiplexExternalSemaSource::FinishedDeserializing() (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libCling.so)
==3778318==    by 0xBA3DEA5: clang::DeclContext::LoadLexicalDeclsFromExternalStorage() const (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libCling.so)
==3778318==    by 0xBA3DF24: clang::DeclContext::decls_begin() const (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libCling.so)
==3778318==    by 0x8E8F3CB: ClingMemberIterInternal::DCIter::DCIter(clang::DeclContext*, cling::Interpreter*) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libCling.so)
==3778318==    by 0x8E8DD1E: TClingDataMemberInfo::TClingDataMemberInfo(cling::Interpreter*, TClingClassInfo*, TDictionary::EMemberSelection) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libCling.so)
==3778318==    by 0x8E02A5A: TCling::DataMemberInfo_Factory(ClassInfo_t*, TDictionary::EMemberSelection) const (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libCling.so)
==3778318==    by 0x4CA74A4: TListOfDataMembers::Load() (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libCore.so)
==3778318== 
==3778318== Warning: set address range perms: large range [0x3184d040, 0x54e6be00) (undefined)
[                                                  ] 0%==3778318== Conditional jump or move depends on uninitialised value(s)
==3778318==    at 0x5E18C12: TBranchElement::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E803AF: TTree::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x49719EE: Tracking::BuildEvents::loadclusters() (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x497177D: Tracking::BuildEvents::BuildEvents(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double) (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x43FDF8: main (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/BuildEvents)
==3778318==  Uninitialised value was created by a stack allocation
==3778318==    at 0x43F91D: main (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/BuildEvents)
==3778318== 
==3778318== Conditional jump or move depends on uninitialised value(s)
==3778318==    at 0x5E18797: TBranchElement::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E189B9: TBranchElement::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E803AF: TTree::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x49719EE: Tracking::BuildEvents::loadclusters() (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x497177D: Tracking::BuildEvents::BuildEvents(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double) (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x43FDF8: main (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/BuildEvents)
==3778318==  Uninitialised value was created by a stack allocation
==3778318==    at 0x43F91D: main (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/BuildEvents)
==3778318== 
==3778318== Conditional jump or move depends on uninitialised value(s)
==3778318==    at 0x5E0CEFA: TBranchElement::ReadLeavesMember(TBuffer&) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E057D8: TBranch::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E1892B: TBranchElement::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E189B9: TBranchElement::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E803AF: TTree::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x49719EE: Tracking::BuildEvents::loadclusters() (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x497177D: Tracking::BuildEvents::BuildEvents(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double) (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x43FDF8: main (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/BuildEvents)
==3778318==  Uninitialised value was created by a stack allocation
==3778318==    at 0x43F91D: main (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/BuildEvents)
==3778318== 
==3778318== Use of uninitialised value of size 8
==3778318==    at 0x51867E7: int TStreamerInfoActions::ReadBasicType<double>(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libRIO.so)
==3778318==    by 0x505829C: TBufferFile::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libRIO.so)
==3778318==    by 0x5E0D016: TBranchElement::ReadLeavesMember(TBuffer&) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E057D8: TBranch::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E1892B: TBranchElement::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E189B9: TBranchElement::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E803AF: TTree::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x49719EE: Tracking::BuildEvents::loadclusters() (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x497177D: Tracking::BuildEvents::BuildEvents(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double) (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x43FDF8: main (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/BuildEvents)
==3778318==  Uninitialised value was created by a stack allocation
==3778318==    at 0x43F91D: main (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/BuildEvents)
==3778318== 
==3778318== Use of uninitialised value of size 8
==3778318==    at 0x5186836: int TStreamerInfoActions::ReadBasicType<int>(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libRIO.so)
==3778318==    by 0x505829C: TBufferFile::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libRIO.so)
==3778318==    by 0x5E0D016: TBranchElement::ReadLeavesMember(TBuffer&) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E057D8: TBranch::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E1892B: TBranchElement::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E189B9: TBranchElement::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x5E803AF: TTree::GetEntry(long long, int) (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x49719EE: Tracking::BuildEvents::loadclusters() (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x497177D: Tracking::BuildEvents::BuildEvents(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double) (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/libTB24TrackingLib.so)
==3778318==    by 0x43FDF8: main (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/BuildEvents)
==3778318==  Uninitialised value was created by a stack allocation
==3778318==    at 0x43F91D: main (in /afs/cern.ch/user/l/lmoleri/git/tb24-tracking/build/BuildEvents)
==3778318== 
==3778318== Invalid read of size 1
==3778318==    at 0x40094C2: do_lookup_x (dl-lookup.c:401)
==3778318==    by 0x400A090: _dl_lookup_symbol_x (dl-lookup.c:872)
==3778318==    by 0x40107E1: _dl_fixup (dl-runtime.c:95)
==3778318==    by 0x401359D: _dl_runtime_resolve_xsave (dl-trampoline.h:126)
==3778318==  Address 0xc08f38000000031e is not stack'd, malloc'd or (recently) free'd
==3778318== 
==3778318== 
==3778318== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==3778318==  General Protection Fault
==3778318==    at 0x40094C2: do_lookup_x (dl-lookup.c:401)
==3778318==    by 0x400A090: _dl_lookup_symbol_x (dl-lookup.c:872)
==3778318==    by 0x40107E1: _dl_fixup (dl-runtime.c:95)
==3778318==    by 0x401359D: _dl_runtime_resolve_xsave (dl-trampoline.h:126)
==3778318==    by 0x4F441EF: ???
==3778318==    by 0x5D7078F: ??? (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libTree.so)
==3778318==    by 0x4E56ADF: ??? (in /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.30.02-fb5be/x86_64-el9-gcc13-opt/lib/libCore.so)
==3778318== 
==3778318== HEAP SUMMARY:
==3778318==     in use at exit: 787,978,355 bytes in 107,784 blocks
==3778318==   total heap usage: 424,372 allocs, 316,588 frees, 993,408,658 bytes allocated
==3778318== 
==3778318== LEAK SUMMARY:
==3778318==    definitely lost: 49,952 bytes in 325 blocks
==3778318==    indirectly lost: 0 bytes in 0 blocks
==3778318==      possibly lost: 21,976 bytes in 96 blocks
==3778318==    still reachable: 787,094,059 bytes in 101,002 blocks
==3778318==                       of which reachable via heuristic:
==3778318==                         newarray           : 32,024 bytes in 43 blocks
==3778318==                         multipleinheritance: 7,032 bytes in 7 blocks
==3778318==         suppressed: 812,368 bytes in 6,361 blocks
==3778318== Rerun with --leak-check=full to see details of leaked memory
==3778318== 
==3778318== For lists of detected and suppressed errors, rerun with: -s
==3778318== ERROR SUMMARY: 63 errors from 9 contexts (suppressed: 2871 from 114)
Segmentation fault (core dumped)

There is definitely a problem with uninitialized values, but I do not know how to interpret this.
Your help would be appreciated.
Thank you
LM

Hi.
I found a solution to the problem.
If I initialize the pointer as cluster=0 just before calling GetEntry() then there is no crash.
Thank you for the help.
Best regards
LM