Debugging reference count errors; PIL problem

Edward C. Jones edcjones at erols.com
Mon Jun 25 20:13:48 EDT 2001


I have some Python extensions written in C that have memory 
leaks. Almost certainly, I am doing something wrong with 
Py_INCREF or Py_DECREF. Some searching showed that this problem 
is common and that the solutions are not straightforward.

1. What is currently the easiest way to track down reference 
count errors?

2. I compiled and installed Python 2.1 with the "--with-pydebug" 
switch for "configure". Why do even trivial programs leave a 
large number of unDECREFed objects? Is there any documentation 
for using the reference count debugging features?

3. I compiled PIL. "import _imaging" fails with the message:

ImportError: ./_imaging.so: undefined symbol: Py_InitModule4

What's going on here?

Thanks,
Ed Jones




More information about the Python-list mailing list