This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Re-importing embedded thread dumps core
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: nascheme Nosy List: brett.cannon, jaytmiller, mwh, nascheme
Priority: normal Keywords:

Created on 2005-06-14 21:16 by jaytmiller, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg25544 - (view) Author: Jay T Miller (jaytmiller) Date: 2005-06-14 21:16
I noticed the following while working on an "embedding
numarray" problem:

[jmiller@halloween Python-2.4.1]$
Python-2.4.1/Demo/embed/loop 'from thread import *' 10
[6675 refs]
[7009 refs]
[7320 refs]
[7631 refs]
[7942 refs]
[8253 refs]
loop: Objects/typeobject.c:2104: type_dealloc:
Assertion `type->tp_flags & (1L<<9)' failed.
Abort (core dumped)

The tp_flags bit in question is:

#define Py_TPFLAGS_HEAPTYPE (1L<<9)

msg25545 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2005-06-15 11:35
Logged In: YES 
user_id=6656

Oh dear.  The problem here is that PyModule_AddObject steals a 
reference to the object, but this is not taken care of in threadmodule.c (or 
gcmodule, it turns out, and I bet many other places).

Shouldn't be too hard to fix.

(Looks like noone's run Demo/embed/loop for a while...)
msg25546 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2005-06-15 12:28
Logged In: YES 
user_id=6656

Fixed the issue in the report in revision 2.62 of Modules/threadmodule.c.

I'm leaving this open because "./loop 'import gc'" crashes and because I 
think there are too many places that incref before 
PyModule_AddObject()...

Neil, any ideas about the gc one? 
msg25547 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2005-06-18 17:41
Logged In: YES 
user_id=35752

I add an incref in gcmodule.c 2.81.  "./loop 'import gc'" no
longer crashes but it does leak memory. :-(
History
Date User Action Args
2022-04-11 14:56:11adminsetgithub: 42085
2010-01-22 21:37:17naschemesetstatus: open -> closed
resolution: fixed
2009-02-11 02:59:46ajaksu2setnosy: + brett.cannon
2005-06-14 21:16:47jaytmillercreate