pyROOT issue moving code from ROOT5 to ROOT6

I am in the process of upgrading our software from ROOT5 to ROOT6 and there is something which works in ROOT5 and not ROOT6 which I cannot currently get around. For various reasons we have some code which within a single python instance will compile a ROOT macro, call the function inside the macro (called “make_plots”), and then compile another macro and run the function in the second macro (which is also called “make_plots”).

I broke this down into the simplest possible example which looks like this:

import ROOT
from ROOT import gSystem, gROOT, TFile

gSystem.CompileMacro("macro1.cc", "f", "macro1.cc")
ROOT.make_plots()
gSystem.Unload("macro1.cc.so") 
del ROOT.make_plots

gSystem.CompileMacro("macro2.cc", "f", "macro2.cc")
ROOT.make_plots()
gSystem.Unload("macro2.cc.so") 
del ROOT.make_plots

When the above code is run it seg faults on the second call to ROOT.make_plots(). In this simple example all the make_plots() functions in the macros actually do is print something to screen. This works fine with ROOT5.

Any insights into what I might be able to do to do get pyROOT to correctly clean up the first instance of make_plots()?

Maybe @Axel has some idea how to solve this issue…

ROOT 6 still has a hard time with unloading. But here I’m not sure whether the problem is on the python side, with the shared library, or in the interpreter. I have created https://sft.its.cern.ch/jira/browse/ROOT-9266 for us to track this.

Thanks for reporting!

1 Like

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