[Cython] Compiler crash in MarkOverflowingArithmetic

Stefan Behnel stefan_ml at behnel.de
Tue Sep 1 21:01:23 CEST 2015


Jakub Wilk schrieb am 30.08.2015 um 21:29:
> Tested with Cython 0.23.1 on i386. You will probably need a bigger number
> to trigger it on a 64-bit machine.
> 
> $ cython test.pyx
> 
> Error compiling Cython file:
> ------------------------------------------------------------
> ...
> DEF X = 0x811C9DC5
> cdef void f():
>    cdef unsigned int x = X
>        ^
> ------------------------------------------------------------
> 
> test.pyx:3:9: Compiler crash in MarkOverflowingArithmetic
> 
> ModuleNode.body = StatListNode(test.pyx:2:5)
> StatListNode.stats[0] = CFuncDefNode(test.pyx:2:5,
>    args = [...]/0,
>    modifiers = [...]/0,
>    visibility = 'private')
> CFuncDefNode.body = StatListNode(test.pyx:3:9)
> StatListNode.stats[0] = SingleAssignmentNode(test.pyx:3:9,
>    first = True)
> 
> Compiler crash traceback from this point on:
>  File "/usr/local/lib/python2.7/dist-packages/Cython/Compiler/Visitor.py",
> line 183, in _visit
>    return handler_method(obj)
>  File
> "/usr/local/lib/python2.7/dist-packages/Cython/Compiler/TypeInference.py",
> line 327, in visit_SingleAssignmentNode
>    self.visit_assignment(node.lhs, node.rhs)
>  File
> "/usr/local/lib/python2.7/dist-packages/Cython/Compiler/TypeInference.py",
> line 321, in visit_assignment
>    and Utils.long_literal(rhs.value)):
>  File "/usr/local/lib/python2.7/dist-packages/Cython/Utils.py", line 318,
> in long_literal
>    value = str_to_number(value)
>  File "/usr/local/lib/python2.7/dist-packages/Cython/Utils.py", line 312,
> in str_to_number
>    value = int(value, 0)
> ValueError: invalid literal for int() with base 0: '2166136261L'

Thanks for the report. This should fix it:

https://github.com/cython/cython/commit/ea6414cd293ba2134c3df5b37b158d8e3db79083

Stefan



More information about the cython-devel mailing list