Error in TList::Delete follow-up

Please provide the following information:


ROOT Version (e.g. 6.12/02): 6.13/02
Platform, compiler (e.g. CentOS 7.3, gcc6.2): OSX 10.13.4


Hi,

This is the follow-up of the old post:

Finally I found a short macro for reproduce the error!
The error message is slightly different, but I guess it’s caused by the same reason.

Here’s the short example for reproducing the error
First run, makeTF1.C:

void makeTF1() {
  auto f = new TFile("func.root", "recreate");
  auto a = new TF1("a", "x", 0, 10);           
  a -> Write();
} 

Then, run readTF1.C:

void readTF1() {
  auto f = new TFile("func.root");

  auto fa = (TF1 *) f -> Get("a");
  auto fca = (TF1 *) fa -> Clone("ca");
  gROOT -> GetListOfFunctions() -> Add(fca);
}

Then, you can see the error message below:

Error in <TList::Delete>: A list is accessing an object (0x7fa4a73a7890) already deleted (list name = Functions)

Thanks,
Genie

Actually the reproducer can be simplify to:

$ root
   -------------------------------------------------------------------
  | Welcome to ROOT 6.15/01                       http://root.cern.ch |
  |                                      (c) 1995-2018, The ROOT Team |
  | Built for macosx64                                                |
  | From heads/master@v6-13-04-190-g536073d9b0, May 24 2018, 16:04:00 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'        |
   -------------------------------------------------------------------

root [0] auto a = new TF1("a", "x", 0, 10);
root [1] gROOT -> GetListOfFunctions()->Add(a)
root [2] .q
Error in <TList::Delete>: A list is accessing an object (0x7ff153fc4bf0) already deleted (list name = Functions)

The question is: why do you need to add a TF1 to the list of functions ?

Hi,

the function should be already in the list. As Olivier says, perhaps explaining your use case could be helpful.

Cheers,
D

Dear All,

Thanks for the reply.
So, I just tested what you said and just using Get() method adds functions or TCutG into the list of functions or specials, respectively.
I didn’t know that.

I’m using ROOT with FairROOT package and ever since I updated from ROOT6.10 to 6.12, I’m getting errors related to TList.
Last time I posted this error TList::Clear(), you guys asked me a reproducible macro.
So, I thought this is it.
However, I guess it’s not…

Post another one if I nailed it down.

Thank you,
Genie

I think this is a fine reproducer, thanks!

@pcanal - looks like we cannot handle duplicate entries anymore?

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