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
The Cython compiler crashes with the following code using cython.ufunc with multiple, fused return types (single, fused return types work, as do multiple, non-fused return types):
[1/1] Cythonizing ufunc_fused.pyx
D:\ufunc\Cython\Compiler\Main.py:373: FutureWarning: Cython directive 'language_level' not set, using '3' (Py3). This has changed from earlier releases! File: D:\ufunc\ufunc_fused.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
Error compiling Cython file:
------------------------------------------------------------
...
cimport cython
from cython cimport floating
@cython.ufunc
cdef (floating, floating) add_one(floating x):
^
------------------------------------------------------------
ufunc_fused.pyx:5:5: Compiler crash in AnalyseDeclarationsTransform
File 'ModuleNode.py', line 202, in analyse_declarations: ModuleNode(ufunc_fused.pyx:1:0,
full_module_name ='ufunc_fused')
File 'Nodes.py', line 386, in analyse_declarations: StatListNode(ufunc_fused.pyx:1:0)
File 'Nodes.py', line 386, in analyse_declarations: StatListNode(ufunc_fused.pyx:5:5)
File 'Nodes.py', line 328, in analyse_declarations: CompilerDirectivesNode(ufunc_fused.pyx:5:5)
File 'Nodes.py', line 386, in analyse_declarations: StatListNode(ufunc_fused.pyx:5:5)
File 'Nodes.py', line 2620, in analyse_declarations: CFuncDefNode(ufunc_fused.pyx:5:5,
modifiers = [...]/0,
outer_attrs = [...]/2,
visibility ='private')
File 'Nodes.py', line 1356, in analyse: CTupleBaseTypeNode(ufunc_fused.pyx:5:5)
Compiler crash traceback from this point on:
File "D:\ufunc\Cython\Compiler\Nodes.py", line 1356, in analyse
entry = env.declare_tuple_type(self.pos, component_types)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ufunc\Cython\Compiler\Symtab.py", line 1343, in declare_tuple_type
ttype =self._cached_tuple_types[components] = PyrexTypes.c_tuple_type(components)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ufunc\Cython\Compiler\PyrexTypes.py", line 4652, in c_tuple_type
cname = Naming.ctuple_type_prefix + type_list_identifier(components)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ufunc\Cython\Compiler\PyrexTypes.py", line 5440, in type_list_identifierreturn cap_length('__and_'.join(type_identifier(type) fortypein types))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ufunc\Cython\Compiler\PyrexTypes.py", line 5440, in <genexpr>return cap_length('__and_'.join(type_identifier(type) fortypein types))
^^^^^^^^^^^^^^^^^^^^^
File "D:\ufunc\Cython\Compiler\PyrexTypes.py", line 5468, in type_identifier
decl =type.empty_declaration_code(pyrex=pyrex)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ufunc\Cython\Compiler\PyrexTypes.py", line 50, in empty_declaration_codeself._empty_declaration =self.declaration_code('')
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ufunc\Cython\Compiler\PyrexTypes.py", line 1924, in declaration_coderaiseException("This may never happen, please report a bug")
Exception: This may never happen, please report a bug
Traceback (most recent call last):
File "D:\ufunc\setup.py", line 4, in <module>
setup(
File "X:\Python311\Lib\site-packages\setuptools\__init__.py", line 103, in setupreturn distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "X:\Python311\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setupreturn run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "X:\Python311\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "X:\Python311\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commandsself.run_command(cmd)
File "X:\Python311\Lib\site-packages\setuptools\dist.py", line 963, in run_commandsuper().run_command(command)
File "X:\Python311\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "X:\Python311\Lib\site-packages\setuptools\command\build_ext.py", line 89, in run
_build_ext.run(self)
File "X:\Python311\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 345, in runself.build_extensions()
File "X:\Python311\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 467, in build_extensionsself._build_extensions_serial()
File "X:\Python311\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 493, in _build_extensions_serialself.build_extension(ext)
File "X:\Python311\Lib\site-packages\setuptools\command\build_ext.py", line 250, in build_extension
_build_ext.build_extension(self, ext)
File "D:\ufunc\Cython\Distutils\build_ext.py", line 129, in build_extension
new_ext = cythonize(
^^^^^^^^^^
File "D:\ufunc\Cython\Build\Dependencies.py", line 1168, in cythonize
cythonize_one(*args)
File "D:\ufunc\Cython\Build\Dependencies.py", line 1331, in cythonize_oneraise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: ufunc_fused.pyx
Describe the bug
Thanks again for fixing #6064.
The Cython compiler crashes with the following code using cython.ufunc with multiple, fused return types (single, fused return types work, as do multiple, non-fused return types):
Code to reproduce the behaviour:
Expected behaviour
No compiler crash
OS
Windows 11
Python version
3.11, 3.12
Cython version
3.0.9 and current main branch (f3cad15)
Additional context
No response
The text was updated successfully, but these errors were encountered: