[ROOT-5335] Crash (and fix) related to ROOT::Math::Factory::CreateMinimizer and TPluginManger during parallel fitting Created: 03/Jul/13 Updated: 15/May/19 Resolved: 03/Dec/13
Performing multi-threaded fitting using Minuit2 and the ROOT::Math::Fitter class resulted in random crashes in random parts of ROOT which were called during fitting. They seemed to be linked to the ROOT::Math::Factory::CreateMinimizer function and the TPluginManager class.
ROOT forum topics related to the problem are:
Adding a guarding mutex in the CreateMinimizer function of Factory.cxx solved the problem and ROOT is now happily fitting in parallel!
I am aware that not all of ROOT's minimizers are thread safe (standard Minuit is not), but it works now nicely with Minuit2!
Attached is (1) an example ROOT script to demonstrate the crash, and (2) an updated Factory.cxx which fixes the issue: Only two lines of code have been added:
While this solves the immediate issues in the math library, in the long run you should make the plugin manager thread safe.
|Comment by Lorenzo Moneta [ 03/Dec/13 ]|
Thank you for the patch. This is now fixed in the ROOT master and 5.34 patches