Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-importing embedded thread dumps core #42085

Closed
jaytmiller mannequin opened this issue Jun 14, 2005 · 4 comments
Closed

Re-importing embedded thread dumps core #42085

jaytmiller mannequin opened this issue Jun 14, 2005 · 4 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@jaytmiller
Copy link
Mannequin

jaytmiller mannequin commented Jun 14, 2005

BPO 1220756
Nosy @mwhudson, @brettcannon, @nascheme

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/nascheme'
closed_at = <Date 2010-01-22.21:37:17.669>
created_at = <Date 2005-06-14.21:16:47.000>
labels = ['interpreter-core']
title = 'Re-importing embedded thread dumps core'
updated_at = <Date 2010-01-22.21:37:17.667>
user = 'https://bugs.python.org/jaytmiller'

bugs.python.org fields:

activity = <Date 2010-01-22.21:37:17.667>
actor = 'nascheme'
assignee = 'nascheme'
closed = True
closed_date = <Date 2010-01-22.21:37:17.669>
closer = 'nascheme'
components = ['Interpreter Core']
creation = <Date 2005-06-14.21:16:47.000>
creator = 'jaytmiller'
dependencies = []
files = []
hgrepos = []
issue_num = 1220756
keywords = []
message_count = 4.0
messages = ['25544', '25545', '25546', '25547']
nosy_count = 4.0
nosy_names = ['mwh', 'brett.cannon', 'nascheme', 'jaytmiller']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1220756'
versions = ['Python 2.4']

@jaytmiller
Copy link
Mannequin Author

jaytmiller mannequin commented Jun 14, 2005

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)

@jaytmiller jaytmiller mannequin assigned nascheme Jun 14, 2005
@jaytmiller jaytmiller mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jun 14, 2005
@jaytmiller jaytmiller mannequin assigned nascheme Jun 14, 2005
@jaytmiller jaytmiller mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jun 14, 2005
@mwhudson
Copy link

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...)

@mwhudson
Copy link

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?

@nascheme
Copy link
Member

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. :-(

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

No branches or pull requests

2 participants