[Pyrex] Inheritance (or lack thereof) of tp_flags

Steven Walter stevenrwalter at gmail.com
Tue Jan 23 19:51:06 UTC 2007


> Since very bad things seem to happen if a base
> type has Py_TPFLAGS_HAVE_GC set but a type derived
> from it doesn't, is this perhaps something that
> should be fixed?

It seems that this change is causing problems for me.  After upgrading
to FC6 (which entailed an upgrade from Pyrex-0.9.3.1 to 0.94.1) I
started getting segfaults and a funny error message* from my
pyrex-generated code.

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

Mostly through blind groping, I found that if I removed the HAVE_GC
flag from the generated C code, everything ran happily.  Perhaps the
flag can't be unconditionally set?  My extension object neither
inherits from a garbage-collected class, nor does it contain a python
object.  The other possibility is that there is some kind of bug in
the pyrex-generated GC routines, but I don't know where to begin
debugging such a thing.

Ideas what might be going on?
-- 
-Steven Walter <stevenrwalter at gmail.com>



More information about the Pyrex mailing list