[Python-Dev] RE: CVS Python is unstable

Neil Schemenauer nas@arctrix.com
Fri, 23 Mar 2001 05:47:40 -0800


On Fri, Mar 23, 2001 at 12:10:33AM -0500, Tim Peters wrote:
> I *suspect* the difference wrt debug mode is right where it's blowing up:
> 
> static void
> gc_list_remove(PyGC_Head *node)
> {
> 	node->gc_prev->gc_next = node->gc_next;
> 	node->gc_next->gc_prev = node->gc_prev;
> #ifdef Py_DEBUG
> 	node->gc_prev = NULL;
> 	node->gc_next = NULL;
> #endif
> }

PyObject_GC_Fini() should not be called twice on the same object
unless there is a PyObject_GC_Init() in between.  I suspect that
Fred's change made this happen.  When Py_DEBUG is not defined the
GC will do all sorts of strange things if you do this, hence the
debugging code.

  Neil