Crash when closing TFile

This is probably a basic error on my side, but I could not find it.

I am using CentOS 7 with root version 6.08.02 from /cvmfs/sft.cern.ch/lcg/releases/LCG_87/ROOT/6.08.02/x86_64-centos7-gcc62-opt

I wrote a very simple program which opens a TFile, creates a TTree with one branch, copies several events to this TTree and then closes the file. When the number of events is small (say less than 1000, I cannot be more precise on that) the program crashes on exit with this error:

*** Error in '/home/daq/Padme/Level1/PadmeLevel1.exe': corrupted double-linked list: 0x0000000001beead0 ***

and a long backtrace. The written file contains all the expected data but when reading it you get a Warning about the file probably not being closed.

If on the other hand the number of events is large, the program ends correctly and the output file is readable without the mentioned warning.

Below is the RootIO class I am using for this task: it is used by calling the Init method, then FillRawEvent several times and finally the Exit method.

Can anyone give me some hint of where the problem could be?

Thank you very much.

Emanuele Leonardi

RootIO.hh (974 Bytes)

RootIO.cc (4.9 KB)

Do not delete fTTreeMain;. This tree is owned by the “fTFileHandle” and it will automatically be deleted as soon as you close this file.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.