[Python-Dev] Segfault in python 2.5

Mike Klaas mike.klaas at gmail.com
Thu Oct 19 02:08:51 CEST 2006

On 10/18/06, Michael Hudson <mwh at python.net> wrote:
> "Mike Klaas" <mike.klaas at gmail.com> writes:

> I've been reading the bug report with interest, but unless I can
> reproduce it it's mighty hard for me to debug, as I'm sure you know.


> > Unfortunately, I've been attempting for hours to
> > reduce the problem to a completely self-contained script, but it is
> > resisting my efforts due to timing problems.
> >
> > Should I continue in that vein, or is it more useful to provide more
> > detailed results from gdb?
> Well, I don't think that there's much point in posting masses of
> details from gdb.  You might want to try trying to fix the bug
> yourself I guess, trying to figure out where the bad pointers come
> from, etc.

I've peered at the code, but my knowledge of the python core is
superficial at best.  The fact that it is occuring as a result of a
long string of garbage collection/dealloc/etc. and involves threading
lowers my confidence further.   That said, I'm beginning to think that
to reproduce this in a standalone script will require understanding
the problem in greater depth regardless...

> Are you absolutely sure that the fault does not lie with any extension
> modules you may be using?  Memory scribbling bugs have been known to
> cause arbitrarily confusing problems...

I've had sufficient experience being arbitrarily confused to never be
sure about such things, but I am quite confident.  The script I posted
in the bug report is all stock python save for the operation in <>'s.
That operation is pickling and unpickling (using pickle, not cPickle)
a somewhat complicated pure-python instance several times.  It's doing
nothing with the actual instance--it just happens to take the right
amount of time to trigger the segfault.  It's still not perfect--this
trimmed-down version segfaults only sporatically, while the original
python script segfaults reliably.


More information about the Python-Dev mailing list