Compiler crash in AnalyseExpressionsTransform

43 views
Skip to first unread message

vayal

unread,
Jun 20, 2017, 5:40:45 AM6/20/17
to cython-users
Hi,

I am using cython 0.25.2 and found Cython to be crashing when compiling a .py file. The reduced file that reproduces the issue is below:

class Number: zero = 0


def main():
    m1
= 1 + max(1, Number.zero)
    m2
= m1
   
print m2


main
()


Some of the modifications that makes the error disappear are:
* If I change Number.zero to a local variable or a constant
* If I change the order of parameters in max
* I I remove m2 = m1

Any idea what's going on?

The error seen is:

Error compiling Cython file:
------------------------------------------------------------
...
class Number: zero = 0


def main():
^
------------------------------------------------------------


cyerr
.py:3:0: Compiler crash in AnalyseExpressionsTransform


ModuleNode.body = StatListNode(cyerr.py:1:0)
StatListNode.stats[1] = DefNode(cyerr.py:3:0,
    is_cyfunction
= True,
    modifiers
= [...]/0,
    name
= u'main',
    py_wrapper_required
= True,
    reqd_kw_flags_cname
= '0',
    used
= True)


Compiler crash traceback from this point on:
 
File "Cython\Compiler\Visitor.py", line 180, in Cython.Compiler.Visitor.TreeVisitor._visit (C:\projects\cython-wheels\Cython\Cython\Compiler\Visitor.c:5261)
   
return handler_method(obj)
 
File "c:\python27\lib\site-packages\Cython\Compiler\ParseTreeTransforms.py", line 2008, in visit_FuncDefNode
    node
.local_scope.infer_types()
 
File "c:\python27\lib\site-packages\Cython\Compiler\Symtab.py", line 887, in infer_types
    get_type_inferer
().infer_types(self)
 
File "c:\python27\lib\site-packages\Cython\Compiler\TypeInference.py", line 454, in infer_types
   
if not resolve_assignments(assignments):
 
File "c:\python27\lib\site-packages\Cython\Compiler\TypeInference.py", line 419, in resolve_assignments
    infer_name_node_type
(node)
 
File "c:\python27\lib\site-packages\Cython\Compiler\TypeInference.py", line 401, in infer_name_node_type
    types
, entry.might_overflow, entry.pos, scope)
 
File "c:\python27\lib\site-packages\Cython\Compiler\TypeInference.py", line 523, in safe_spanning_type
    result_type
= simply_type(reduce(find_spanning_type, types), pos)
 
File "c:\python27\lib\site-packages\Cython\Compiler\TypeInference.py", line 509, in simply_type
   
if result_type.is_reference:
AttributeError: 'NoneType' object has no attribute 'is_reference'



vayal

unread,
Jun 27, 2017, 1:30:01 AM6/27/17
to cython-users
On Tuesday, 20 June 2017 15:10:45 UTC+5:30, vayal wrote:
Hi,

I am using cython 0.25.2 and found Cython to be crashing when compiling a .py file. The reduced file that reproduces the issue is below:

 
 

Robert Bradshaw

unread,
Jun 27, 2017, 2:32:41 AM6/27/17
to cython...@googlegroups.com
Fixed at head.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "cython-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cython-users...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages