problem with extending python with C

Ignacio Vazquez-Abrams ignacio at openservices.net
Mon Sep 17 02:32:26 EDT 2001


On Mon, 17 Sep 2001, LAMY Bertrand wrote:

> now I've got another problem. I got a segfault at the end of my program,
> after python has destroyed all the objects (I know that because I've put
> a printf in the dealloc functions. so this is not very important since
> it crashes only at termination). I got the segfault in that case :
> - I've got 2 type object defined in C (if 1 of the 2 is defined in
> Python, it won't crash) : one is a carrier which a Pyobject* (given at
> creation, the carrier Py_INCREF the PyObject given and Py_DECREF it at
> deallocation), the second is a carried (handled by the carrier of course
> :)

I had exactly this problem once. What was happening was that I was
over-decrementing so that when Python exited it decremented one more time and
so blew up.

I'll be happy to take a look at your code. Feel free to send it directly to
my address.

-- 
Ignacio Vazquez-Abrams  <ignacio at openservices.net>






More information about the Python-list mailing list