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: Python garbage collector isn't detecting deadlocks
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: nascheme Nosy List: nascheme, nmarushak
Priority: normal Keywords:

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

Files
File name Uploaded Description Edit
garbage collection issue.txt nmarushak, 2005-04-04 16:29 A sample python command screen dump demonstrating the issue.
Messages (2)
msg24881 - (view) Author: Nathan Marushak (nmarushak) Date: 2005-04-04 16:29
BACKGROUND INFORMATION:
Python version: Python 2.3.3 (#1, May  7 2004, 
10:31:40)
Operating System: Linux 2.6.7-1.494.2.2smp #1 SMP 
Tue Aug 3 09:59:49 EDT 2004 i686 i686 i386 GNU/Linux

PROBLEM:
The 2.3.3 garbage collector does not appear to detect 
deadlocks that occur when 2 objects reference one 
another.  I checked the existing bug list, albeit briefly, to 
see if a similar bug had already been entered.  I did not 
find an existing entry, but I apologize if this is a 
duplicate.

I've attached a short example output file that 
demonstrates the issue.

It would be beneficial if the "gc" module could detect 
when 2 objects have no other outstanding references 
except to one another.  If modifying gc is not possible 
for some reason, then updating the Python gc 
documentation to illustrate this issue would be helpful.

WORKAROUND:
The problem can be worked around by ensuring each 
object removes the circular reference when it no longer 
needs to refer to the other object.
msg24882 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2005-04-04 18:22
Logged In: YES 
user_id=35752

The gc is working as intended and as documented.  Please
refer to the gc module documentation, especially the section
on the "garbage" attribute.  Your objects are not collected
because they have __del__ methods.
History
Date User Action Args
2022-04-11 14:56:10adminsetgithub: 41803
2005-04-04 16:29:07nmarushakcreate