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
This is derived from a SymPy issue (sympy/sympy#23509) after updating CI to use Python 3.10 for the tests that involved llvmlite. These tests still pass under Python 3.9 but fail with a segfault under Python 3.10.
I haven't used llvmlite directly before so I'm not 100% sure that the code in this demonstration is correct (maybe it's a bug on SymPy's side?). The example does seem to work fine under Python 3.9 though and the SymPy code for this was tested in CI for previous Python versions.
There is context in the SymPy issue but I have extracted a self-contained reproducer that doesn't use SymPy here:
I suppose another possibility would be that this is to do with a change in ctypes but I don't see any mention of ctypes in the Python 3.10 release notes: https://docs.python.org/3/whatsnew/3.10.html
That seems to work in a simple example. I'll test further.
Yes, it makes sense that PyFloat_FromDouble needs the GIL now that you point that out. Maybe the actual fix is just not using PyFloat_FromDouble and doing cfunc = ctypes.CFUNCTYPE(ctypes.c_double, ctypes.c_double)(fptr) (which seems to work).
Thanks for your help. Since this doesn't seem to be an issue with llvmlite I'll close this.
This is derived from a SymPy issue (sympy/sympy#23509) after updating CI to use Python 3.10 for the tests that involved llvmlite. These tests still pass under Python 3.9 but fail with a segfault under Python 3.10.
I haven't used llvmlite directly before so I'm not 100% sure that the code in this demonstration is correct (maybe it's a bug on SymPy's side?). The example does seem to work fine under Python 3.9 though and the SymPy code for this was tested in CI for previous Python versions.
There is context in the SymPy issue but I have extracted a self-contained reproducer that doesn't use SymPy here:
I can confirm on OSX (x86_64) that this script succeeds under Python 3.9.0:
However under Python 3.10.0 this gives a segfault.
I'm using llvmlite 0.38.0 (installed with pip) in both cases.
I don't immediately have a Linux machine to test this with but the 3.10 CI failures suggest that the problem is the same on Linux.
The text was updated successfully, but these errors were encountered: