[Python-Dev] crash in dict on gc collect

Thomas Wouters thomas at python.org
Tue Jun 13 10:39:09 CEST 2006

On 6/13/06, Neal Norwitz <nnorwitz at gmail.com> wrote:
> # This crashes, but i need to print type(encoding_table) at end of
> cp1140.py

Here's a shorter version:

import codecs
decmap = u"".join(unichr(i) for i in xrange(256))
print type(codecs.charmap_build(decmap))

The source fo the crash is the EncodingMap type (defined in unicodeobject.c);
it has an invalid type:

Breakpoint 2, PyUnicode_BuildEncodingMap (string=0x2b97d44dbf40)
    at Objects/unicodeobject.c:3213
(gdb) print EncodingMapType
$1 = {_ob_next = 0x0, _ob_prev = 0x0, ob_refcnt = 1, ob_type = 0x0,
  ob_size = 0, tp_name = 0x53d15a "EncodingMap", tp_basicsize = 80,

Did someone forget a PyType_Ready() call when EncodingMap was added? (And
what other types are missing PyType_Ready() calls? :)
Thomas Wouters <thomas at python.org>

Hi! I'm a .signature virus! copy me into your .signature file to help me
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-dev/attachments/20060613/9991c905/attachment.html 

More information about the Python-Dev mailing list