You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the report, and sorry for the breakage.
Cause: in 0.8.0, IvfIndex.add() defaults to num_threads=0 (all available CPUs); 0.7 defaulted to 1. txtai's append calls add(embeddings), so with 0.8.0 it starts an OpenMP worker team. On macOS, Faiss, PyTorch and rabitqlib each bundle their own libomp. When Faiss and PyTorch are loaded in the same process, starting workers in rabitqlib's runtime crashes with OMP: Error #179: Function pthread_mutex_init failed, followed by a segfault.
0.8.0 also ignores OMP_NUM_THREADS, so txtai's existing macOS setting (OMP_NUM_THREADS=1) didn't apply. The crash does not reproduce on Linux.
Fix (#208): 0.8.1 is now on PyPI. It caps num_threads=0 by OMP_NUM_THREADS (omp_get_max_threads()), as Faiss does. With txtai's existing macOS setting, add runs single-threaded again and needs no change on your side. We checked this on a macos-15 arm64 runner with txtai at e5d8d43, running unittest discover -k testann:
The 0.8.0 wheel segfaults in testRabitQ.
A wheel built from the fix passes all 72 tests.
You can drop the rabitqlib==0.7.2 pin from your CI. To stay safe on macOS regardless of that environment variable, you can also pass the thread count explicitly, which every 0.7.x and 0.8.x version accepts:
Activity
gouyt13 commentedon Nov 1, 2026
Thanks for the report, and sorry for the breakage.
Cause: in 0.8.0,
IvfIndex.add()defaults tonum_threads=0(all available CPUs); 0.7 defaulted to 1. txtai'sappendcallsadd(embeddings), so with 0.8.0 it starts an OpenMP worker team. On macOS, Faiss, PyTorch and rabitqlib each bundle their own libomp. When Faiss and PyTorch are loaded in the same process, starting workers in rabitqlib's runtime crashes withOMP: Error #179: Function pthread_mutex_init failed, followed by a segfault.0.8.0 also ignores
OMP_NUM_THREADS, so txtai's existing macOS setting (OMP_NUM_THREADS=1) didn't apply. The crash does not reproduce on Linux.Fix (#208): 0.8.1 is now on PyPI. It caps
num_threads=0byOMP_NUM_THREADS(omp_get_max_threads()), as Faiss does. With txtai's existing macOS setting,addruns single-threaded again and needs no change on your side. We checked this on a macos-15 arm64 runner with txtai at e5d8d43, runningunittest discover -k testann:testRabitQ.You can drop the
rabitqlib==0.7.2pin from your CI. To stay safe on macOS regardless of that environment variable, you can also pass the thread count explicitly, which every 0.7.x and 0.8.x version accepts:davidmezzetti commentedon Nov 1, 2026
Thank you for the quick fix!
fix: cap automatic thread counts by OMP_NUM_THREADS