Skip to content

Removed option tbb is still considered to enable secret optimization of ROOT::gCoreMutex #19798

@guitargeek

Description

@guitargeek

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions