I am generating a handful of plots in a loop, and using TLatex on each iteration.
Histograms are fed to a function which draws the histograms on a canvas along with some text, many of the plots are successfully generated but after about ~30 I get the following error:
*** Break *** segmentation violation
Generating stack trace...
Traceback (most recent call last):
File "./devdEdxpid.py", line 70, in <module>
plot.draw(draw_opt='e',legend_marker='lep',fit='gaus')
File "/home/ddavis/Dropbox/pidplot/pidplot/pidplot.py", line 283, in draw
hist1print.DrawLatex(.76,.75,'Fit #it{#mu} = ' +self.fit_means[0][0] +'#pm '+self.fit_means[0][1])
SystemError: TLatex* TLatex::DrawLatex(double x, double y, const char* text) =>
problem in C++; program state has been reset
I get this whether I create the TLatex object inside the function which gets called many times, or if I make the TLatex object global and just call TLatex::DrawLatex each time the function is called in the loop. I’m guessing it’s some kind of C++ memory issue?