Details
-
Bug
-
Status: Closed (View Workflow)
-
Medium
-
Resolution: Fixed
-
6.06/08
-
None
-
Linux
Description
The singleton pattern that is used for gROOT ensures that one and only one instance of TROOT will ever be created during the lifetime of a process. Being a singleton, this seems sensible but it is semantically different than only one instance of TROOT can exist at any given time. The current semantics can cause seg faults at the end of a process if some code depends on gROOT after the gROOT has already destructed. This can happen when there a static global destructs after gROOT.
I have attached CMakeLists.txt and test.cpp files that together create a test program, test1, that demonstrates the behavior on gcc 4.9. Build it as:
cmake -DROOT_DIR=/path/to/root/cmake/config /path/to/source
Segmentation faults when the process is shutting down are probably not the end of the world. However, they could cause problems with leaking resources other than memory, which is a big deal.