[issue1977] Python reinitialization test

Christian Heimes report at bugs.python.org
Wed Jan 30 21:07:50 CET 2008


Christian Heimes added the comment:

Martin v. Löwis wrote:
> Martin v. Löwis added the comment:
> 
> I'm not sure what the purpose of this test is. When would it pass, when
> would it fail? I don't think it is a bug if a
> Py_Initialize()/Py_Finalize() cycle loses references.

Today my attempts to fix some reference leaks related to sys.flags and
sys.float_info caused the test to fail. A single init/final cycle worked
but the second cycle broke.

The test also shows an issue in Python 3.0. The double linked reference
list is broken:

$ ./test_reinit
round 1
[24676 refs]
round 2
[25588 refs]
round 3
* ob
object  : <refcnt 0 at 0x82248e8>
type    : str
refcount: 0
address : 0x82248e8
* op->_ob_prev->_ob_next
object  : <refcnt 0 at 0x82248e8>
type    : str
refcount: 0
address : 0x82248e8
* op->_ob_next->_ob_prev
object  : bytearray(b'')
type    : bytearray
refcount: 1
address : 0x839ab98
Fatal Python error: UNREF invalid object
Aborted (core dumped)

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1977>
__________________________________


More information about the Python-bugs-list mailing list