fix(tree): preserve container address for TClonesArray with I/O rules #24355
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 244 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.329
Real PR Conversation Timeline
1 comments
"Review active on #24355"
general
weight: 0.35
ravindra-RKB
Fixes #22725
Problem
When a class stored inside a
TClonesArrayhas an active I/O customization rule targeting onfile members, anfOnfileObjectcache is allocated for the branch. InTBranchElement::SetAddressImpl(introduced in commit 121dc61e5d / PR #18320),localObjectwas unconditionally repointed tofOnfileObject->GetObjectAt(0) + offsetwheneverfOnfileObjectwas non-null andthis != GetMother().For a
TClonesArraymaster branch (fType == 3), its immediate sub-branches represent data members of the contained class (fType == 31). TheirfObjectmust point to the parentTClonesArraycontainer instance so thatReadLeavesClonesMembercan access elements viaclones->GetObjectRef().Because
localObjectwas overwritten with an offset insidefOnfileObject,fObjecton the sub-branch pointed to raw on-file buffer memory instead of aTClonesArray. DuringGetEntry(),reinterpret_cast<TClonesArray*>(fObject)calledclones->IsZombie()on this invalid memory, causing an immediate segmentation violation.Solution
Restrict the
localObjectredirection to nested split objects (0 <= fType && fType <= 2). This preserves the fix from PR #18320 for nested split objects while allowing container master branches (fType == 3andfType == 4) to continue propagating the valid container pointer to their element sub-branches.Changes
tree/tree/src/TBranchElement.cxx: Check(0 <= fType && fType <= 2)before redirectinglocalObjecttofOnfileObject.tree/tree/test/EvolutionStruct.hxx: AddEvolutionClonesItemandEvolutionClonesHoldertest classes.tree/tree/test/EvolutionStructLinkDef.h: Register classes and an onfile I/O customization rule forEvolutionClonesItem.tree/tree/test/evolution.cxx: AddClonesArrayIoRuleGH22725regression test verifying that reading a splitTClonesArraywith an active I/O rule populates transformed values without crashing.