Home | News | Documentation | Download

A crash when reading from a file with TTree Friends

Dear ROOTers,

I’ve encountered a case, when I am able to create TFile with 3 TTrees, which cause ROOT to crash. A tree t1 is a friend of t2. t1 and t2 are a friend of t3. When opening the file, executing t3->GetEntry(0) then closing the file, the ROOT crashes. It depends on the order of adding the TTrees as friends. When I first add t1 and then t2 as friends of t3, the crash occurs. When I add first t2 and then t1, everything is fine.

I attach the script that creates the file. Please:

  1. execute the script
  2. open the test.root file with ROOT
  3. execute t3->GetEntry(0)
  4. Exit ROOT (with .q)

It should crash.

When you recreate the file switching the order of lines 21 and 22, or commenting line 14 (adding a friend to t2), ROOT should no longer crash.

test_friends.C (432 Bytes)

Is the behaviour I am encountering something normal and I’ve missed something in the documentation?

_ROOT Version: 6.24.06
Platform: Fedora 35
Compiler: Not Provided

Hi @LeWhoo,

Thanks for reporting this! Let me try to reproduce it later today; I will create an issue on GitHub, if appropriate.

FYI, @pcanal.


This problem has been fixed in the upcoming v6.26/00 (and still needs to be back ported in time for v6.24/08)