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 crash in AnalyseDeclarationsTransform #2039

Open
pitrou opened this Issue Dec 11, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@pitrou
Contributor

pitrou commented Dec 11, 2017

This is with 0.27.3:

$ python setup.py build_ext --inplace -vvv
Compiling distributed/schedulerstate.py because it changed.
[1/1] Cythonizing distributed/schedulerstate.py

Error compiling Cython file:
------------------------------------------------------------
...
        self.worker_restrictions = None
        self.resource_restrictions = None
        self.loose_restrictions = False

    @cython.ccall
    def get_nbytes(self):
   ^
------------------------------------------------------------

distributed/schedulerstate.py:440:4: Compiler crash in AnalyseDeclarationsTransform

File 'ModuleNode.py', line 122, in analyse_declarations: ModuleNode(schedulerstate.py:1:0,
    full_module_name = 'distributed.schedulerstate')
File 'Nodes.py', line 417, in analyse_declarations: StatListNode(schedulerstate.py:3:0)
File 'Nodes.py', line 417, in analyse_declarations: StatListNode(schedulerstate.py:153:0)
File 'Nodes.py', line 4461, in analyse_declarations: PyClassDefNode(schedulerstate.py:153:0,
    doc = '...',
    name = 'TaskState')
File 'Nodes.py', line 417, in analyse_declarations: StatListNode(schedulerstate.py:154:4)
File 'Nodes.py', line 361, in analyse_declarations: CompilerDirectivesNode(schedulerstate.py:440:4)
File 'Nodes.py', line 417, in analyse_declarations: StatListNode(schedulerstate.py:440:4)
File 'Nodes.py', line 2367, in analyse_declarations: CFuncDefNode(schedulerstate.py:440:4,
    args = [...]/1,
    modifiers = [...]/0,
    overridable = True,
    visibility = 'private')
File 'Nodes.py', line 2376, in declare_cpdef_wrapper: CFuncDefNode(schedulerstate.py:440:4,
    args = [...]/1,
    modifiers = [...]/0,
    overridable = True,
    visibility = 'private')
File 'Nodes.py', line 2437, in call_self_node: CFuncDefNode(schedulerstate.py:440:4,
    args = [...]/1,
    modifiers = [...]/0,
    overridable = True,
    visibility = 'private')

Compiler crash traceback from this point on:
  File "/home/antoine/miniconda3/envs/dask36/lib/python3.6/site-packages/Cython/Compiler/Nodes.py", line 2437, in call_self_node
    type_entry = self.type.args[0].type.entry
AttributeError: 'PyObjectType' object has no attribute 'entry'
Traceback (most recent call last):
  File "setup.py", line 21, in <module>
    ext_modules = cythonize(extensions)
  File "/home/antoine/miniconda3/envs/dask36/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1039, in cythonize
    cythonize_one(*args)
  File "/home/antoine/miniconda3/envs/dask36/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1161, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: distributed/schedulerstate.py
@scoder

This comment has been minimized.

Show comment
Hide comment
@scoder

scoder Dec 15, 2017

Contributor

Hmm, something is wrong here. The conversion from a Python class to an extension type should have been done at that point, based on the @cclass class decorator, so self should be properly typed and not be a plain Python object anymore - which is what makes it fail here.

Could you try to strip this down to a shorter test case that allows me to reproduce this? Please also use the latest Cython master, which has some fixes for the other tickets that you created.

Contributor

scoder commented Dec 15, 2017

Hmm, something is wrong here. The conversion from a Python class to an extension type should have been done at that point, based on the @cclass class decorator, so self should be properly typed and not be a plain Python object anymore - which is what makes it fail here.

Could you try to strip this down to a shorter test case that allows me to reproduce this? Please also use the latest Cython master, which has some fixes for the other tickets that you created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment