[pypy-dev] Sigsegv from Cython

Tin Tvrtković tinchester at gmail.com
Fri Apr 21 04:05:53 EDT 2017


Hello,

I'm working on a feature for the attrs library. As part of that feature I
need to wrap the member_descriptor descriptor from ordinary slot classes.
In order to speed this up, I'm using Cython.

I'm not really sure if this or the Cython mailing list is the right place
to ask this, but since I've had better luck here in the past I'm posting
this here first :)

A quick reproducer: Ubuntu 17.04/amd64, make a PyPy 5.7.1 venv, pip install
Cython, download
https://gist.github.com/Tinche/678a2f97f656421ab65338ea678df354 and
https://gist.github.com/Tinche/111ccd2f46c9ba303b8e441d2e0fcddb. Uncomment
the last line in t.py to trigger the crash.

This code seems to work on CPython (and it speeds up attribute access a lot
there). I'm not even sure doing this on PyPy is worthwhile, but as long as
it crashes I can't be sure :)

I'll be the first to admit I don't have a lot of experience writing Cython
or C, so maybe there's an amateur mistake in there. For example, I tried
putting in a few Py_INCREFs to maybe stop PyPy from moving objects around
but it doesn't seem to help.

Thanks in advance: :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20170421/7e6ea9cc/attachment.html>


More information about the pypy-dev mailing list