llvmlite: Importing llvmlite on Github Actions MacOS crashes Python

Sorry I don’t have more info on what is going on but I noticed that importing numba on Github Actions MacOS runner throws an abort trap: 6 when getting to the llvmlite imports. This happens on the MacOS 10.15 runner on Python 3.6 and 3.7. The full logs can be found at https://github.com/micom-dev/micom/runs/637947756?check_suite_focus=true.

The relevant part of the logs:

Fatal Python error: Aborted

Current thread 0x000000011454cdc0 (most recent call first):
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/llvmlite/binding/ffi.py", line 113 in __call__
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/llvmlite/binding/transforms.py", line 88 in _populate_module_pm
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/llvmlite/binding/transforms.py", line 95 in populate
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/numba/core/codegen.py", line 697 in _module_pass_manager
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/numba/core/codegen.py", line 664 in _init
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/numba/core/codegen.py", line 645 in __init__
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/numba/core/cpu.py", line 47 in init
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/numba/core/compiler_lock.py", line 32 in _acquire_compile_lock
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/numba/core/base.py", line 259 in __init__
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/numba/core/registry.py", line 31 in _toplevel_target_context
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/numba/core/utils.py", line 331 in __get__
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/numba/core/registry.py", line 47 in target_context
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/numba/core/dispatcher.py", line 670 in __init__
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/numba/core/decorators.py", line 189 in wrapper
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/numba/core/decorators.py", line 173 in jit
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/numba/core/decorators.py", line 236 in njit
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/numba/typed/typeddict.py", line 22 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 728 in exec_module
[...]
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/config/__init__.py", line 125 in main
  File "/Users/runner/hostedtoolcache/Python/3.7.6/x64/bin/pytest", line 8 in <module>
/Users/runner/runners/2.169.1/work/_temp/d017b5e1-8779-4c88-b9d6-e5a88227601f.sh: line 2:  1709 Abort trap: 6           pytest --benchmark-skip --cov=micom --cov-report=xml
##[error]Process completed with exit code 134.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 35 (30 by maintainers)

Most upvoted comments

Using the following patch:

diff --git i/numba/core/codegen.py w/numba/core/codegen.py
index 7ee924633b..d432019430 100644
--- i/numba/core/codegen.py
+++ w/numba/core/codegen.py
@@ -690,6 +690,7 @@ class BaseCPUCodegen(object):
     def unserialize_library(self, serialized):
         return self._library_class._unserialize(self, serialized)

+    @require_global_compiler_lock()
     def _module_pass_manager(self):
         pm = ll.create_module_pass_manager()
         self._tm.add_analysis_passes(pm)
@@ -697,6 +698,7 @@ class BaseCPUCodegen(object):
             pmb.populate(pm)
         return pm

+    @require_global_compiler_lock()
     def _function_pass_manager(self, llvm_module):
         pm = ll.create_function_pass_manager(llvm_module)
         self._tm.add_analysis_passes(pm)
@@ -704,6 +706,7 @@ class BaseCPUCodegen(object):
             pmb.populate(pm)
         return pm

+    @require_global_compiler_lock()
     def _pass_manager_builder(self):
         """
         Create a PassManagerBuilder.

Results in exchanging the error for a test failure:

$ pytest tests/test_viz.py
========================================================================= test session starts =========================================================================
platform darwin -- Python 3.7.4, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
benchmark: 3.2.3 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /Users/vhaenel/git/micom, inifile: setup.cfg
plugins: benchmark-3.2.3, cov-2.8.1
collected 0 items / 1 error

=============================================================================== ERRORS ================================================================================
_________________________________________________________________ ERROR collecting tests/test_viz.py __________________________________________________________________
tests/test_viz.py:4: in <module>
    import micom.viz as viz
micom/viz/__init__.py:4: in <module>
    from .exchanges import (
micom/viz/exchanges.py:8: in <module>
    from umap import UMAP
.venv/lib/python3.7/site-packages/umap/__init__.py:1: in <module>
    from .umap_ import UMAP
.venv/lib/python3.7/site-packages/umap/umap_.py:26: in <module>
    import numba
../numba/numba/__init__.py:34: in <module>
    from numba.core.decorators import (cfunc, generated_jit, jit, njit, stencil,
../numba/numba/core/decorators.py:12: in <module>
    from numba.stencils.stencil import stencil
../numba/numba/stencils/stencil.py:11: in <module>
    from numba.core import types, typing, utils, ir, config, ir_utils, registry
../numba/numba/core/registry.py:4: in <module>
    from numba.core import utils, typing, dispatcher, cpu
../numba/numba/core/dispatcher.py:15: in <module>
    from numba.core import utils, types, errors, typing, serialize, config, compiler, sigutils
../numba/numba/core/serialize.py:12: in <module>
    from numba.core import bytecode, compiler
../numba/numba/core/compiler.py:6: in <module>
    from numba.core import (utils, errors, typing, interpreter, bytecode, postproc,
../numba/numba/core/cpu.py:11: in <module>
    from numba.core import utils, types, config, cgutils, callconv, codegen, externals, fastmathpass, intrinsics
../numba/numba/core/codegen.py:635: in <module>
    class BaseCPUCodegen(object):
../numba/numba/core/codegen.py:693: in BaseCPUCodegen
    @require_global_compiler_lock()
../numba/numba/core/compiler_lock.py:53: in require_global_compiler_lock
    assert global_compiler_lock.is_locked()
E   AssertionError
======================================================================= short test summary info =======================================================================
ERROR tests/test_viz.py - AssertionError
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================================== 1 error in 2.40s ===========================================================================

props go out to @sklam and @stuartarchibald for an OOB conversation that included the suggestion implemented above.