471,595 Members | 1,252 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,595 software developers and data experts.

Fatal error: GC object already tracked

I'm developing a larger Python program, and one component (a text
parser for a networking protocol) happend to be terribly slow, while
quite a simple piece of code, so I decided to reimplement it in C.

However, my code seems to do something in err, since the program
semi-randomly locks somewhere outside my C-code (after returning to
python), and semi-randomly issues a "Fatal error: GC object already
tracked". As this is my first C-module ever, nearly straight from the
HOWTO, I don't have much clue as to what is really wrong with my
code...

The code is available for inspection at
http://grimoire.takeit.se/files/CReader.c, and the error happens at
line 1111 in that file...

TIA
/Egil
Jul 18 '05 #1
1 10094
On 11 Oct 2004 09:17:07 -0700, re****@takeit.se (Egil M?ller) wrote:
I'm developing a larger Python program, and one component (a text
parser for a networking protocol) happend to be terribly slow, while
quite a simple piece of code, so I decided to reimplement it in C.

However, my code seems to do something in err, since the program
semi-randomly locks somewhere outside my C-code (after returning to
python), and semi-randomly issues a "Fatal error: GC object already
tracked". As this is my first C-module ever, nearly straight from the
HOWTO, I don't have much clue as to what is really wrong with my
code...

The code is available for inspection at
http://grimoire.takeit.se/files/CReader.c, and the error happens at
line 1111 in that file...


Your CReader_Buffer_dealloc method should be calling PyObject_GC_UnTrack before
doing anything else, see:

http://docs.python.org/api/supportin...detection.html

I can't say for sure that that will fix your problem, but given the error
message you're getting, it seems like a good place to start.

---
Greg Chapman

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Tim Tyler | last post: by
reply views Thread by Vikram | last post: by
1 post views Thread by m.Ward | last post: by
reply views Thread by =?Utf-8?B?cGF0cmlja2RyZA==?= | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.