Skip to content

Incorrect handling of partially loaded chains in TChain::Add(TChain* chain) #22671

Description

@pcanal

This problem has been reported at https://root-forum.cern.ch/t/tchain-add-tchain-leaves-getentries-reporting-a-wrong-too-small-value/64904
and can be reproduced chain_add_entries.C
with the incorrect output being similar to:

ROOT version: 6.40.02

entries written:   A=501  B=1055  C=806   →  true total = 2362
per-chain GetEntries(): a=501  b=1055  c=806   (sum=2362)

after  a->Add(b); a->Add(c):
  GetEntries()     = 489   ← WRONG (expected 2362)
  GetEntriesFast() = 489   ← WRONG
  files in chain   = 16   (all present)
  reachable via LoadTree loop = 2362   ← correct total

single chain (Add per file): GetEntries() = 2362   ← correct

It is known to be broken in 6.40.02, 6.38.04 but correct in 6.38.02 and older.

Metadata

Metadata

Assignees

Type

No fields configured for Bug.

Projects

Status
No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions