[Python-Dev] Crashes w/ CVS tree

Thomas Wouters thomas@xs4all.net
Wed, 9 May 2001 10:58:50 +0200


I'm getting a crash with Python compiled from a freshly updated CVS tree,
even when running just './python'. It crashes during the loading of os.pyc.
It doesn't crash if I start python with -S, and it doesn't crash if I remove
*.pyc first:

centurion:~/python/python-2.2/dist/src/linux> ./python 
Python 2.2a0 (#4, May  9 2001, 09:52:29) 
[GCC 2.95.4 20010506 (Debian prerelease)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> 
centurion:~/python/python-2.2/dist/src/linux> ./python
Segmentation fault

If I remove os.pyc only, I get the enlightning:

Fatal Python error: PyString_InternInPlace: strings only please!
Abort (core dumped)

I would blame Tim <wink>, except that when examining the corefile I found
some pointers to other causes. The 'original' crash occurs because
cmp_outcome() is passed an invalid PyObject, with most of its function slots
pointing to the middle of the glibc-internal '__morecore()' function.
Examining the stack off of which the invalid item was popped reveals that
the next-to-last item is an iterator. So maybe I should blame Guido instead,
either for the iterator or for rich comparisons ;)

>From what I can tell, the segfault happens in os.py, here:

    import posixpath
    path = posixpath
    del posixpath

    import posix
    __all__.extend(_get_exports_list(posix))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    del posix

elif 'nt' in _names:

That is, after importing posix, while getting the exports lists. Which, in
the case of posixmodule, uses a list comprehension.... which now uses an
iterator... so maybe it's Tim after all. :-)

Unfortunately, I don't have time to look at it right now (meetings,
meetings.) If noone is looking at it by the time I'm back and free, I'll
hunt some more ;)

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!