I am trying to fill a TTree with an Event object whose component objects contain references (TRefArray) among each other, but I get a segmentation fault when calling TTree::Fill, if and only if I add AND THEN remove one of the references.
In summary this is what triggers the segfault:
Open a TFile
Create a TTree containing a custom Event class
The Event class contains a collection of objects of Hit and Track classes
Add a Hit to a Track
Remove the Hit from the Track
Call TTree::Fill
Because talk is cheap, I have created a minimal reproducer. You just have to run the compile.sh script and then you should see the segfault message. test.zip (2.9 KB)
Please let me know if you prefer me to submit this as a bug in the ROOT bug tracker, or tell me what I am doing wrong.