New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler crashes while analyzing fused method with optional arguments only on Python 3.11 #5894
Milestone
Comments
mobiusklein
changed the title
[BUG]
Compiler crashes while analyzing fused method with optional arguments only on Python 3.11
Dec 5, 2023
This actually turns out to be a duplicate of something we thought was a PyPy specific bug: #5588 (comment). I'll fix it properly now |
da-woods
added a commit
to da-woods/cython
that referenced
this issue
Dec 5, 2023
In some Python versions, generating the error message when .index fails to find an index leads to a compiler crash. Fix this by not relying on type being fully set up while generating __str__. Fixes cython#5894 and cython#5588
This was referenced Dec 5, 2023
I've reported it as a bug to CPython, because they have changed the behaviour when generating certain exceptions. I plan to fix it here anyway, whatever they decide to do in CPython. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I've observed that Cython crashes when analyzing a
cdef class
with acdef
method taking fused type arguments and optional arguments, but not always consistently, and only on Python 3.11. It seemed to affect all versions of Cython 3, including the current master branch.As the traceback seems to show, the
op_arg_struct
attribute of theCFuncType
node behind the declaration is left asNone
. I was not able to trace out where it should have been set.The method signature in question is
If the default arguments are removed, the code compiles without issue.
Code to reproduce the behaviour:
No response
Expected behaviour
No response
OS
Windows, Linux
Python version
3.11.5
Cython version
<= 3.0.6
Additional context
The project compiles without issue on Python 3.8-3.10 without issue. The full project is https://github.com/mobiusklein/ms_peak_picker, with the tag for the last released version with the defect https://github.com/mobiusklein/ms_peak_picker/releases/tag/v0.1.43
I was unable reduce this to a minimal example as it seemed to interact with
Cython.Compiler.FusedNode
theenv
context variable passed through much of Cython which holds state beyond just the class.The text was updated successfully, but these errors were encountered: