[Stackless] Advice on Tracking down GC Assertion Failure

Kristján Valur Jónsson kristjan at ccpgames.com
Mon Nov 29 06:34:16 CET 2010

What this means is that the reference count of the target object is too low.  One of your objects holds a reference to it without having INCRefed it, and also visits it during the gc_visit callback.
That is the most likely explanation.  The other is that it is just a general reference mistake that accidentally shows up during GC.
Catch the target object and figure out what object it is, also take a look at from where it is being referenced.  This ought to give you an idea about it.  Use the debugger to examine "op" when the assertion fails.

-----Original Message-----
From: stackless-bounces at stackless.com [mailto:stackless-bounces at stackless.com] On Behalf Of Andrew Francis
Sent: Monday, November 29, 2010 5:17
To: stackless at stackless.com
Subject: [Stackless] Advice on Tracking down GC Assertion Failure

Hi Guys:

I know that this is with my experimental version of Stackless Python with select() so it is a bit more difficult to track down.

However I am getting a number of errors that result in the following:

python: Modules/gcmodule.c:277: visit_decref: Assertion `gc->gc.gc_refs != 0' failed.

In the past, Kevin and I tried various things to track down the error. I figure the problem revolves around not decrementing a reference count somewhere. Can anyone recommend a strategy for hunting this down? I have to admit that I am not as familiar with the C code base as Kevin was but now I am working on it.


P.S: here is output and a coding example that works with stackless.py

DANCER starting 12
PRANCER starting 9
VIXEN starting 12
COMET starting 7
CUPID starting 6
DONER starting 10
DASHER starting 7
BLITZEN starting 11
RUDOLPH starting 9
A starting 2
B starting 4
C starting 4
D starting 6
E starting 8
F starting 2
G starting 4
H starting 7
python: Modules/gcmodule.c:277: visit_decref: Assertion `gc->gc.gc_refs != 0' failed.


More information about the Stackless mailing list