Error in carray.from_py

34 views
Skip to first unread message

Joshua

unread,
Sep 15, 2016, 2:59:44 PM9/15/16
to cython-users
I have some complicated Cython code that was previously cythonizing under Cython 0.22.1, but upon upgrading to 0.24.1, I get the following error:

Error compiling Cython file:
------------------------------------------------------------
...


cdef
extern from *:
   
object PyErr_Format(exc, const char *format, ...)


@cname("__Pyx_carray_from_py_float32__t")
cdef
int __Pyx_carray_from_py_float32__t(object o, float32_t *v, Py_ssize_t length) except -1:
                                                 
^
------------------------------------------------------------


carray
.from_py:77:51: 'float32_t' is not a type identifier

The traceback isn't giving me enough information to figure out what line in the .pyx file is causing the issue, so I'm not sure if I can provide a minimal example at this time. It seems like a compiler regression. 

I'm running on OSX. I tested the code with the following versions of Cython:

Cythonized:
---------------
0.22.1
0.23.0

Failed:
---------
0.23.1
0.23.2
0.23.3
0.23.4
0.23.5
0.24.1

All of the versions of Cython that failed, failed with the same error. I'm hoping one of the developers might be able to see the traceback and the fact that the issue was introduced between releases 0.23.0 and 0.23.1 and be able to tell where the regression was introduced. 

Thanks,
Josh

Stefan Behnel

unread,
Sep 18, 2016, 6:40:51 AM9/18/16
to cython...@googlegroups.com
Thanks for your investigations. Could you use "git bisect" to find the
commit that triggered the failure? Try these commands:

git bisect start 0.23.1 0.23 --
git bisect run python ./cython.py path/to/your/module.pyx
git bisect reset

Stefan

Joshua Adelman

unread,
Sep 18, 2016, 3:05:43 PM9/18/16
to cython...@googlegroups.com, Stefan Behnel
Hi Stefan,

Thanks for your reply. I ran `git bisect` as you described and get the following results:

Bisecting: 0 revisions left to test after this (roughly 0 steps)
[77bb90df88f85ec6e45d4c78278134f037d56829] changelog
running python cython.py /zzz/xxx/xxx/xxx/xxx/fxxx.pyx
27f8ddb6b2a16d5fe938a42a9655a1919b21161a is the first bad commit
commit 27f8ddb6b2a16d5fe938a42a9655a1919b21161a
Author: Stefan Behnel <stef...@behnel.de>
Date:   Sun Aug 9 20:26:19 2015 +0200

    fix #855: make "import *" include all necessary "from_py" coercion helper functions

:100644 100644 327d7af8715cd01870e05af0ee9abd58e4a44fd2 0791de3333b36297e6bee9763a73c3e0efbb06bd M CHANGES.rst
:040000 040000 dcd52de7aef911aff50b42e5cbe4fa5e15a59139 ea63ef0a74ad50578822fd9498e84fcca7623c2e M Cython
:040000 040000 bd3ec17792950a24455efcda7bf2b68aa1cbbe1f c33384d25df25f67037bc1da1370cf863f34b649 M tests
bisect run success

Please let me know if there is anything else you need me to do to help debug the code. I wish I could provide the actual code, but I’m not at liberty to do so. I could try to come up with a minimal example by mangling variable names and attempting to add as many lines of code as is necessary to trigger the error. Let me know.

Also strangely I uncovered another bug related to “import *” a while back that did get fixed in the 0.24 release:

I’m not sure if this is somehow related.

Josh

Joshua

unread,
Sep 19, 2016, 9:49:34 AM9/19/16
to cython-users, stef...@behnel.de
Hi Stefan,

To follow-up, here is a minimal example that seems to reproduce the bug:

The line that triggers the error is:

```
cdef YPAIR pairs[MAXR] 
```

I hope that helps. Let me know if I should post this to the Cython Github issue tracker.

Josh
Reply all
Reply to author
Forward
0 new messages