-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pyroot crashes reading TClonesArray in a TTree #16725
Comments
Can you provide the input file that lead to the crash? Alternatively can you rebuild ROOT in debug mode ( |
I've put the file here: |
To reproduce it, I thik it's also needed to upload the |
As i said in the orginal post " The library for accessing the TTree information was created using MakeProject." |
Ok. The full stack trace in a debug build (with line numbers) is:
so it crashes at:
maybe because fObject is in a corrupt state:
|
As crosscheck, I tried reading out from C++ and no crash there.
|
I can reproduce. This does not solve the issue with the "classic" iteration over TTrees/TChains in Python, that we need to fix anyway, however I would like to propose a different, more concise way to obtain the histogram using #!/usr/bin/env python3
import ROOT
import argparse
parser = argparse.ArgumentParser(description='Analyse events.')
parser.add_argument("inputfile")
parser.add_argument("-o","--outputfile",default="Output.root",help="Name of output file")
args = parser.parse_args()
READEVENTANALYSISLIBRARY=ROOT.gSystem.Getenv("READEVENTANALYSISLIBRARY");
ROOT.gSystem.Load(READEVENTANALYSISLIBRARY);
df = ROOT.RDataFrame("ReconDir/Global", args.inputfile)
h = df.Define("frontMomenta", "PIDs.FrontMomentum[PIDs.Charge != 0]")\
.Histo1D(("TrackMomenta", "Charged Track Momentum", 100, 0, 1000.0), 'frontMomenta')
h.Draw() (for the syntax inside the |
Thanks for the workaround. i will give it a try. |
Hi dpiparo, may I ask will this bug be fixed in near future? My issue is a bit different from Alex's so the workaround does not really work, so if the "classic" iteration on TTree can run it would be great. |
Check duplicate issues.
Description
A pyroot python program crashes when reading a TFile containing a TTree containing a TClonesArray. It appears to crash the second time it accesses the TClonesArray. This has started happening since moving to ROOT 6.32 on AlmaLinux 9.4. It worked fine with 6.20.04 running on Centos7. The library for accessing the TTree information was created using MakeProject.
Reproducer
This is the python code that crashes
The crash traceback suggest this as the line causing the crash:
#7 0x00007fe963a68e9a in TBranchElement::ReadLeavesClones(TBuffer&) () from /home/aleph/ajf/t2k/root/lib/libTree.so
#8 0x00007fe963a60899 in TBranch::GetEntry(long long, int) () from /home/aleph/ajf/t2k/root/lib/libTree.so
#9 0x00007fe963a7326b in TBranchElement::GetEntry(long long, int) () from /home/aleph/ajf/t2k/root/lib/libTree.so
#10 0x00007fe963ad7300 in TTree::GetEntry(long long, int) () from /home/aleph/ajf/t2k/root/lib/libTree.so
ROOT version
6.32.00
Installation method
prebuilt binary root_v6.32.00.Linux-almalinux9.4-x86_64-gcc11.4.tar.gz
Operating system
AlmaLinux 9.4
Additional context
No response
The text was updated successfully, but these errors were encountered: