Debugging a segmentation fault

Christian Heimes lists at cheimes.de
Thu Jul 8 13:32:15 EDT 2010


> my python project crashes in a non reproducible way. With gdb I got
> the backtraces given below.
> How can I possibly figure out the reason for the segfaults that occur
> under Linux and Windows, using Python 2.6 in both cases.

One of your third party C extension has a reference count bug. It looks
like it has an Py_INCREF() to little or a Py_DECREF() too much. The
first segfaults occurs in a decref macro:

  Objects/dictobject.c:911
  Py_XDECREF(ep->me_value);

, the second is a bit more obscure and hidden in the cyclic GC. The
error is either introduced by the same reference counting bug or in
error in the type definition and initialization.

Which third party products with C extensions do you use? Have you
updated your database adapter and NumPy yet?

Christian




More information about the Python-list mailing list