Skip to content

Instantly share code, notes, and snippets.

@ogrisel
Created March 31, 2012 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ogrisel/2268824 to your computer and use it in GitHub Desktop.
Save ogrisel/2268824 to your computer and use it in GitHub Desktop.
cython 0.16rc0 crash report on scikit-learn master

To reproduce:

git clone https://github.com/scikit-learn/scikit-learn.git && cd scikit-learn
make cython

Here is the stderr output:


Error compiling Cython file:
------------------------------------------------------------
...
        if key.dtype != np.int32:
            raise TypeError(
                "key.dtype should be int32, got %s" % key.dtype)
        if positive:
            return murmurhash3_bytes_array_u32(key.ravel(),
                                               seed).reshape(key.shape)
                                                   ^
------------------------------------------------------------

sklearn/utils/murmurhash.pyx:117:52: Compiler crash in AnalyseExpressionsTransform

ModuleNode.body = StatListNode(murmurhash.pyx:17:0)
StatListNode.stats[9] = StatListNode(murmurhash.pyx:74:0)
StatListNode.stats[0] = DefNode(murmurhash.pyx:74:0,
    doc = u'Compute the 32bit murmurhash3 of key at seed.\n\n    The underlying implementation is MurmurHash3_x86_32 generating low\n    latency 32bits hash suitable for implementing lookup tables, Bloom\n    filters, count min sketch or feature hashing.\n\n    Parameters\n    ----------\n    key: int32, bytes, unicode or ndarray with dtype int32\n        the physical object to hash\n\n    seed: int, optional default is 0\n        integer seed for the hashing algorithm.\n\n    positive: boolean, optional default is False\n        True: the results is casted to an unsigned int\n          from 0 to 2 ** 32 - 1\n        False: the results is casted to a signed int\n          from -(2 ** 31) to 2 ** 31 - 1\n\n    ',
    modifiers = [...]/0,
    name = u'murmurhash3_32',
    num_required_args = 1,
    py_wrapper_required = True,
    reqd_kw_flags_cname = '0',
    used = True)
File 'Nodes.py', line 342, in analyse_expressions: StatListNode(murmurhash.pyx:96:4,
    is_terminator = True)
File 'Nodes.py', line 5589, in analyse_expressions: IfStatNode(murmurhash.pyx:96:4,
    is_terminator = True)
File 'Nodes.py', line 5631, in analyse_expressions: IfClauseNode(murmurhash.pyx:111:9,
    is_terminator = True)
File 'Nodes.py', line 342, in analyse_expressions: StatListNode(murmurhash.pyx:112:8,
    is_terminator = True)
File 'Nodes.py', line 5589, in analyse_expressions: IfStatNode(murmurhash.pyx:115:8,
    is_terminator = True)
File 'Nodes.py', line 5631, in analyse_expressions: IfClauseNode(murmurhash.pyx:115:11,
    is_terminator = True)
File 'Nodes.py', line 342, in analyse_expressions: StatListNode(murmurhash.pyx:116:12,
    is_terminator = True)
File 'Nodes.py', line 5324, in analyse_expressions: ReturnStatNode(murmurhash.pyx:116:12,
    is_terminator = True)
File 'ExprNodes.py', line 3596, in analyse_types: SimpleCallNode(murmurhash.pyx:117:60,
    analysed = True,
    result_is_used = True,
    use_managed_ref = True)
File 'ExprNodes.py', line 4288, in analyse_types: AttributeNode(murmurhash.pyx:117:52,
    attribute = u'reshape',
    initialized_check = True,
    is_attribute = 1,
    is_called = 1,
    member = u'reshape',
    needs_none_check = True,
    op = '->',
    result_is_used = True,
    use_managed_ref = True)
File 'ExprNodes.py', line 4374, in analyse_as_ordinary_attribute: AttributeNode(murmurhash.pyx:117:52,
    attribute = u'reshape',
    initialized_check = True,
    is_attribute = 1,
    is_called = 1,
    member = u'reshape',
    needs_none_check = True,
    op = '->',
    result_is_used = True,
    use_managed_ref = True)
File 'ExprNodes.py', line 4450, in analyse_attribute: AttributeNode(murmurhash.pyx:117:52,
    attribute = u'reshape',
    initialized_check = True,
    is_attribute = 1,
    is_called = 1,
    member = u'reshape',
    needs_none_check = True,
    op = '->',
    result_is_used = True,
    use_managed_ref = True)

Compiler crash traceback from this point on:
  File "/home/ogrisel/coding/cython/Cython/Compiler/ExprNodes.py", line 4450, in analyse_attribute
    replacement_node = numpy_transform_attribute_node(self)
  File "/home/ogrisel/coding/cython/Cython/Compiler/NumpySupport.py", line 18, in numpy_transform_attribute_node
    numpy_pxd_scope = node.obj.entry.type.scope.parent_scope
AttributeError: 'SimpleCallNode' object has no attribute 'entry'
make: *** [cython] Error 123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment