[Stackless] Re: [Python-Dev] _Py_RefTotal wrong in Py 2.2.3 (original) (raw)

Michael Hudson mwh at python.net
Mon Nov 17 07:24:25 EST 2003


Armin Rigo <arigo at tunes.org> writes:

Hello Christian,

On Mon, Nov 17, 2003 at 02:02:48AM +0100, Christian Tismer wrote: I debuged this down to the very end, until I was sure my stuff is doing it right. Then I added a small function that recomputes the actual total refcounts from the chained list of all objects, and it turned out to be correct (and also my pickling), but PyRefTotal is different. I found a few places that manipulate obrefcnt directly without worrying about keeping PyRefTotal or other debugging information in sync:

Um, don't most of these places at least try to keep _Py_RefTotal in sync? I am aware of a few places that get this wrong, but the fixes weren't obvious to me.

* classobject.c:instancedealloc(), for del

One way of getting _Py_RefTotal out of sync is resurrecting objects in del methods. Another is some bizarre interaction with the trashcan machinery (don't recall what, sorry, may also be different with 2.2 vs 2.3).

* stringobject.c, for interned strings

* typeobject.c:slottpdel(), for del too I bet you could also find these easily, but maybe it should be regarded as a bug list.

I think these are bugs.

At any rate, the del tricks will indeed make some counters invalid.

Which del tricks specifically?

Cheers, mwh

-- Strangely enough I saw just such a beast at the grocery store last night. Starbucks sells Javachip. (It's ice cream, but that shouldn't be an obstacle for the Java marketing people.) -- Jeremy Hylton, 29 Apr 1997



More information about the Python-Dev mailing list