[capi-sig] Segfault when using own C-written module and exiting python

Laurent Gautier lgautier at gmail.com
Sun Jun 8 12:23:40 CEST 2008

I stumbled upon some documentation about that (it had to do with circular
references, AFAIR)... and I don't think that I have that flag set. I only have:

2008/6/7 Adam Olsen <rhamph at gmail.com>:
> On Fri, Jun 6, 2008 at 1:40 PM, Laurent Gautier <lgautier at gmail.com> wrote:
>> I have probably found the problem. I report it here in case someone
>> has the same issue later.
>> In my tp_new I had:
>> PyObject_New(MyType, type);
>> (and it was working just fine until I started with subclasses)
>> while it seems that it should have been:
>> type->tp_alloc(type, 0);
> Do you have Py_TPFLAGS_HAVE_GC set?  That'd require you to use
> PyObject_GC_New, which'd allocate extra space for the tracking flag,
> and the absence of which would explain the crash.
> --
> Adam Olsen, aka Rhamphoryncus

More information about the capi-sig mailing list