This program makes Python segfault - no other does

Terry Reedy tjreedy at udel.edu
Mon May 17 10:57:55 EDT 2004


"Juho Saarikko" <sorry at but.no.spam> wrote in message
news:pan.2004.05.17.10.17.01.120134 at but.no.spam...
> The program attached to this message makes the Python interpreter
segfault
> randomly. I have tried both Python 2.2 which came with Debian Stable, and
> self-compiled Python 2.3.3 (newest I could find on www.python.org,

2.3.4 was just released.  I believe it fixed two segfault bugs.

> compiled with default options (./configure && make). I'm using the
pyPgSQL
> plugin to connect to a PostGreSQL database, and have tried the Debian and
> self-compiled newest versions of that as well.

Based on posts over several years, seq faults most often arise from
1. buggy compilers, especially at 'higher' optimization settings
2. buggy compiled extensions
3. byte code fiddling
and only occasionally from
4. Python interpreter bugs
which the developers consider high priority for squashing.

> Specifically, I'm wondering if my habit of reusing old variable names in
a
> function once they are no longer needed might be causing the trouble;
> maybe it causes confusion on the variable type ?

Very dubious to me; at worst you should get an exception with traceback.

> So, here's the program. Does anyone know what's wrong with it ?

Since you don't seem to be fiddling with internals, there is no way I know
to eyeball the code and tell which line is doing the 'impossible'.  So I
think it up to you to determing the offending line by uncommenting print
statements and adding more as needed.  Then see if you can reduce the
program and still get segfaults.

Terry J. Reedy







More information about the Python-list mailing list