New submission from Bradley Froehle:

In Python 3.3.0, several global `PyTypeObject`s are not initialized using 
PyType_Ready(...).

The list of uninitialized type objects::

  PyCapsule_Type
  PyLongRangeIter_Type
  PyFieldNameIter_Type
  PyFormatterIter_Type
  PySTEntry_Type
  PyCell_Type
  PyInstanceMethod_Type
  PyClassMethodDescr_Type
  PyMethodDescr_Type
  PyCallIter_Type
  PySeqIter_Type
  PyDictDummy_Type

Each of these can be verified using gdb::

  $ gdb -quiet python3.3
  Reading symbols from /opt/python/3.3.0/bin/python3.3...done.
  (gdb) break Py_Finalize
  Breakpoint 1 at 0x4a40a0: file Python/pythonrun.c, line 478.
  (gdb) run -c "pass"
  Starting program: /opt/python/3.3.0/bin/python3.3 -c "pass"
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

  Breakpoint 1, Py_Finalize () at Python/pythonrun.c:478
  478       if (!initialized)
  (gdb) print PyCell_Type->tp_mro
  $1 = (PyObject *) 0x0

(The list of uninitialized types was built by searching "info variables" in gdb 
to produce a list of PyTypeObjects. Those with <name>->tp_mro != NULL were 
treated as properly initialized. The remainder were further inspected by hand 
to throw out additional false positives, like those from modules which had been 
statically compiled into the Python binary).

I'm not sure if any of these actually need fixing, but for PyCell_Type this 
issue already resulted in one obscure bug: #16268.

----------
components: Interpreter Core
messages: 174255
nosy: bfroehle
priority: normal
severity: normal
status: open
title: Global PyTypeObjects not initialized with PyType_Ready(...)
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16369>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to