[Cython] bug report: compiler crash when assigning from function call returning ndarray

Lars Buitinck L.J.Buitinck at uva.nl
Tue Nov 20 00:06:37 CET 2012


Hi all,

I just got a compiler crash (Cython 0.17, 0.17.1 and current master)
when trying to compile a call to a function returning an np.ndarray:


cimport numpy as np

cdef np.ndarray[np.float64_t, ndim=2] trivial(X):
    return X

def test():
    # Uncommenting the following line, or removing the assignment,
    # prevents the crash:
    #cdef np.ndarray[np.float64_t, ndim=2] Z
    Z = trivial(np.zeros(4))


I'm aware that the program contains an error and it's not much of a
hindrance to the project I'm working on, but the error message just
isn't very friendly:


Compiler crash traceback from this point on:
  File "/home/lars/src/cython/Cython/Compiler/ExprNodes.py", line
1528, in analyse_target_types
    Buffer.used_buffer_aux_vars(self.entry)
  File "/home/lars/src/cython/Cython/Compiler/Buffer.py", line 280, in
used_buffer_aux_vars
    buffer_aux.buflocal_nd_var.used = True
AttributeError: 'NoneType' object has no attribute 'buflocal_nd_var'


More details at https://gist.github.com/4114677. I looked at Buffer.py
and ExprNodes.py, but I couldn't figure out what exactly was going on.
Could someone please look into this?

TIA,

-- 
Lars Buitinck
Scientific programmer, ILPS
University of Amsterdam


More information about the cython-devel mailing list