Coredumps with Python 2.1.1-3

Phil Mayers p.mayers at ic.ac.uk
Tue Feb 26 13:54:28 EST 2002


I'm using the RPM for Python 2.1.1-3 from the Python website, and have
just had a *really* weird problem. I was editing some code, and did a
test run. It all worked. I turned to chat to a colleague again - turned
back a few minutes later, scrolled one line up in the shell history, BOOM
core dump with the following traceback:

#0  0x806f9e1 in Py_GetProgramFullPath ()
#1  0x80928d2 in PyTuple_GetSlice ()
#2  0x806fa12 in Py_GetProgramFullPath ()
#3  0x806fe0c in Py_GetProgramFullPath ()
#4  0x807009a in Py_GetProgramFullPath ()
#5  0x80700e9 in _PyGC_Insert ()
#6  0x807ea82 in PyMethod_New ()
#7  0x807c640 in PyInstance_New ()
#8  0x807c2ae in PyInstance_New ()
#9  0x8058c70 in PyEval_CallObjectWithKeywords ()
#10 0x805939b in PyEval_CallObjectWithKeywords ()
#11 0x8057830 in PyEval_EvalCode ()
#12 0x8054e22 in PyEval_EvalCode ()
#13 0x806c1c5 in PyRun_FileExFlags ()
#14 0x806b5a5 in PyRun_SimpleFileExFlags ()
#15 0x8051f90 in Py_Main ()
#16 0x40077f31 in __libc_start_main (main=0x8051a50 <main>, argc=7, ubp_av=0xbffffa64, init=0x8050eb8 <_init>, fini=0x809eb60 <_fini>, 
    rtld_fini=0x4000e274 <_dl_fini>, stack_end=0xbffffa5c) at ../sysdeps/generic/libc-start.c:129

No debugging symbols in the binary I have (grr!) - will attempt to get a
version compiled with them in an repro it.

Funnies - I'm using the psycopg database adaptor, *BUT* the crash is
definitely happening in pure python code (isolated using sys.stderr.write
and some sleeps). It seems to happen (mostly) in a line:

de = null()

Where null is a class:

# Stupid psycopg doesn't turn None into null
# when quoting
class null:
        def __init__(self):
                pass

        def __str__(self):
                return 'null'

WTF? Even weirder, if I remove the line of input on which the crash
happens, it will get a lot further, but die somewhere else... Very
strange...

I can't post the exact code of the script, due to the fact it's filled
with internal information, but will try to isolate a test case. The
various versions involved are:

[hdb at hdb DoC]$ python2
Python 2.1.1 (#1, Oct 19 2001, 17:19:16) 
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-85)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.version
'2.1.1 (#1, Oct 19 2001, 17:19:16) \n[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-85)]'

psycopg 0.99.5

Unhelpful suggestions would be to "upgrade" any component of the system
at all. This is a heavy production system, and I've nearly killed it once
because of Python dependencies on weird things in the thread libraries...

Suggestions welcome - help!

Cheers,
Phil



More information about the Python-list mailing list