Fatal Python error: GC object already in linked list

Jimmy Retzlaff jimmy at retzlaff.com
Tue Apr 30 14:15:38 EDT 2002


I'm working on an application in Python and my application occasionally
dies with the error:

Fatal Python error: GC object already in linked list

I'm quite unfamiliar with Python's implementation, but I tried studying
a little in this case. That error message only appears in a macro in
objimpl.h (_PyObject_GC_TRACK), and that macro only seems to be used in
a function that creates traceback objects in traceback.c
(newtracebackobject). Looking at CVS it appears the use of that macro
was added to prevent the old memory leak that could happen when calling
sys.exc_info().

My program is a non-trivial (~15K lines of Python) GUI app on Windows
based on wxPython. I've been developing this app for 6-8 months and the
error just started showing up about 3 weeks ago. I haven't updated any
major components (other than my own code) for a few months, so I'm
guessing my own code changes have triggered this.

Occurrences seem quite random, which can indicate timing issues of
course. If my app is started and left alone, the error will occur
anywhere from 10 seconds to several hours later. I do some idle and
timer processing. That processing does regularly raise and handle
exceptions (which I assume tickles newtracebackobject), but it all seems
to be pretty vanilla stuff. The timer processing was added only a few
days before I discovered the problem.

Anyone have any ideas about what kind of thing might cause such a
problem?

Thanks in advance,
Jimmy


p.s. -- some version information of heavily used components:

Windows XP Pro (I've also seen the problem on Windows 2000)
Python 2.2 (the standard Windows binary distribution)
Win32all Build 146
wxPython 2.3.2.1 Hybrid (also seen it with a Normal build)
Numeric 20.3





More information about the Python-list mailing list