Python 2.2 __slots__ Bug?

Jonathan Hogg jonathan at onegoodidea.com
Wed Jun 26 09:00:48 EDT 2002


On 26/6/2002 12:03, in article
mailman.1025089474.17780.python-list at python.org, "Glyph Lefkowitz"
<glyph at twistedmatrix.com> wrote:

> I get "I'm fine" and then a segmentation fault.  This only happens when
> __slots__ is defined on a new-style class.  Seriously, i'm not making those
> numbers up -- reliably, 43551 objects will crash the interpreter; fewer will
> not.

Interestingly I get the construction working fine, but the 'del' crashes the
interpreter with (on Mac OS X):

-----
Date/Time:  2002-06-26 13:53:19 +0100
OS Version: 10.1.5 (Build 5S66)

Command:    python
PID:        18472

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0xbff7ffe0

Thread 0 Crashed:
 #0   0x00037bbc in lookdict_string
 #1   0x0003804c in PyDict_GetItem
 #2   0x00018994 in _PyType_Lookup
 #3   0x00017348 in lookup_maybe
 #4   0x00016f38 in call_finalizer
 #5   0x00017054 in subtype_dealloc
 #6   0x00017118 in subtype_dealloc
 #7   0x00017118 in subtype_dealloc
[etc...]
-----

This seems to fail for me at 5430 objects. I couldn't get the allocation to
crash at all (or at least up to a million objects, after which I got bored).

Jonathan




More information about the Python-list mailing list