Searching for the meaning of gcmodule.c assert:`gc->gc. gc_refs ==GC_REACHABLE'

D

David Helgason

I am embedding python on Mac OSX (jaguar + panther) using
boost::python. It works like a treat, but when using a python framework
with asserts compiled in, I sometimes get an assert from gcmodule.c,
line 215 when compiling a script.

Modules/gcmodule.c:215: failed asserrtion `gc->gc.gc_refs ==
GC_REACHABLE'

This is maybe the third script I compile, so the python environment
should still be very clean.

I tried reading the code in gcmodule.c but don't understand what the
assert is warning me about or what is wrong here. Since I'm embedding
python I suspect that I'm doing something wrong with reference
counting, but in a ref-counted world that would either lead to leaks or
crashes. Can wrong ref-counting confuse the garbage collector so badly
that it asserts?

Since I don't really need the garbage collector I've tried disabling it
from python, and that fixes the problem. Only I'm worried that I've
just managed to hide a bug, not remove it.

I would be infinitly thankful if anyone could point me in a general
direction as to what the problem might be.


David Helgason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top