[issue20066] PyStructSequence_NewType() not setting proper heap allocation flag?

Wolf Ihlenfeldt report at bugs.python.org
Wed Dec 25 14:33:19 CET 2013


New submission from Wolf Ihlenfeldt:

If I am not mistaken, I think that PyStructSequence_NewType() should set the Py_TPFLAGS_HEAPTYPE flag in tp->flags (which it currently does not). The original version initially works fine, but ultimately crashes at exit time in finalization with

Fatal Python error: type_traverse() called for non-heap type 'E_FILE'

#0  0x00007ffff12913d5 in raise () from /lib64/libc.so.6
#1  0x00007ffff1292858 in abort () from /lib64/libc.so.6
#2  0x00007ffff2360484 in Py_FatalError (msg=<optimized out>) at Python/pythonrun.c:2364
#3  0x00007ffff22e5354 in type_traverse (type=0x10b47a0, visit=0x7ffff2374350 <visit_decref>, arg=0x0)
    at Objects/typeobject.c:2892
#4  0x00007ffff2374bd1 in subtract_refs (containers=0x7ffff26466c0) at Modules/gcmodule.c:386
#5  collect (n_uncollectable=<synthetic pointer>, n_collected=<synthetic pointer>, generation=2)
    at Modules/gcmodule.c:891
#6  collect_with_callback (generation=2) at Modules/gcmodule.c:1048
#7  0x00007ffff2375436 in PyGC_Collect () at Modules/gcmodule.c:1476
#8  0x00007ffff235f698 in Py_Finalize () at Python/pythonrun.c:521
#9  0x00007ffff6e70b70 in CSpythonFinalize () at nmds_python.c:44652
#10 0x0000000000407399 in main ()

Setting the flag manually after creation lets the problem disappear.

----------
messages: 206923
nosy: Wolf.Ihlenfeldt
priority: normal
severity: normal
status: open
title: PyStructSequence_NewType() not setting proper heap allocation flag?
type: crash
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20066>
_______________________________________


More information about the Python-bugs-list mailing list