[Python-bugs-list] [Bug #113812] Serious garbage collection problems with 2.0b1

noreply@sourceforge.net noreply@sourceforge.net
Thu, 7 Sep 2000 14:41:42 -0700

Bug #113812, was updated on 2000-Sep-07 10:10
Here is a current snapshot of the bug.

Project: Python
Category: Core
Status: Open
Resolution: None
Bug Group: None
Priority: 7
Summary: Serious garbage collection problems with 2.0b1

Details: Since I've installed version 2.0b1, I ran into a few (serious) problems
with a non-trivial application (+80,000 lines of Python). It seems that
the are all related to the new garbage collection:

 - Suddenly, assertions fail because lists have become empty 
   while they shouldn't have. I looks like their elements have been
   garbage collected while they were still reachable.

 - Under other circumstances, I get coredumps which always 
   seem to happen in function "move_root_reachable" of gcmodule.c:
   the "traverse" function pointer seems to contain a bogus address.

 - When I run a Purified version of the interpreter, I can't reproduce
   either problem, but instead, the garbage collector seems to get
   stuck in an endless loop each time. This always happens in the
   same function "move_root_reachable". Purify doesn't produce any 
   relevant warning.

The code runs just fine with version 1.6 of the interpreter, or when I
disable the garbage collector.

Probably relevant is the fact that the objects (10,000's) in my application
are very heavily cross-linked (nearly all links are bi-directional), which 
probably puts a lot of stress on the garbage collector.

My platform: HP-UX 10.20 / c89 compiler


Date: 2000-Sep-07 10:14
By: edg

Just one more thing: when I turn on the gc debugging,
the interpreter also seems to get stuck in an endless loop.

Date: 2000-Sep-07 14:41
By: jhylton

If you set the GC threshold to 0, 
import gc

Do you get the same problem?  Not that I doubt there is some sort of gc problem, but I wonder if there is something going wrong in the accounting or in the collection.

How hard would it be for someone to try to reproduce this bug?  Obviously, it would be helpful to get a smaller test case that has the same behavior as your large program and also tickles the bug.

Do you have any C extension modules in your application or is it pure Python?

For detailed info, follow this link: