#10863·numba

Crash (SIGBUS) when called from a QThread on MacOS

Author: SanPenCreated Sep 27, 2026Updated Sep 28, 2026
Labelsneedtriage

Reporting a bug

  • I have tried using the latest released version of Numba. I am using Numba 0.67.0, which appears to be the latest release listed in the Numba release notes / PyPI.
  • I have included a self contained code sample to reproduce the problem. It can be run as python bug.py.
  • I have read and understood Numba's AI tool use policy.

Summary

On macOS arm64, first-time JIT compilation inside a PySide6.QtCore.QThread can terminate the Python process with SIGBUS.

The same function compiles and runs successfully on the main thread. The crash happens during llvmlite/LLVM object finalization, not as a Python exception.

This used to work not so long ago on OSX. As of now, it works on Ubuntu 24.04 and Win 11.

Environment

Python: 3.14.3
Platform: macOS-27.0-arm64-arm-64bit-Mach-O
Machine: arm64
NumPy: 2.5.3
Numba: 0.67.0
llvmlite: 0.49.0
PySide6: 6.11.2

Reproducer

Save the attached script as bug.py.

The script contains no application-specific imports. It defines:

  • a Numba jitclass sparse matrix type,
  • several @njit helpers,
  • a @jit(nopython=True) function returning the jitclass,
  • a PySide6 QThread that calls the function for the first time.

Commands

This succeeds:

bash
python bug.py --main-thread --no-cache

This crashes the process:

bash
python bug.py --no-cache

Expected behavior

The function should compile and run successfully from the Qt worker thread, or raise a Python exception if this usage is unsupported.

Actual behavior

The process terminates natively.

Typical output:

worker started on Python thread ..., Qt thread object ...
calling create_jacobian_like on Python thread ...
Bus error

In the original application, faulthandler showed the crash inside llvmlite/LLVM finalization:

Fatal Python error: Bus error

Current thread ... [GcThread]
  File ".../llvmlite/binding/ffi.py", line 212 in __call__
  File ".../llvmlite/binding/executionengine.py", line 99 in finalize_object
  File ".../numba/core/codegen.py", line 1071 in wrapper
  File ".../numba/core/codegen.py", line 1010 in _finalize_specific
  File ".../numba/core/codegen.py", line 808 in _finalize_final_module
  File ".../numba/core/codegen.py", line 776 in finalize
  ...

The native stack included:

libllvmlite.dylib ... AArch64AsmPrinter::emitEndOfAsmFile
libllvmlite.dylib ... llvm::MCJIT::finalizeObject
LLVMPY_FinalizeObject

Notes

This appears to be specific to first compilation from a Qt worker thread on macOS arm64. Precompiling the same function on the main thread avoids the crash in the reproducer, but that is not a reliable application-level fix.

The self-contained reproducer code used for this report is:

numba_qthread_jitclass_sigbus_repro.py