[Python-Dev] A little GC confusion

David Abrahams David Abrahams" <david.abrahams@rcn.com
Fri, 22 Feb 2002 21:44:45 -0500

----- Original Message -----
From: "Martin v. Loewis" <martin@v.loewis.de>

> "David Abrahams" <david.abrahams@rcn.com> writes:
> > Nice try, but no cigar I'm afraid: copying the tp_is_gc slot from
> > PyType_Type into my metatype before PyType_Ready() doesn't prevent the
> > crash.
> >
> > Does anyone really understand what happens here?
> Understand why your code crashes?

I'm not asking that. I'm asking if anyone really understands how the flags
and tp_xxx slots are supposed to interact.

> Because there is a bug in it...

I /guess/ there's a bug in my code if you measure it against the standard
that says "if it doesn't work with the current Python source code, it's
buggy". I'd consider that standard a bit more legitimate if I could find,
for example, a mention of Py_TPFLAGS_HEAPTYPE *anywhere* in the Python docs.
As it stands, your position seems a bit more unhelpful than neccessary.

I can live with incomplete documentation if there's someone around who can
explain how the software is supposed to be used; I just want to fill in the
holes so that I know I'm not making important errors. I thought I was doing
everything right until a few days ago when someone tried something new with
my code and uncovered the GC crash. One can only cover so many cases with
tests. Even if I repair this problem, how can I be sure I've got the rest of
the formula right? Better docs would fix that problem, and give us an
objective standard against which to judge which code has bugs. In lieu of
that, I would hope that my questions would be answered in good faith.

[In the meantime, GC remains turned off for my types and metatypes]

> To understand what the bug is, one would have to study your code first.

I posted the code yesterday. Did you miss it? I'm sure you could figure out
how to apply the simple modification described at the top of this message.