Author jcristau
Recipients Stanisław Skonieczny (Uosiu), benjamin.peterson, bkabrda, eryksun, jcristau, python-dev, twouters
Date 2016-04-05.20:56:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1459889795.59.0.836453416626.issue25731@psf.upfronthosting.co.za>
In-reply-to
Content
This change in 2.7 seems to break things:

$ cat foo.pxd 
cdef class B:
    cdef object b
$ cat foo.pyx 
cdef class A:
    pass

cdef class B:
    def __init__(self, b):
        self.b = b
$ cat bar.py
from foo import A, B

class C(A, B):
    def __init__(self):
        B.__init__(self, 1)

C()
$ cython foo.pyx && gcc -I/usr/include/python2.7 -Wall -shared -fPIC -o foo.so foo.c
$ python -c 'import bar'
Segmentation fault

C's tp_new is set to A's tp_new function, thus the b slot is never initialized to Py_None, and C's __init__ calls DECREF on a NULL pointer.

Reverting changeset e7062dd9085e makes things work again, with C's tp_new being B's tp_new.
History
Date User Action Args
2016-04-05 20:56:35jcristausetrecipients: + jcristau, twouters, benjamin.peterson, python-dev, bkabrda, eryksun, StanisÅ‚aw Skonieczny (Uosiu)
2016-04-05 20:56:35jcristausetmessageid: <1459889795.59.0.836453416626.issue25731@psf.upfronthosting.co.za>
2016-04-05 20:56:35jcristaulinkissue25731 messages
2016-04-05 20:56:35jcristaucreate