[ python-Bugs-1241545 ] garbage collection asserts failing

SourceForge.net noreply at sourceforge.net
Thu Jul 21 20:05:46 CEST 2005


Bugs item #1241545, was opened at 2005-07-20 08:27
Message generated for change (Comment added) made by munder12
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1241545&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: munder12 (munder12)
Assigned to: Nobody/Anonymous (nobody)
Summary: garbage collection asserts failing

Initial Comment:
Modules/gcmodule.c:294: visit_reachable: Assertion
`gc_refs > 0 || gc_refs == (-3) || gc_refs == (-2)' failed.

Running Python 2.3.4 on Fedora Core 3 (2.6.11-1.35_FC3smp).
Also tried Python 2.3.5.

When searching Google for this error, found following
link where someone using yum updates was getting same
error from python

http://forums.fedoraforum.org/showthread.php?t=54704



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

>Comment By: munder12 (munder12)
Date: 2005-07-21 13:05

Message:
Logged In: YES 
user_id=1156202

Well, this gets even stranger.  I am not running a debug
version of python as far as I can tell.

I built 2.4.1 in a fresh directory by:
./configure --prefix=/blah
make
make test
make install

The gcmodule was echo'd as being built this way:
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -I. -I./Include  -DPy_BUILD_CORE -o
Modules/gcmodule.o Modules/gcmodule.c

I am leaning toward psyco as being the culprit based on your
suggestions since it is the only one that has extra C libraries.

I'm running the case with Tkinter, pyro, and psyco all not
being imported.

Thanks again,
Mark

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

Comment By: Tim Peters (tim_one)
Date: 2005-07-20 19:35

Message:
Logged In: YES 
user_id=31435

I'm intimately familiar with the gc code, and I'm sure this 
assert has never triggered in any core Python release, or in 
any Zope release, not even in between-releases buggy 
development states.

It means some memory gc is staring at has an insane value, 
one that can't possibly arise in intended operation.  If you get 
into gdb (whatever debugger you have), it might be useful to 
know what value gc_refs _does_ have at this point.

One possibility is that you're mixing a debug-build Python 
(which you are using:  asserts never trigger in a release-build 
Python, simply because the assert() macro expands to 
nothing then) with one or more release-build extension 
modules.  Trying to mix like that can blow up in all sorts 
of "impossible" ways.

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

Comment By: munder12 (munder12)
Date: 2005-07-20 19:04

Message:
Logged In: YES 
user_id=1156202

Sorry, I realize it is not much to go on but I cannot currently 
get it to fail other than when I run this one script.  It is all 
written in python.  It is a simulation running a genetic 
algorithm that is set up to run about 24 hours straight.  This 
error occurs within about 5 hours into the simulation 
(repeatedly).  Running similar simulations that complete in 
less than a couple hours run without a problem.

Was hoping someone familiar with the gc routines might 
go  "oh, yeah... -4 is valid now too.." or something similar.

In the meantime, I will be trying to continue to reduce the 
number of imported modules where I can still get the problem 
to happen  There are 2 modules psyco and pyro that are non-
core and Tkinter.  

But since the Google search turned up yum giving same error 
(which I doubt uses psyco, pyro, or Tkinter), I thought I would 
mention it here as I continued searching. 


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

Comment By: Tim Peters (tim_one)
Date: 2005-07-20 16:24

Message:
Logged In: YES 
user_id=31435

Well, this isn't enough info to go on.  For example, what 
program was Python running at the time?  What were you 
doing?  How could anyone else try to reproduce this?  It's 
certainly not something Python normally does ;-)

FWIW, the most likely cause is bad C coding in a Python 
extension (non-core) module.  That the problem persists for 
you across Python versions points even more at non-core C 
code.

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

Comment By: Neil Schemenauer (nascheme)
Date: 2005-07-20 16:20

Message:
Logged In: YES 
user_id=35752

Usually this kind of error is caused by a bug in a 3rd party
extension module.  Try to narrow down the test case as much
as possible.  Can you provide a Python script that triggers
the assertion failure?

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

Comment By: munder12 (munder12)
Date: 2005-07-20 16:15

Message:
Logged In: YES 
user_id=1156202

This also fails in Python 2.4.1 on same system.

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

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


More information about the Python-bugs-list mailing list