-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Description
A long time ago, ROOT had a tbb
build option, but it was removed in the ROOT 6.08 development cycle in dd899a5 from 2015, by @peremato.
However, some build configurations still use it, like CMSSW and Conda:
- https://github.com/cms-sw/cmsdist/blob/IB/CMSSW_15_1_X/master/root.spec#L78
- https://github.com/conda-forge/root-feedstock/blob/main/recipe/build_root.sh#L342
That would not be a problem per se, but then, in 2021, @bendavid introduced a new optimization that is enabled only with the long-time removed tbb
flag (or builtin_tbb
), in 6c8b77d:
So we ended up with a secret tbb=ON
configuration that our CI doesn't test, and a CMake configuration option that has a pretty fundamental effect but is not documented.
Now, this comes back to bite us, because loading libtbb
and especially libtbbmalloc
when loading libRIO
-> libThread
-> libtbb
can have unintended side effects. The libRIO
is always loaded when the interpreter is initialized, and tbb then loads its custom allocator. I think this can result in mismatching allocation/deallocation, when ROOT is imported in Python after importing other Python modules that already used the same shared libraries as ROOT but with other allocators.
The example is this Conda issue here:
Both TensorFlow and ROOT use the libzstd
support in LLVM to decompress C++ modules (I think), and switching allocators mid-way might cause the reported crash.
I don't know yet what's the best action here, but for sure we should not have an undocumented build option that changes the behavior of ROOT::gCoreMutex
.