[Python-bugs-list] [ python-Bugs-476129 ] gc.collect sometimes hangs

noreply@sourceforge.net noreply@sourceforge.net
Wed, 31 Oct 2001 15:10:46 -0800


Bugs item #476129, was opened at 2001-10-29 12:40
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=476129&group_id=5470

Category: Python Interpreter Core
Group: Python 2.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Mitch Chapman (mitchchapman)
Assigned to: Neil Schemenauer (nascheme)
Summary: gc.collect sometimes hangs

Initial Comment:
When run under Python 2.1 on Mandrake Linux 7.2 (kernel 2.2.17) the attached script
terminates normally.  When run on the same machine under Python 2.2b1 it
runs forever, printing an infinite sequence of "No such attribute __del__" messages
to stdout.

If you comment out the call to gc.disable in Container.refresh, the script terminates normally
under both versions of the interpreter.

----------------------------------------------------------------------

>Comment By: Neil Schemenauer (nascheme)
Date: 2001-10-31 15:10

Message:
Logged In: YES 
user_id=35752

Closing because I'm quite sure the 2.26 change to gcmodule.c
fixed this problem.

----------------------------------------------------------------------

Comment By: Neil Schemenauer (nascheme)
Date: 2001-10-29 15:45

Message:
Logged In: YES 
user_id=35752

I think the bug is that gc.collect() does not do locking.  The
collector can start running twice.  That can corrupt the GC
linked lists. Please try the attached patch with 2.2.  I think
this bug is in 2.1 as well.  I'd check the patch in now but
SF CVS seems to be broken.

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-10-29 13:02

Message:
Logged In: YES 
user_id=6380

Assigning to Neil Schemenauer, our GC expert.

Note that in 2.1, I get a whole bunch of messages "No such
attribute __del__" to stdout too -- but it stops.

In 2.2, the *first* call to c=Container() and c.delegate()
does the same thing. But the *second* call to Container()
causes an infinite number
of messages to print (even if it's not deleting the first c
instance).

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=476129&group_id=5470