Author tseaver
Recipients tseaver
Date 2012-12-14.02:31:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1355452262.45.0.54382908485.issue16676@psf.upfronthosting.co.za>
In-reply-to
Content
A test of the 'persistent' package C extension segfaults under 3.3,
but completes successfully under 3.2.  The C function being tested
is a wrapper around PyType_GenericNew:



static PyObject *
simple_new(PyObject *self, PyObject *type_object)
{
    if (!PyType_Check(type_object))
    {
        PyErr_SetString(PyExc_TypeError,
                        "simple_new argument must be a type object.");
        return NULL;
    }
    return PyType_GenericNew((PyTypeObject *)type_object, NULL, NULL);
}


The unit test which segfaults just iterates over basic types:


        def test_w_type(self):
            for typ in (type, list, dict, tuple, object):
                self.assertTrue(isinstance(self._callFUT(typ), typ))

Some digging shows that the segfault comes while deallocating the
newly-made 'dict' object.



#0  dict_dealloc (mp=0x7ffff3f9d248) at Objects/dictobject.c:1392
#1  0x00000000004261cb in tupledealloc (op=0x7ffff3d90ab8)
    at Objects/tupleobject.c:238
#2  0x000000000048065d in call_function (oparg=<optimized out>, 
    pp_stack=0x7fffffffa6e0) at Python/ceval.c:4064
#3  PyEval_EvalFrameEx (f=<optimized out>, throwflag=<optimized out>)
    at Python/ceval.c:2679
#4  0x0000000000480b23 in fast_function (nk=<optimized out>, na=1, 
    n=<optimized out>, pp_stack=0x7fffffffa850, func=0x7ffff42284d0)
    at Python/ceval.c:4150
#5  call_function (oparg=<optimized out>, pp_stack=0x7fffffffa850)
    at Python/ceval.c:4083
History
Date User Action Args
2012-12-14 02:31:02tseaversetrecipients: + tseaver
2012-12-14 02:31:02tseaversetmessageid: <1355452262.45.0.54382908485.issue16676@psf.upfronthosting.co.za>
2012-12-14 02:31:02tseaverlinkissue16676 messages
2012-12-14 02:31:00tseavercreate