[issue1306] Embedded python reinitialization

Christian Heimes report at bugs.python.org
Wed Nov 21 05:56:00 CET 2007


Christian Heimes added the comment:

The patch solves one issue. It resets the Py_DefaultFileSystemEncoding
to NULL when no default value was given. However the finalization fails
after the 3rd round at 

        if (op == &refchain ||
            op->_ob_prev->_ob_next != op || op->_ob_next->_ob_prev != op)
                Py_FatalError("UNREF invalid object");

$ gdb ./reinit_test
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) run
Starting program: /home/heimes/dev/python/py3k/reinit_test
[Thread debugging using libthread_db enabled]
[New Thread -1210464064 (LWP 8060)]
round 1
[23832 refs]
round 2
[24558 refs]
round 3
Fatal Python error: UNREF invalid object

Program received signal SIGABRT, Aborted.
[Switching to Thread -1210464064 (LWP 8060)]
0xffffe410 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7dc7875 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7dc9201 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0x0805d62d in Py_FatalError (msg=0x81790d8 "UNREF invalid object")
at Python/pythonrun.c:1761
#4  0x080aac57 in _Py_ForgetReference (op=0x821d728) at
Objects/object.c:1536
#5  0x080aaca6 in _Py_Dealloc (op=0x821d728) at Objects/object.c:1555
#6  0x080c0f52 in tupledealloc (op=0x82ebc3c) at Objects/tupleobject.c:169
#7  0x080aacb1 in _Py_Dealloc (op=0x82ebc3c) at Objects/object.c:1556
#8  0x080c0f52 in tupledealloc (op=0x83f9154) at Objects/tupleobject.c:169
#9  0x080aacb1 in _Py_Dealloc (op=0x83f9154) at Objects/object.c:1556
#10 0x08083605 in code_dealloc (co=0x83b1bc8) at Objects/codeobject.c:276
#11 0x080aacb1 in _Py_Dealloc (op=0x83b1bc8) at Objects/object.c:1556
#12 0x081691bf in func_dealloc (op=0x83f7924) at Objects/funcobject.c:555
#13 0x080aacb1 in _Py_Dealloc (op=0x83f7924) at Objects/object.c:1556
#14 0x080a272e in PyDict_Clear (op=0x83f6df4) at Objects/dictobject.c:798
#15 0x080a524f in dict_tp_clear (op=0x83f6df4) at Objects/dictobject.c:1793
#16 0x08068c13 in delete_garbage (collectable=0xbf9fa024, old=0x81978e8)
at Modules/gcmodule.c:688
#17 0x0806909f in collect (generation=2) at Modules/gcmodule.c:824
#18 0x080699ea in PyGC_Collect () at Modules/gcmodule.c:1238
#19 0x0805a022 in Py_Finalize () at Python/pythonrun.c:416
#20 0x08059791 in main () at reinit_test.c:9
(gdb)

----------
assignee:  -> gvanrossum
nosy: +gvanrossum
Added file: http://bugs.python.org/file8790/py3k_reinit.patch

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1306>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: py3k_reinit.patch
Type: text/x-diff
Size: 1598 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-bugs-list/attachments/20071121/0ab95df4/attachment-0001.patch 


More information about the Python-bugs-list mailing list