numba / llvmlite

A lightweight LLVM python binding for writing JIT compilers
https://llvmlite.pydata.org/
BSD 2-Clause "Simplified" License
1.94k stars 322 forks source link

x86 OrcJIT test error #1003

Closed gmarkall closed 1 year ago

gmarkall commented 1 year ago

In some cases the OrcJIT tests can fail with:

running run_test.py
..s................................................................s.........................................JIT session error: Symbols not found: [ Py_GetVersion ]
E...................................................................................................................................................................................................................................................................
======================================================================
ERROR: test_lookup_current_process_symbol (llvmlite.tests.test_binding.TestOrcLLJIT)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/conda/feedstock_root/build_artifacts/llvmlite_1697110482515/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/pypy3.9/site-packages/llvmlite/tests/test_binding.py", line 1367, in test_lookup_current_process_symbol
    self.jit(asm_getversion, "getversion", None, True)
  File "/home/conda/feedstock_root/build_artifacts/llvmlite_1697110482515/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/pypy3.9/site-packages/llvmlite/tests/test_binding.py", line 1241, in jit
    rt = builder\
  File "/home/conda/feedstock_root/build_artifacts/llvmlite_1697110482515/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/pypy3.9/site-packages/llvmlite/binding/orcjit.py", line 175, in link
    raise RuntimeError(str(outerr))
RuntimeError: Failed to materialize symbols: { (getversion, { getversion }) }

(spotted during a build of the conda-forge llvmlite 0.41.0 package). I haven't time to look into this, but I suspect that the test test_lookup_current_process_symbol_fails failing to find the symbol messes up / corrupts state somehow, such that even after enabling search for symbols in the current process, lookups still fail.

See also #1002.

gmarkall commented 1 year ago

This is because it was running on PyPy, where the function Py_GetVersion() does not exist.