[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

Status: Closed
Project: ROOT
Component/s: Math Libraries
Affects Version/s: 5.34/00
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: zog@ssl.berkeley.edu Assignee: Lorenzo Moneta
Resolution: Fixed Votes: 0
Labels: None

Ubuntu 12.04

Attachments: File Factory.cxx     File ParallelFitting.C    
Actual End:



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.


Comment by Lorenzo Moneta [ 03/Dec/13 ]

Thank you for the patch. This is now fixed in the ROOT master and 5.34 patches

Generated at Mon Feb 17 07:24:18 CET 2020 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.