Root build:: jemalloc breaks libcppyy

ROOT Version: git v6-24-00-patches @5af1fa4d3d
Platform: fedora 34
Compiler: 11.2.1 20210728


enabling jemalloc in the build and trying rootls throws:

time rootls -h
Traceback (most recent call last):
File "/home/physics-tools/ROOT/v6-24-00-patches/lib/cppyy/__init__.py", line 60, in <module>
importlib.import_module(libcppyy_mod_name)
File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
File "<frozen importlib._bootstrap>", line 565, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 1173, in create_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
ImportError: /lib64/libjemalloc.so.2: cannot allocate memory in static TLS block

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/physics-tools/ROOT/v6-24-00-patches/bin/rootls", line 10, in <module>
import cmdLineUtils
File "/home/physics-tools/ROOT/v6-24-00-patches/lib/cmdLineUtils.py", line 82, in <module>
import ROOT
File "/home/physics-tools/ROOT/v6-24-00-patches/lib/ROOT/__init__.py", line 22, in <module>
import cppyy
File "/home/physics-tools/ROOT/v6-24-00-patches/lib/cppyy/__init__.py", line 62, in <module>
raise ImportError(
ImportError: Failed to import libcppyy3_9. Please check that ROOT has been built for Python 3.9

that time is there because at first usage (after fresh compilation) it stays a looong time compiling something, and i wanted to time it and investigate why is so…

Thank you for reporting, I will have a look and get back to you.

I tried on my ubuntu machine with ROOT master and jemalloc and can’t reproduce. I’ll see if I can try on one of our fedora nodes.

I tried on fedora34, jemalloc=ON, gcc 11.1.1, python3.9, current ROOT 6.24 patches (so almost the same configuration as you except for the slight compiler version difference) and I can’t reproduce:

[sftnight@root-fedora34-1 build_jemalloc]$ rootls -h
usage: rootls [-h] [-1] [-l] [-t] FILE [FILE ...]

Display ROOT files contents in the terminal.

positional arguments:
  FILE               Input file
...

well, who knows what is going on … i do not really need jemalloc, so my report was more on a “heads up” mode than “i encountered a bug”. so, this can be closed, if it becomes endemic, from multiple reports it will be easier to spot the culprit. thank you for taking time to check this!!
L.E. i forgot to mention that the build and install is done with ninja … should not matter isn’t it?

I would say it shouldn’t matter, anyway thank you for reporting! I’ll be vigilant in case this is reported again.