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:
#include "TVirtualMutex.h" and
R__LOCKGUARD2(gROOTMutex); just before the plugin manager is called.
While this solves the immediate issues in the math library, in the long run you should make the plugin manager thread safe.